How to permanently ignore a false result in violating SonarQube rules

How does the developer (or, regardless of whether any authorized user) ignores a specific violation of the encoding rule when Sonar throws it away? Say that the rule “Does not comply with the file naming convention” appears, is there a way to declare it false positive and click on any button that ensures that no additional instances of this violation of the encoding rule will be displayed?

If this is not possible, is there a document that explains how SonarQube applies the rules to the code so that I can manipulate how it works to finally reject the false result. Thanks!

This question may be a continuation of the question below.

In Sonar, how to prevent some rules from being checked in some packages?

+5
source share
1 answer

There are 2 questions in your question:

  • Do you find that the rule created a false positive problem for your code?

    • You can mark this problem as “false positive” in the web interface, it will be ignored in subsequent analyzes.

    • If this is a real false positive, then it’s even nice to be on the SonarQube user survey list to discuss this so that we can create a JIRA ticket to fix this.

  • You will find that a rule always causes problems that are not relevant to your context?

    • These problems are not false, they simply are not related to your project.

    • To fix this, you just need to disable the rule in the quality profile that is used for your project.

+6
source

Source: https://habr.com/ru/post/1203652/


All Articles