Analysis of Non-compilable C/C++ Code

We sometimes get a C/C++ codebase to analyze that is not compilable by us because it is missing certain components or header files. I realize that the best accuracy of the analysis is going to be for compilable code, but my question is: Will SonarQube still produce analysis of the code I DO have that is useful? Certain SA tools (e.g. Understand) will do the best they can with uncompiled code, for other tools No compile = fugetaboutit… Wondering if I can use SonarQube in instances w/o compilable code.

Hi,

Welcome to the community!

As I guess you’re aware, we eavesdrop on the build with the build-wrapper to gather the settings and values needed for a full and correct analysis. That’s the preferred way of doing it, but as a fallback, we’ve (relatively) recently added the ability to analyze using a Compilation Database instead. I’m not sure how you’re going to get that without being able to compile, but… maybe this will help.

 
Ann