PR analysis reports issues that are not introduced with that PR

I believe we’d do a diff with the current state of develop, unless you took care to make sure the local ref to develop was anchored to that specific earlier commit hash. The more I think about it, though, I don’t think this would show issues related to code modified in develop but not present in the PR.

I want to revisit your original problem description, though:

This really shouldn’t happen if you take care to have the PR branch cleanly checked out at its head revision at analysis time. In fact I can’t imagine why this would happen unless a developer had deliberately cross-merged one PR branch into another…in which case I’d argue SonarQube showing you all the combined changes is technically correct.

Since you already noted the need to make sure the ref to the target branch was included in the clone prior to analysis, I suggest we reset the discussion: please try to ensure that’s the case and let us know if you find a reproducible problem once you’ve made that change.