# Analysis modes

The analysis can operate in *automatic analysis* or m*anual configuration* (compilation database) modes.

* [automatic-analysis](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/automatic-analysis "mention") automatically analyzes your code simply by reading it from your GitHub or Azure DevOps repository, without the need to configure a CI-based analysis.
* Compilation database mode gives you more control over the configuration and requires a CI-based analysis configuration. You can activate this mode by deactivating automatic analysis and supplying a `compile_commands.json` 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 mode, the analyzer attempts to deduce these options automatically. A set of high-level automatic analysis properties can tune the automatic deduction process. For details, see the [#automatic-analysis-specific-properties](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/languages/customizing-the-analysis#automatic-analysis-specific-properties "mention") article on the [customizing-the-analysis](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/languages/c-family/customizing-the-analysis "mention") page.

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

Compilation database 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.
* You’re seeking the highest CFamily analysis quality SonarQube Cloud can provide. Please note that in rare instances, automatic analysis may result in some issues being overlooked.
* You want to have finer control over the analysis configuration, such as analyzing a specific build variant.
* You require faster analysis. In compilation database mode, you can control the hardware capacity on the CI where the analysis runs.
* Your projects have Objective-C code: Objective-C analysis is not supported in automatic analysis mode.

Automatic analysis mode is recommended if:

* Your projects use compilers that don’t meet the supported compiler prerequisite of compilation database mode (see the [prerequisites](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/languages/c-family/prerequisites "mention") page).
* Your projects use compilation environments where generating a compilation database is not feasible (see the [prerequisites](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/languages/c-family/prerequisites "mention") page).
* You desire a swift analysis setup without the need to allocate human resources for the maintenance of a CI pipeline and the generation of a compilation database.
* Your projects have a low CFamily code percentage.
