No SonarLint C/C++ analysis in CLion

It’s not a CMake project, it’s a large legacy project with a Makefile and a compile_commands.json generated using bear. The source file is part of the project. AFAICT SonarLint won’t analyze any file in the project, not just specific source files.

I tried deleting the .idea directory and reopening the project as a Compilation Database project. In the “sync” tab I see several messages like “Found several commands for file: …” and “Compilation database project successfully imported” however, CLion hung before fully opening the project.

I uninstalled SonarLint, deleted the .idea directory and again tried reopening the project as a Compilation Database project. The results were the same as above, including CLion hanging.

I reinstalled SonarLint, deleted the .idea directory and tried reopening the project as a Makefile project. This succeeded and SonarLint appears to be analyzing files again.

At this point, I do not believe the problem is with SonarLint, rather with CLion handling of Compilation Database projects. I think this case can be closed.

FWIW I’m not able to reproduce the problem with a small project.

1 Like