BenoitD
(Dolives)
March 14, 2025, 9:41am
1
On SonarQube Server, I have weird behavior with the recommended “compilation database” scanning mode (for cfamily).
Indeed, if I create this database through cmake (Analysis modes | SonarQube Server Documentation ) or through the build-wrapper (CFamily prerequisites | SonarQube Server Documentation ), then the cpp files are analyzed BUT they did not found any “classes/statement/function”. At the same time, the number of issues found is quite low.
Windows environment
same environment variables between call to cmake/build-wrapper and sonar-scanner
msvc 2017 or 2019 targeted
I have checked the compilation_database.json and they are consistent
If I use « AutoConfig », then the number of classes and issues found is a lot more consistent.
I would like to use compilation_database mode in order to provide all the necessary macros/includes/variants.
Any ideas are welcome
Best Regards
Colin
(Colin)
March 17, 2025, 10:12am
2
I’m not sure what you mean here. Can you show some examples (screenshots, logs)?
Please also confirm what version of SonarQube Server you’re using, as noted in the template post.
BenoitD
(Dolives)
March 17, 2025, 10:26am
3
Thanks for your interest,
This shows the log output when it works (15 classes, 59 functions, …) while in AutoConfig.
When I am using compilation database I have 0 classes and 0 functions…
The SonarQube Server version is " Enterprise Edition v2025.1 (102418)"
Best Regards
Colin
(Colin)
March 17, 2025, 12:53pm
4
Thanks! Some of these logs must be new – they’re new to me!
I have a feeling that our devs are going to want to see your compilation database – so I’ll ping them on this thread and somebody will be along and open a private message with you.
2 Likes
BenoitD
(Dolives)
April 4, 2025, 9:53am
7
Thanks for your help,
Finally, the most painful was the fact that the compile commands should be created from the “true folder” and the analysis launched from the same “true folder”.
Indeed I was working from a “linked folder”.
1 Like