[Issue] Sonarqube works in some projects but not others ( possibly fails to set proper "Root=" ? )

  • Operating system: Win 10
  • Visual Studio version: 2022 17.14.23
  • SonarQube for Visual Studio plugin version: 9.7.0.16245
  • Programming language you’re coding in: C++
  • Is connected mode used: No
    • SonarQube Cloud, SonarQube Server, or SonarQube Community Build? (if one of the latter two, which version?):

Sonarqube seems to “break” on certain projects i have.

It does nothing in those, no files are analyzed.

Meanwhile it does work in other projects.

I looked at the logs of both and i noticed that in the project that does not work, Sonarqube seems to have detected the wrong “Root=” directory.

[SLCore > Configuration Scope] Updated files system parameters for Configuration Scope MyProject: Root=P:, Commands Directory=

← Here it detects P: where the build-files are, but it should be I: where the source-files are. It detects this properly in other projects.

It then skips all source files because it can’t relativize the file towards that Root.

In the project that works, it sets the “Root=” correctly.

Both projects are Out of Source builds using CMake.

The build directories where the CMake creates all the build-files including the Visual Studio SLN, are on a different drive than the source-files.

In the project that doesn’t work, SonarQube for some reason uses the drive of the build-files as the “Root=”. In the working projects, it uses the drive of the source-files as the “Root=”

Hi,

Could you provide a verbose log from IDE startup through to where you (don’t) see the problem?

 
Thx,
Ann

Sure, here are verbose logs for working and nonworking projects.

Both have the build-files on P: and the source-files on I: ( which SonarQube should analyze ).

Is there maybe a way to set the “Root” in the settings.json, without having to add all the files that should be analyzed ?

problematic_project.txt (42.8 KB)

working_project.txt (55.1 KB)

Hi,

Thanks for the logs. I’m not sure how to set the root. I’ve flagged this for the team.

 
Ann