Unrelated files scanned in SonarCloud PR check

Please verify that the ${PROJECT_GIT_DEST_BRANCH} variable used by your commands points to the correct base branch. The files that show up in the pull request analysis should correspond to the files changed since the common fork point of the working tree that you are analyzing, and the base branch. If the value of this variable is incorrect, the results will be incorrect.

As an additional check, you could add the following command in your CI tool, to verify the changed files:

git diff --name-only "origin/${PROJECT_GIT_DEST_BRANCH}...HEAD"

The list of files printed by this command should include all the files you see on the Code tab of the pull request on SonarCloud. If the list of files printed by this command look strange, then probably ${PROJECT_GIT_DEST_BRANCH} doesn’t have the intended value.

Lastly, are there any warnings reported on the pull request page in SonarCloud? (Warnings show up in the top-right corner, in a small box with yellow background.) They may contain clues relevant to this issue.