SonarQube for Eclipse "analysis not available (yet)"

Please provide

  • Operating system: Win11
  • IDE name and version: Eclipse 2024-09
  • SonarQube for Eclipse plugin version: 11.9
  • Programming language you’re coding in: C/C++
  • Is connected mode used:
    • SonarQube Cloud, SonarQube Server, or SonarQube Community Build? (if one of the latter two, which version?): SonarQube Server

And a thorough description of the problem / question:

Hi,
I am struggling to get SonarQube for Eclipse working for my embedded C project. I have installed SonarQube for Eclipse, I have installed CDT, I have built my project in Eclipse and I have setup Connected Mode. But still, every time I open a C file, I simply get the error “SonarQube - C/C++ analysis not available (yet)”.

In VScode I was simply able to use the build_wrapper.exe to generate a compilation database, in the form of compile_commands.json, and then point the SonarQube extension to that file, and SonarQube was working great.

How can I achieve the same in Eclipse? Where am I going wrong? Thanks.

Hi,

Welcome to the community and thanks for this report!

Can we get the logs?

 
Thx,
Ann

Hi @William4,

SonarQube for Eclipse does not rely on the Compilation Database (yet) but relies on the Eclipse CDT integration instead. This is configured to create the Build Wrapper automatically in the background based on the information CDT has on your files and the project.

There is a requirement that you need to have the project built once successfully before the analysis can work (as the popup says).

I See your CDT Build Console has no issues, but the Problems view shows some. What does it say, especially what markers are there from the CDT plug-in? Additionally, as @ganncamp mentions above, the logs are equally helpful.

Cheers :glass_of_milk:

1 Like

Hi @EclipseWizard and @ganncamp

Thanks for the replies. After checking the logs and errors I saw that Eclipse was failing to resolve basic types like ‘bool’. Since it was still building, I didnt think it would affect SonarQube, but I decided to try and fix it anyway. I was able to fix that by changing the tool chain to “MinGW GCC” and adding the relevant includes to “Paths and Symbols”. With these changes I am no longer seeing the “analysis not available” error, thank you!

2 Likes