How does Sonarqube calculates "Estimated after merge" for every PR?

Must-share information (formatted with Markdown):

  • Sonarqube version - * Developer Edition Version 8.4.2 (build 36762)
  • How does Sonarqube calculates “Estimated after merge” for every PR?

For a PR, we have added 20 lines of new code with coverage for 11 lines of code with coverage being 45%. But the “Estimated after merge” is showed as 68.6%. Would like to know how SQ calculates this?

Hi,

The ‘Estimated after merge’ is the estimated coverage on the overall codebase after you merge your PR & the math on that is pretty routine.

 
HTH,
Ann

Thanks for the response.

But in one of the PR, we have only 10 uncovered lines out of 20 lines (50% coverage). But “Estimated coverage after merge” has dip of 4% from the master branch cooverage. Sure 10 lines will not contribute for 4%. So wanted to understand on the calculation logic

Thanks.

Hi,

How many “Lines to cover” do you see in your project’s Overall listing?

 
Ann