-
which versions are you using
sonar-maven-plugin:3.9.0.2155:sonar (default-cli)
SonarQube version: 7.9.4 -
what are you trying to achieve
The problem I am facing is that: Every time when l push a commit to Gerrit, Jenkins will trigger a sonar check to check if the code is following the rules. But Sonar will not only give me a warning for code l just pushed, but also give warning for code from before in the same file. What l want is to let the sonar only warn me about my new changes or check only my new code, how can l make this happen? Thank you
Hi,
Welcome to the community!
First, your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:
xxx → 7.9.6 → 8.9.2 → 9.0.1 (last step optional)
Regarding your actual question, it seems like you’re looking for PR analysis, which is available starting in Developer Edition($).
Ann
Thank you for your reply, l will try to ask my team and update our Sonar.
For the Pull Request Analysis you mentioned, do you mind teaching me how or showing me where l can see the instruction to make the analysis only show violations for newly modified code (instead of the whole file) in my commit on Gerrit
Sorry for the stupid question, l am new to work, Therefore l am not that familiar with Sonar.
Leo
Hi Leo,
I have no familiarity with Gerrit.
Assuming you’re already licensed for Developer Edition, the docs should get you started.
Ann
Thank you for your help, Ann. l will try to figure it out. Hope you a nice day