We are using the water leak approach to compare the changes to our code within a branch to the main trunk. Its working great! Except we have a problem with checking code coverage. Our project is near 0% code coverage, so we are requiring all new and modified code to meet 90% code coverage. But the branch’s code coverage metric is showing an incorrectly low code coverage percentage. The problem we are experiencing is if we add 10 lines to an existing file with 90 lines. And we have 100% code coverage for those 10 new lines, but 0 code coverage for the existing 90 lines, then SonarCloud is showing 10% code coverage on but we want it to show code coverage on new/modified lines of code. What seems to be showing is code coverage on new/modified files. How can we get it to base its code coverage calculation on lines, not files?
Thank you,
Jason