Can people suggest the best tool to determine the cyclic complexity with in a C# winforms code base.
Checkstyle computes cyclomatic complexity metrics and you can run it from command line.
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.
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.
In Visual Studio I just go to Analyze/Calculate Code Metrics and I get cyclomatic complexity.
NDepend has a huge number of code analysis and query tools including Cyclomatic Complexity per type and method estimation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With