We use SonarCloud integration with Bitbucket and have a build step to stop PRs from getting merged if the coverage on “new code” falls below a certain threshold.
However, we are facing weird behaviours on how sonar finds a diff against the destination branch. SC is finding really old files as having changed (Though it clearly hasn’t and does not show as a difference in bitbucket). We have no workaround for this at the moment.
We are not doing a shallow clone of the repository either as suggested in a couple of other threads.
Is anyone able to help?
- ALM used - Bitbucket
- CI system used - GoCD
- Scanner command used when applicable
/sonar-scanner-22.214.171.1240-linux/bin/sonar-scanner -Dsonar.verbose=true -Dsonar.login=__SONAR_LOGIN_CREDS__ -Dsonar.pullrequest.branch=__PROJECT_GIT_BRANCH__ -Dsonar.pullrequest.key=__PROJECT_PR_NUMBER__ -Dsonar.pullrequest.base=__PROJECT_GIT_DEST_BRANCH__
- Languages of the repository: PHP