Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filter issues in sonarqube by ignoring a rule

Tags:

sonarqube

In the web UI of SonarQube, you can filter issues based on several criteria. But it seems none of them can be negated.

I like to find out all critical issues, that are not rule xyz. I currently see from the web UI only the possibility to select what I like to see, not what I not want to see.

Is there any way to create such a query?

like image 911
Emerson Cod Avatar asked Sep 20 '25 04:09

Emerson Cod


1 Answers

No, currently there is possibility to do that from the user interface. Not even the REST api, provides such functionality.

From the API-docs:

Comma-separated list of coding rule keys. Format is <repository>:<rule>

This does not allow any special syntax for to specifically exclude a rule.

However these two suggestions might help:

  • Query for all rules, except the one you want to exclude. This will be a quite long query (lots of clicks to do...), but should work.
  • Remove that rule from the quality profile. The rule will not be active in the next analysis and the issues won't be visible anymore (but this means not visible to you and all other users).
like image 153
slartidan Avatar answered Sep 23 '25 09:09

slartidan