SonarQube Developer Edition Version 8.0
org.sonarsource.scanner.maven : sonar-maven-plugin : 18.104.22.1686
Some code changes during a recent release involved moving some java classes (and their respective test classes) from one package to another. The contents of these classes didn’t change apart from the package name at the top.
The sonar analysis on the release branch was treating these classes as new code. These classes were well covered (>80%) so they helped the release branch achieve the quality gate of 80% coverage on new code.
However when this branch was merged to master the analysis was done differently. These classes were now not counted as new code and so the test coverage on the (remaining) new code dropped.
Aside from the question of which analysis was correct, our main concern is why the code was treated in two different ways on the two branches.
Are you able to shed any light on why this might have happened?