SonarQube Showing unchanged files in PR and fails the QualityGate

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 9.9 and using mvn sonar plugin

  • how is SonarQube deployed: zip, Docker, Helm
    – Zip

  • what are you trying to achieve
    – PR/MR analysis is failing which changes in untouched files.

  • what have you tried so far to achieve this
    – Verified the sonar base brach is set correct which is MAIN.
    – Reran Scan on main branch just to make sure it reruns the scan on code from main.

Tools Used: GitLab, mvn for build and sonar scan

We have lot of technical debt but we want to move forward and address that later. We just want to make sure we are not adding up a new debt on top of that. Our pull request is showing files that were untouched. For Example: in one of our PR we just modified 2 files and the PR analysis failed with 25 to 30 files which i feel is not correct.


Perfect! That’s exactly what we recommend!

More than likely there’s a problem with the SCM data collection. Can you share your analysis logs?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.