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.
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.
Can you give it a try with version 4.22 of the extension and version 6.66.0 of the analyzer? Please make sure to reload the VS Code window after downloading the plugin in the correct place.
The offline installation instructions say that the path should be .../sonar-cfamily-version/...
however, this post: Getting "Fetch Failed" Error at SonarQube startup - #11 by JBL_SonarSource
says the path should be .../sonar-cfamily-plugin/... (note: plugin, not version)!
I have confirmed that it works for me - though it took me a long long time to realise the discrepancy, and was only able to be found by seeing that post, as the documentation is INCORRECT and the error messages even with all logging enabled is completely and utterly unhelpful!!
Also, note that, in my experience with working through ssh, the path should be .vscode-server/... rather than .vscode/...