Skip to content

sonar.cxx.jsonCompilationDatabase.analyzeOnlyContainedFiles

Günter Wirth edited this page Jan 23, 2023 · 4 revisions

Defines the mode for sonar.cxx.jsonCompilationDatabase.

  • With sonar.cxx.jsonCompilationDatabase.analyzeOnlyContainedFiles = False (default), all files configured via sonar.projectBaseDir are analyzed (independent if they are in the 'JSON Compilation Database' or not) and only the configuration (INCLUDES, MACROS) is read from the 'JSON Compilation Database'.
  • If sonar.cxx.jsonCompilationDatabase.analyzeOnlyContainedFiles = True is used, the analyzed files will be limited to the files contained in the 'JSON Compilation Database' file - the intersection of the files configured via sonar.projectBaseDir and the files contained in the 'JSON Compilation Database' file.

Hints:

  • In case you are using header files to include .CPP files you have to use analyzeOnlyContainedFiles=False to get a complete result. Source files included in header files are not listed in the 'JSON Compilation Database' and are ignored.
  • analyzeOnlyContainedFiles=True: Unfortunately, the sensor cannot control the indexing of the source files. Therefore, all files that belong to language CXX and are located within the directory sonar.projectBaseDir are loaded onto the server, but are no longer analyzed, which saves time.
Clone this wiki locally