After amend on pull request code coverage takes only amended lines


We are using sonarqube scanner as a CI step (on bitrise) for iOS projects to generate code coverage and analyse our code for code smells, bugs, etc.

Everything works great but… after opening a pull request if we amend some code, the code coverage only takes in account the lines modified during the amend commit instead of all the code of the pull request. For example:

  1. I open a PR with 250 lines of changes with coverage at 50%
  2. Then amend 10 lines of code that aren’t covered
  3. The code coverage on the PR is 0% for 10 lines to cover, instead of computing the code coverage on all the code of the pull request.

Any clue on how we can fix this? I have no idea if this is a configuration issue or a bug?



Welcome to the community!

Could you share some screenshots? I’m having trouble visualizing this given what I know of how things (are supposed to) work.



Sorry for the delay I was on vacations and just come back…

I don’t have screenshots anymore but the coverage was only made on files that were amended with only the lines amended. What is strange is that it didn’t occur on all our repositories, I’m wondering if it didn’t happened just after changing definition of new code (no idea if it can have an impact). I’ll see if the problem occurs again and we’ll try to give you more info.