> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/languages/c-family/analysis-modes.md).

# Analysis modes

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

* [Automatic analysis](/sonarqube-cloud/analyzing-source-code/automatic-analysis.md) 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.

* In Compilation Database mode, these options are provided to the analyzer through a [compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html): a JSON file introduced by the LLVM project.
* In Automatic Analysis and AutoConfig modes, the analyzer attempts to deduce these options automatically. A set of high-level properties can tune the automatic deduction process. For details, see the [Customizing the analysis](/sonarqube-cloud/analyzing-source-code/languages/c-family/customizing-the-analysis.md#autoconfig-and-automatic-analysis-properties) article on the [Customizing the analysis](/sonarqube-cloud/analyzing-source-code/languages/c-family/customizing-the-analysis.md) page.

## Choosing the right analysis mode <a href="#choosing-the-right-analysis-mode" id="choosing-the-right-analysis-mode"></a>

**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](/sonarqube-cloud/analyzing-source-code/languages/c-family/prerequisites.md) page).
* Your projects use compilation environments where generating a compilation database is not feasible (see the [Prerequisites](/sonarqube-cloud/analyzing-source-code/languages/c-family/prerequisites.md) 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/languages/c-family/analysis-modes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
