Combined Coverage is giving overall coverage as new coverage for any Pull Request

We are using Sonarqube Cloud Enterprises version. We have two different independent java project hosted on the same GitHub Repository. We need to combine the coverage of the same.

We are using GitHub actions and do the following

  1. Generate Jacoco report of Project A
  2. Generate Jacoco report of Project B
  3. Using Sonar scanner CLI - we share the combined.xml.reportpaths, source, java binaries.

On a push request - Combined coverage in New code coverage and Overall code coverage is coming as expected.

On a Pull Request - New code coverage is displaying Overall code coverage and incorrectly showing the higher number of lines.

We tested individually with gradle plugin, generating Sonarqube within individual project - results are coming as expected in both Push and Pull Request.

But only when we combine coverage, there is discrepancy on the new coverage part alone.
We are still passing pull request parameters values correctly in Sonar scanner CLI like below.

Can someone please help me why there is a discrepancy in PR new coverage alone
Sonar.pull_request.target, pr base, pr id, pr

Hey @Vignesh97

It sounds like what might be happening is that in PR analyses, the detection of New Code (code changed in the PR) is wrong, causing more (if not all?) lines to be flagged as new than what actually changed in the PR.

This actually has little to do with the coverage report and more with the detection of changed lines.

Is this a correct interpretation of the issue?

You can check this by clicking into the number of new lines to cover (in the screenshot, 93) and seeing if those files represent what was changed in the PR or not.