Articles → .NET → Cyclomatic complexity using Visual Studio

Cyclomatic complexity using Visual Studio






What is cyclomatic complexity?






int x = Convert.ToInt32(Console.ReadLine());
if (x % 2 == 0)	
   Console.WriteLine("Even");
else
   Console.WriteLine("Odd");





Click to Enlarge




Significance of cyclomatic complexity




Cyclomatic ComplexityRisk Evaluation
1 to 10A simple program, without much risk
11 to 20More complex, moderate risk
21 to 50Complex, high-risk program
Greater than 50Untestable program (very high risk)



How to calculate cyclomatic complexity using visual studio









Click to Enlarge




Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Sunday, February 07, 2016

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250