How did SonarQube determine the gating values for their "Sonar Way" quality gate?

I tried finding documentation around the “why” the Sonar Way quality gate is configured but I am unable to find anything. For instance, why is code coverage gated at > 80%? Where did the 80% value come from?




Welcome to the community!

That’s a great question. Unfortunately, AFAIK, the answer is lost in the mists of time. What I can tell you is that we’re very aware there’s a point of diminishing returns with coverage, so it’s simply not worth it to pursue 100%. But where below that to set the bar? It’s obviously going to be arbitrary. At a guess, 80% seemed both ambitious and achievable. Internally, we’ve bumped our minimum up to 85%, and some teams set the bar at 90% and even 95%.

The duplications limit is also arbitrary, and to be honest I have absolutely no idea where that number comes from.

Overall, you’ll notice that the conditions in the Sonar way Quality Gate are all based on New Code. The why of that is laid out here


1 Like

Thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.