NetPackageAnalyzer–part 12-CyclomaticComplexity

The .NET Tool , https://www.nuget.org/packages/netpackageanalyzerconsole , can now analyze a solution and see the cyclomatic complexity.

Cyclomatic Complexity for assembly, class, method

The cyclomatic complexity of a section of code is the number of linearly independent paths through the code. It is a quantitative measure of the number of linearly independent paths through a program’s source code.

The program is showing the cyclomatic complexity of the assembly, class, and method. You should start with the method – it is the easy to analyze .

diagram

Also , you can see on which methods you should focus to refactor – the ones with the highest cyclomatic complexity.

diagram

https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-cyclomatic-complexity?view=vs-2022

Install from https://nuget.org/packages/netpackageanalyzerconsole