How to Exclude some False Positive Rules in Code Quality Scan

Template for a good new topic, formatted with Markdown:

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
    Github

  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
    Travis CI

  • Scanner command used when applicable (private details masked)

  • Languages of the repository
    Node.js and Javascipt

  • Only if the SonarCloud project is public, the URL

    • And if you need help with pull request decoration, then the URL to the PR too
      Private Repo
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)

  • Steps to reproduce

  1. We run a code scan with our repo. There are many “false positive” and we would like to exclude some rules like:

super() can only be invoked once
Unexpected missing generic font family
Correct one of the identical sub-expressions on both sides of operator “&&”

  1. How can we do it? so we don’t need to waste time to comment and make them false positive many times.
  • Potential workaround
    I know we can just make them minor and comment on them (not fixed) many times.

Any suggestion how to exclude some rules would be very helpful. Thanks!

Greetings,

I would reccomend taking a look at the documentation on Quality Profiles, which define the rules you want to be applied to your projects.

For very specific exclusion cases, you may want to review the documentation on Narrowing the Focus > Ignore Issues

Colin

1 Like