Support for Cognitive Complexity for SonarLint in Visual Code

We’re using SonarQube 8.1 and have a Quality Gate that has a rule define that code cannot have a Cognitive Complexity number above 10 which works great when code is checked in.

Our developers use Visual Code with SonarLint installed which connects to the SonarQube server and provides feedback EXCEPT for the Cognitive Complexity violations.

Does SonarLint for Visual Code not support calculating CC in the IDE?

1 Like

Sorry, I’m not able to reproduce the problem.

Does SonarLint report any issue in the file where you expect a cognitive complexity violation? Please be aware that SonarLint ignores files which have ‘test’ somewhere in their path.