I’m running SonarQube Developer Edition 8.4.1 (build35646) in combination with SonarQube.Scanner.MsBuild.exe 188.8.131.521.
I noticed a strange behavior working with Pull Requests.
I’ve protected the master branch with a simple rule in GitHub:
- SonarQube quality gate will fail if there are any bugs, codesmells or other issues.
- GitHub’s Pull Request integration is blocked if the SonarQube quality gate fails.
With this rule I would expect that an integrated Pull Request will never create new issues on the master branch.
Pull Request changeset :
The type of the first parameter was changed from IEnumerable to object , which makes the using of System.Collections not necessary anymore.
The Pull Request check of SonarQube is not showing an unused using for System.Collections.
- The Pull Request’s QualityGate succeeds and shows no codesmells or any other issues.
- Therefor GitHub’s branch protection allows to squash merge the Pull Request into the master branch.
After the Pull Request integration we got a new issue (codesmell) on the master branch:
This is just a very simple example of this behavior. It is not only a thing about unused usings but for further codesmells.
Why does the issue appear after the integration and not as expected during the Pull Request SonarQube analysis?
Can you please help me to understand this