Jacoco code coverage is not showing on new code?

(Teswar) #1

We are using Sonarqube 7.5 developer edition. When I do analysis on new code not able to see the coverage. If it is zeron aslo it has to show 0% but not showing. it is just showing ‘–’
Please reply asap.
Thanks in advance.
If we could have live chat it would be great. Because I can see lot if errors.

(G Ann Campbell) #2


There’s not a lot of context here. Is this thread relevant: Code coverage not displaying on PR analysis? Or are we talking about a long-lived branch? And if so, how many new lines are there?


(Teswar) #3

These are short lived branches. lines of code is 400k

(G Ann Campbell) #4


Your project has an overall line count of 400k, or your short-lived branch has 400k new/changed lines?


(Teswar) #5

Yeah. It has 400k. Is it code coverage shows only on longlived or ?

(G Ann Campbell) #6


Where in the interface are you seeing this “-” for coverage? Also, since the treatment of SLBs and PRs is much the same, I’ll ask again whether perhaps this thread is relevant for you: Code coverage not displaying on PR analysis


(Teswar) #7

We are not doing any PR analysis only branch analysis.

(Teswar) #8

The master has 400k lines now with the short lived has 390k lines of code. Task is executing but when it is doing Analysis on SonarServer in background tasks, it is not doing analysis.

Please help me. I’m getting lot of errors. ASAP

(G Ann Campbell) #9


I don’t understand this. Are you shifting the topic from missing information to actual errors? If so, it would be best to start a new thread that includes those error messages.


(Teswar) #10

Hi Ann,

It is the same issue. because it is not doing background task analysis with short lived branches. So thats y it is not showing code coverage. Plz reply ASAP
I have been facing since two weeks.

(G Ann Campbell) #11


Your screenshot doesn’t show any background tasks in failure. The background tasks are being processed.

In fact, the reason I was asking earlier about new lines in the branch - not total Lines of Code in the Project, but the number of Lines of Code changed in the PR - is because if you have no changed Lines of Code then you naturally won’t have coverage metrics, because there’s no way to cover a comment line, for instance.

Here’s a screenshot of a PR I did recently that’s remarkably similar to yours:

In fact, there’s nothing in this PR that’s considered “code”, so it’s quite natural that there’s no coverage information.


(Teswar) #12

But when we goes to measures section it is showing expected code coverage (before it was 5.4% of coverage), but the coverage is not showing with code.

(G Ann Campbell) #13

Yeah, me too:

What you’re seeing is the “Estimated after merge coverage”. Not coverage of the PR/SLB.


(Teswar) #14

Yeah, It is showing estimated coverage is 6.2% means there are new bugs in new code. But it is not showing the full analysis.