Asked by: Moulouda Astsaturov
asked in category: General Last Updated: 24th May, 2020

How do you set rules in SonarQube?

Once your new rule is written, you can add it SonarQube:
  1. Login as an Quality Profile Administrator.
  2. Go to the Rules page.
  3. Select the Language for which you want to create the XPath rule.
  4. Tick the Template criterion and select "Show Templates Only"
  5. Look for the XPath rule template.

Click to see full answer.

Moreover, how do I change rules in SonarQube?

You can't modify an existing rule. A workaround is to write a custom rule. However, you should first seriously consider whether the behavior you want to achieve is really specific to your own environment. If that's not the case, you can suggest a change to the existing rule by joining the SonarQube google group.

how do I export rules in SonarQube? You can export rules of a profile in xml files and then import them in a new profile. To save rules click on the "Permalinks" tab when viewing an existing profile. You'll see (at least for Java projects ) links for all rules engines and one that includes all of them. Save these files somewhere in your storage.

Secondly, how do I turn off rules in SonarQube?

Follow below steps to disable any rule in SonarQube:

  1. Login by admin.
  2. Go to quality profile & Select java/php profile [whichever is appropriate to you]
  3. Enter the rule as key and Search.
  4. Uncheck the box which will inactive the rule.
  5. Run Sonar runner command once again to verify the modifications are working properly.

Does SonarQube work on profiles?

The Quality Profiles service is central to SonarQube, since it is where you define your requirements by defining sets of rules (ex: Methods should not have a Cognitive Complexity greater than 15). Ideally, all projects will be measured with the same profile for any given language, but that's not always practical.

17 Related Question Answers Found

What are rules in SonarQube?

What is code smell sonar?

When an issue is automatically closed in SonarQube?

What is quality profile in SonarQube?

What is Sonar tool?

What is a quality gate?

What is quality gate in SonarQube?

What is SonarQube used for?

What is Sonar code coverage?

How do I create a quality profile in SonarQube?

What is a quality profile?

What is true about tags in SonarQube?