Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable rule in sonar

I want to disable a rule from Sonar so it doesn't show the results in the web page. In my case I want to hide (or not capture) the results about trailing comments.

Is it posible to configure it somewhere?

Thanks.

like image 835
maqjav Avatar asked May 06 '13 12:05

maqjav


People also ask

How do I turn off rules in Sonar?

You can not modify the built-in profiles. If you don't see the option of Deactivate, then copy the profile and set it as default. Now you will see the options to activate/deactivate. Show activity on this post.


2 Answers

The right way to do is to put something like this on sonar-project.properties file per project:

sonar.issue.ignore.multicriteria=e1,e2 # tab characters should not be used sonar.issue.ignore.multicriteria.e1.ruleKey=squid:S00105 sonar.issue.ignore.multicriteria.e1.resourceKey=**/*.java # right curly braces should be on a new line sonar.issue.ignore.multicriteria.e2.ruleKey=squid:RightCurlyBraceStartLineCheck sonar.issue.ignore.multicriteria.e2.resourceKey=**/*.java 
like image 78
norbertas.gaulia Avatar answered Sep 28 '22 03:09

norbertas.gaulia


You have to remove this rule in the quality profile that you are using to analyse your project.

Please refer to the documentation that describes all this: Quality Profiles in Sonar.

like image 30
Fabrice - SonarSource Team Avatar answered Sep 28 '22 04:09

Fabrice - SonarSource Team