Is it possible to increase coverage metrics precision to 4 digits

Is it possible to increase coverage metrics precision to 4 digits in Sonar Qube? Like from 30.1% to 30.09%


Welcome to the community!

Can you share why you think this is important?


Current coverage is only 1 digit (ex: 30.1 or 28.5 etc), if increasing the detail to minimum 4 digits. With last few runs showing same coverage (31.0%)

It is difficult if the metrics are capturing correctly.

Any updates?


What I’m not understanding is the practical difference having it reported as 28.5% versus 28.48% makes. How does this rounding concretely impact your or your team? I.E. what’s your use case?


The practical difference of increasing precision is that we are monitoring several modules in one project. We would like to know the coverage statistics changes after everyday’s sonar build more accurately. Suppose we have got code coverage statistics as 28.5% for an entire week, it seems the coverage does not change. But we are more interested to see if the minor difference between each day’s statistics, like 28.54%, 28.47% and etc., to capture a deeper or sight of how the measurements changed. Because we have a dashboard which recorded measurements for each day so it is easy to see the differences.

Also, we put the question in the service desk, but it seems nobody reacts to that question for a week.


First, if you have access to the Service Desk, then you’re almost always going to do better relying on their answers. Those guys and gals are professionals who get paid to get you answers. Here in the community you’re dealing with folks who drop by to help occasionally because it gives us a warm, fuzzy feeling.

So… generally I’m going to defer to the folks in Support. The fact that you haven’t gotten an answer yet doesn’t mean they’re not working on your behalf, just that they don’t yet have anything to report. All that said, I’m going to give an answer here for the benefit of future readers who don’t have access to Support…

First, you should really be paying attention solely to the ‘on New Code’ values. If those are good, then what your overall Coverage percentage is shouldn’t matter so much. Keep your New Code values high, and that rising tide will live the Overall boat too.

But okay, I recognize that that doesn’t work in all cultures. If you really care about hundredths of percentage points, then you probably don’t really want to be looking at the percentages at all, but at:

  • Lines to Cover and Uncovered Lines
  • Conditions to Cover and Uncovered Conditions

You’ll get much more granular values there.


1 Like