Sonarqube reporting smells in files that my PR does not touch

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • Developer Edition Version 8.3.1 (build 34397)
  • what are you trying to achieve
    trying to get a MR analysis on only the files I am changing with my MR
  • what have you tried so far to achieve this
    tried setting all permutations of

Dsonar.pullrequest.branch
-Dsonar.pullrequest.base
-Dsonar.branch.target

created new MR from scratch

I have also tried to change the main branch from master to develop. I no longer see the UI to allow me to rename the branch, though

image
(It used to have a link at the bottom right)

more specifically, I change file foo.java and footest.java. My MR in self hosted gitlab shows only the files I have touched have edits. Sonar, though, reports bar.java, capybara.java and some other set of 12 untouched files have new smells and security bugs.

Am I doing something boneheadedly incorrect here?

Hello,
Could you please attach the analysis logs in debug mode so we can see what the SCM sensor outputs as informations ?
Thanks.
Alex.

sonarqube_ce.log.txt (192.0 KB)

Hi, was this issue solved? I am experiencing exactly same problem. I report from SonarScanner to sonarcloud.io. I have configuration set there to ‘compare with previous version’.

Br
Michal