Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
10.3 - how is SonarQube deployed: zip, Docker, Helm
Helm - what are you trying to achieve
Use SonarQube to determine if a PR meets certain code quality. - what have you tried so far to achieve this
Enable SonarQube for my github repository. Create a project on SonarQube, and every time I make a PR, a SonarQube report will be automatically generated.
Issue:
Most of time, SonarQube uses all code within a PR as new code, which is what I expect.
Sometimes, SonarQube treats code outside a PR as new code. For example, as I didn’t set version number in my repo, my SonarQube is treating all of my code as new code at branch level. When I create a PR and try to merge into my main branch, SonarQube will use all of my code in main branch as new code; rather than just code in my PR.
I’m not sure why SonarQube behaves differently in my situation.
Any help is appreciated!