Cognitive Complexity and different severities

Hi,
I’m working on a team of Java developers using and loving SonarQube.
The Cognitive Complexity rule is very helpful at pointing out smells in our code.

A nice extension would be to be able to configure the severity of an issue raised by the rule based on the complexity measured.
So e.g.
Complexity > 25 ==> Critical issue
Complexity > 15 ==> Major issue

Is this possible already?
If not, is this functionality something you could consider adding in a future version?

(Thanks to sonarsource for creating this excellent product!)

Hi,

Thanks for the kind words.

It’s not possible to vary severity per issue, and regardless of what an intriguing idea it is to increase severity with distance from the threshold, this is not currently in our plans.

 
Ann

I also have a use case for variable severity depending on rule parameters. E.g. line length between 80 and 120 could be info, between 121 and 150 minor, and anything above major.

So crossing my fingers for this functionality, but not holding my breath :slight_smile:.