Sonarqube reports code smells not related to changes on Pull Request

Hi there,
SonarQube 8.9.6 and sonarqube-scanner 4.7.0 are the versions that I’m using.
I am trying to trigger Gerrit pull request analysis on SonarQube by following the instructions on the page

We are working on a use case that requires integrating Gerrit with sonarqube via Jenkins. For the same purpose we created a jenkins job that gets triggered as in when a PR is raised on Gerrit.
We are not using pull request decoration, instead we do it via jenkins by modifying the
The sonar Scanner runs the analysis on the patchset and submits report to SonarQube server as Pull-request analysis.

The PR analysis reports code smells on files not related to the current patchset.
(mentioned as 79 on the attached screenshot)

Can you please suggest us what configurations are supposed to be added/modified in order for us to report only the code smells corresponding to the pull request changes?

Hey there.

What do the logs say about detecting changed files/lines? DEBUG level logs may help as well (sonar-scanner -X)

12:41:18.612 INFO: SCM collecting changed files in the branch
12:41:18.853 INFO: SCM collecting changed files in the branch (done) | time=241ms
12:41:18.853 DEBUG: SCM reported 0 files changed in the branch
12:53:30.951 DEBUG: SCM revision ID 'ef59fea67a9a6b4e6ed8a94411fffff7b72e0f3f'
12:53:31.006 INFO: SCM writing changed lines
12:53:31.007 DEBUG: loading config FileBasedConfig[/proj/jenkins/.config/jgit/config]
12:53:31.030 DEBUG: Merge base sha1: d928d2561a496207fff30bcbe888ecaf1a29e2f6
12:53:31.031 DEBUG: SCM reported changed lines for 0 files in the branch
12:53:31.031 INFO: SCM writing changed lines (done) | time=25ms

Any warnings, informational messages, unexpected results?