'SonarQube - how to deactivate inherited rule in quality profile?

Using SonarQube, we wish to create a new quality profile from an existing profile, but deactivate a couple of the rules. The GUI allows us to modify the severity of inherited rules, but not deactivate the rules.

Is there any way to achieve this?

A workaround is to copy the profile and modify it, but we wish to retain the link to the original profile so that our inherited profile picks up any changes that are made to the original profile.



Solution 1:[1]

It is not possible to deactivate a rule inherited from a parent quality profile.

Solution 2:[2]

Independent of the used profile, you can always ignore rules on the project level: Go to the project's Administration --> General Settings menu. From there, go to Analysis Scope --> Issues.

Add the rule(s) you want to ignore to the Ignore Issues on Multiple Criteria list with ** as File Path Pattern.

Solution 3:[3]

So you just edit your sonar-project.properties file and you can turn off any rule for JUST your project.

Follow this template example here: https://github.com/simgrid/simgrid/blob/master/sonar-project.properties

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Fabrice - SonarSource Team
Solution 2 Leviathan
Solution 3 Waxhaw