Quality Gate passed despite coverage condition not reached

Hi, I encountered an Issue with our recent pull request analysis where the quality gate passes even though the test coverage on the new code does not meet the required minimum of 65%.

Hi Sonar Team,

I have found one comment from Ann

You’ve run afoul of what I call the “fudge factor”. When there are fewer than 20 new lines (that’s lines, not lines of code) conditions on new coverage and duplication are not applied. Why? In our own use of the products we found that you can get into a situation of diminishing returns with such small changes.

In SonarQube, there’s a control to turn that off, but it hasn’t made its way to SonarCloud yet.

If it is like this, then can you please tell me the clarrification on this?

Quality gate condition of a New Code

Hi,

With only 8 New Lines in your PR, that does look like a fudge factor pass. You’ve filed this under SonarQube on-prem. Are you using SonarQube Server / Community Build, or are you using SonarQube Cloud? Because if you’re on-prem, this can be turned off, at either the global level or on a project-by-project basis.

 
HTH,
Ann

I am using SonarQube Server with 2025.1 LTA version

But Ann, If it passed due to fudge factor, then what about the Second PR. It has only 13 lines, then still not passed?

Hi,

Are both PRs from the same project? Since this is configurable at project level, I can only guess that the fudge factor is turned off for one but not the other.

 
HTH,
Ann

Hi Ann,

Yes both in the same project only

Hi,

Quoting you, quoting me (emphasis added):

The second PR meets the criteria.

 
HTH,
Ann