How can I ignore code smells based on severity?

Hello guys,

I have a general quality gate applied to all my projects where no new code is allowed to have a code smell count greater than 0.

It works fine most of the time, yet on some projects, I would like to be able to ignore code smells with severity of type INFO, without changing my default Quality Gate.

I’m currently using Sonar Qube 8.5, Enterprise Edition, combined with the SonarQubePrepare v4 task on Azure Devops.

Is it possible at all? How can I do so?

Hi,

To ignore Info Code Smells, but not other Code Smells, you would need to be able to add Blocker Code Smells, Critical Code Smells &etc to your Quality Gate. As you’re probably aware, those metrics just aren’t available.

What you can do is mark the Code Smells you want to ignore as Won’t Fix to remove them from Quality Gate consideration.

 
HTH,
Ann

A post was split to a new topic: Ignore all Code Smells on a project