For the complete documentation index, see llms.txt. This page is also available as Markdown.

Analysis modes

This page provides a description of the CFamily analysis modes in SonarQube Cloud.

The analysis can operate in three modes: Automatic Analysis, AutoConfig, or Compilation Database.

  • Automatic analysis mode automatically analyzes your code by reading it from your GitHub or Azure DevOps repository, without the need to configure a CI-based analysis.

  • AutoConfig mode requires a CI-based analysis but automatically deduces the compilation options, so no compilation database needs to be generated or maintained.

  • Compilation Database mode gives you the most control over the analysis configuration. It requires a CI-based analysis and a compile_commands.json supplied to the SonarScanner.

The analyzer must understand the code’s intended compilation options to ensure an accurate static analysis of the CFamily code.

Choosing the right analysis mode

Automatic Analysis mode is recommended if:

  • You want a swift analysis setup with no CI pipeline or compilation database to configure or maintain.

  • Your projects have a low CFamily code percentage.

AutoConfig mode is recommended if:

  • Your projects aren’t hosted on GitHub or Azure DevOps — Automatic Analysis is only available for GitHub and Azure DevOps repositories.

  • Your projects use compilers that don’t meet the supported compiler prerequisites of Compilation Database mode (see the Prerequisites page).

  • Your projects use compilation environments where generating a compilation database is not feasible (see the Prerequisites page).

  • You want a swift CI-based analysis setup without the need to generate or maintain a compilation database.

  • Your projects have a low CFamily code percentage.

  • You require faster analysis — you can control the hardware capacity on the CI where the analysis runs.

Compilation Database mode is recommended if:

  • You’re seeking the highest CFamily analysis quality SonarQube Cloud can provide. In rare instances, Automatic Analysis and AutoConfig may result in some issues being overlooked.

  • You want to have finer control over the analysis configuration, such as analyzing a specific build variant.

  • Your projects have Objective-C code — Objective-C analysis is not supported in Automatic Analysis or AutoConfig modes.

  • Your projects must comply with MISRA C++:2023 — the MISRA C++:2023 compliance quality profile requires Compilation Database mode.

  • You require faster analysis — you can control the hardware capacity on the CI where the analysis runs.

Last updated

Was this helpful?