Skip to content

sonar.cxx.errorRecoveryEnabled

Günter Wirth edited this page Feb 6, 2022 · 6 revisions

For the cxx plugin the error recovery mode can be defined.

A distinction is made between the two principal methods:

mode description
strict Data is only transferred to SonarQube if all data is correct and error-free. This method is recommended when the focus is on reliable Quality Gates.
tolerant (default) Data is transferred to SonarQube as quickly as possible, even if it is not necessarily complete and error-free. This method provides the developers with partial results as quickly as possible. Errors are ignored and the analysis is continued.

The parameter sonar.cxx.errorRecoveryEnabled has impact on scanning the source files and reading report files:

  • sonar.cxx.errorRecoveryEnabled= True (tolerant mode)

    • erroneous reports: analysis is continued in case of errors in a report file
    • source code parsing: Syntax errors within a declaration are skipped, analysis is continued with next declaration in source code file (see Error Recovery). In the case of incomplete scans, Detect and fix parsing errors gives advice on how to fix this.
  • sonar.cxx.errorRecoveryEnabled= False (strict mode)

    • erroneous reports: an error in a report file stops the analysis
    • source code parsing: the analysis of the source code file fails after a syntax error, the whole source code file is ignored

Configure cxx plugin

The configuration of the error recovery mode parameter is done with sonar.cxx.errorRecoveryEnabled in the configuration file sonar-project.properties or SonarQube UI.

Sample for sonar-project.properties:

sonar.cxx.errorRecoveryEnabled=True
Clone this wiki locally