Condition Coverage, Leak Period and Failed Quality Gate

We are running version 7.4 of Sonar.
Our Quality Gate is set to look at Condition Coverage on New Code which was set on 6/10. By set I mean the checkbox on new code was enabled.

We have set our Leak Period on the project to 6/419.
Quality GAte

We have a project that has failed the gate, but no new code has been added since the leak period is established. We are confused by the failure. Perhaps its our understanding of the rule too.
Supporting screen shots

Another example that is confusing:
The quality gate provided with the previous example also applies to this project.

Please help.


Hi Pam,

There are two things going on here. The first is the metric you’ve chosen and the second is the “On New Code” checkbox.

First, in 7.6 we simplified Quality Gate configuration to among other things remove the “On New Code” checkbox because its implementation was not the same as the “X on New Code” measures, and that difference was extremely, perennially confusing.

I recommend you upgrade SonarQube to the latest version (7.7 at this writing) and/or edit your quality gate to use the metric (with “on New Code” in the name) that you’re actually interested in.

Second, your quality gate snapshot shows that you’ve included Condition Coverage, rather than what I believe you intended: Coverage. Condition Coverage is about how many branches of control flow statements (if, for, switch, …) are covered by tests. It is not about how many lines and conditions are covered overall, and that’s why the project in your second screenshot can be failing your QG with 40.9% Condition Coverage, when you have 92.8% Coverage on New Code.


Thanks for the clarification. As for the upgrade, its on my To Do list.