SonarCloud - New code coverage results differ between branches


We have a paid subscription and a private project and Sonarcloud integrates against a private Bitbucket GIT repository and is triggered via the Bitbucket-pipelines integration. Its Java code and we use Jacoco to run the unit-tests and produce the coverage metrics (XML report file)

Im aware of New Code results differ between main and feature branches and we have a similar issue for Sonarcloud.

Feature-branches and develop-branches that had “green coverage” showed after merging to master a drop of ~ 20% in coverage making them red.

One example (with blurred private details) below. This is considered on a release-branch as good:

and same package as seen by Sonarcloud after release-branch got merged to master:

all the Java classes that show up here newly are not touched in the last 30 days, also clicking on them doesnt show any (wrongly) highlighted code that was touched the last 30 days.

I can share more details in a private discussion, since its non-public source code.

Thanks a lot

Hello @techops and welcome to our Community!

Thanks for reaching us. Indeed we need more details to understand your problem, could you please provide us with the analysis id of a release-branch and the “after release-branch merged”? I will send you a private message so you can answer back safely.

Hi @techops, sorry for the delayed feedback and thanks a lot for the provided information.

Could you please tell us what is the current New Code definition for this project? Also, the coverage is still having non expected drops at the master branch? If positive, can you provide an updated analysis id for a scan on master with dropped coverage? You can send it using the previous private message if you want.