We are using the Developer Edition of SonarQube version 8.4.2 (locally installed on our own server), Git as version control and we are observing a behaviour on branches which confuses our team a little bit.
We can observe in Sonarqube’s code analysis for a developer branch it will show code parts from the master branch as analysed which are not part of the given branch.
It looks like the separation of the new code on the branch and the existing code state on the master (from wich the dev branch has been created) seemed to be not correct.
We are using simple feature branches which means we create a branch from master via:
git checkout -b FEATURE-1
Afterwards we work on that branch for a time period and from time to time we rebase that feature branch (FEATURE-1) with the new code from master via:
git checkout FEATURE-1 git rebase master git push origin --force-with-lease FEATURE-1
Before we merge into master we squash into a single commit and finally we merge the feature branch into our master via fast-forward only. This results in a single commit on master only.
My assumption is that this model of branching could cause this problems of analysation.
Can someone acknowledge that ? Or does exist another solution for this problem?