Cfamily analyzer not recognized by SonarQube for IDE in VS Code?

  • Operating system: Windows 11
  • VS Code version : 1.84.0
  • SonarQube for VS Code plugin version: 4.20.2
  • SonarQube CFamiliy analyzer version : 6.65.0.081949
  • Programming language you’re coding in: C/C++/Python
  • Is connected mode used: no

Hello,
I am trying to setup SonarQube for IDE for the first time in offline mode and I am having troubles getting de C/C++ analyzer to work.
On the left pane of my VS Code IDE I can see the SonarQube extension and rules for a lot of langages (including Python that I use) but no C/C++.

I made a few research (Offline installation - SonarQube for IDE Documentation - VS Code) and found out I needed to download CFamiliy analyzer and deploy it in a folder, which I did, but it still won’t show up in rules.
This path to my CFamily.jar file : ‘D:/user/.vscode/extensions/sonarsource.sonarlint_ondemand-analyzers/sonar-cfamily-version/6.65.0.081949/sonarcfamily.jar’
I also tried ‘D:/user/.vscode/extensions/sonarsource.sonarlint_ondemand-analyzers/sonar-cfamily-version/6.65/sonarcfamily.jar’ without success.

For the C/C++, I setup the path to my project compile_commands.json file exported by CMake, and these commands build the project without any issue.

I am falling short in term of new idea to get the C/C++ analyzer to work, so here I am asking for your help.

Thanks !

Hi,

Welcome to the community!

Could you share your log please?

 
Thx,
Ann

Sure, here it is :slight_smile:
sonarqube_debug_log.txt (69.3 KB)
Thanks,

Hi,

Thanks! I’ve flagged this for the experts.

 
Ann

Hello, thanks for the detailed report!

If I am not mistaken, the path to the offline download is almost correct:

According to what I see in the log, it should be something like:

D:/users/usr/.vscode/extensions/sonarsource.sonarlint_ondemand-analyzers/sonar-cfamily-version/6.65.0.81949/sonarcfamily.jar

The sonarsource.sonarlint_ondemand-analyzers folder should be next to the extension’s folder, and the 0 character before the 4th version item should be removed.

Hello, thanks for your answer !
I tried your suggestions :
Both sonarsource.sonarlint_ondemand-analyzers and sonarsource.sonarlint-vscode-4.20.2 are under d:/users/usr/.vscode/extensions.
The analyzer is located here : D:/users/usr/.vscode/extensions/sonarsource.sonarlint_ondemand-analyzers/sonar-cfamily-version/6.65.0.81949/sonarcfamily.jar.
But I still have the same warning at the start of the log file :[Warn] Embedded plugin not found : c.