Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonarQube - how to deactivate inherited rule in quality profile?

Tags:

sonarqube

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.

like image 669
Nigel Charman Avatar asked Jan 14 '14 02:01

Nigel Charman


People also ask

Which is the default profile used in SonarQube quality profile?

Built-in and default profiles SonarQube comes with a built-in quality profile defined for each supported language, called the Sonar way profile (it is marked with the BUILT-IN tag in the interface).

Is it possible to copy a profile from one SonarQube instance to another?

Copy a profile from one SonarQube instance to another? Use the Back up feature on the source instance to export the profile to an XML file. Use the Restore Profile feature on the target instance to import the file.


2 Answers

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.

like image 120
Leviathan Avatar answered Sep 25 '22 14:09

Leviathan


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

like image 28
Fabrice - SonarSource Team Avatar answered Sep 26 '22 14:09

Fabrice - SonarSource Team