Any idea of what could have happened here?
No change in configuration or exclusion has been applied. It happened after an automated build during the weekend and now the “Lines to cover” remains in the same level and we cannot return it to the previous one.
How is Sonar measuring “Lines to cover”?
Thanks in advance!
Lines to Cover is information that SonarQube gleans directly from the coverage reports it has been provided (which indicates which lines have and haven’t been covered). If no information is included in the coverage reports (for example, an entire file is absent), it takes a well-informed “guess”.
So most likely something has changed in the coverage reports being provided, and you might want to check to see if anything has changed between pipeline runs in the step where you run tests / generate code coverage.
It’s also worth checking that a coverage exclusion hasn’t slipped in there without you knowing, which would also impact these measures.
Hi again and thanks for quick answer!
Problem here is that we have not modified or done any new exclusion.
We have re-run branches from 1-2-5 months ago and new “lines to cover” number persists with the new one, we are not capable to return to previous number.
The main issue for us in here is that the “lines to cover” that have disappeared were mostly covered, so biggest issue here is that our general coverage has gone down.
Hi again
Still seeking for some help
After some time, lines returned to previous values and as we have executions now before and after we have been able to compare
We have found that the headers of the methods are not being counted in one of them
SonarQube reads all of this data from the coverage reports it’s being provided. I would really encourage you to:
check to see if anything has changed between pipeline runs in the step where you run tests / generate code coverage.
This could include directly comparing the coverage reports for a given file where you see fluctuations (is the file reported in both the before/after coverage reports? with the same coverage?)