Show Cognitive Complexity of method in Visual Studio

7.2k Views Asked by At

While using SonarLint and SonarQube in Visual Studio (2017), is there a way to display the Cognitive Complexity of a method anywhere?

It is shown when it exceeds the maximum value, but I can't seem to find where I can see it once I'm below the threshold.

"Refactor this method to reduce its Cognitive Complexity from 29 to the 15 allowed"

1

There are 1 best solutions below

0
On BEST ANSWER

If you have Resharper in Visual Studio you can use the cognitivecomplexity resharper plugin.

It shows the cognitive complexity even though it is below the (in Resharper options configurable) threshold

Cognitive Complexity in tooltip