Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best tool to determine code Cyclomatic complexity [closed]

Tags:

Can people suggest the best tool to determine the cyclic complexity with in a C# winforms code base.

like image 778
leora Avatar asked May 19 '09 18:05

leora


People also ask

Which tool can you use to detect cyclomatic complexity of methods?

Checkstyle computes cyclomatic complexity metrics and you can run it from command line.

How do you test the complexity of a code?

You compute it by using the control flow graph of the program. Cyclomatic complexity measures the number of nested conditions within the code, such as those created by for, if/else, switch, while, and until. The greater the number of conditions (as in example b from above), the greater the complexity.

Which testing is equivalent to cyclomatic complexity?

One testing strategy, called basis path testing by McCabe who first proposed it, is to test each linearly independent path through the program; in this case, the number of test cases will equal the cyclomatic complexity of the program.


2 Answers

In Visual Studio I just go to Analyze/Calculate Code Metrics and I get cyclomatic complexity.

3rd party edit

  • Visual Studio 2015 community edition has it as well
like image 143
Steven Avatar answered Oct 03 '22 11:10

Steven


NDepend has a huge number of code analysis and query tools including Cyclomatic Complexity per type and method estimation.

like image 27
Paul Alexander Avatar answered Oct 03 '22 09:10

Paul Alexander