Configuring SonarDelphi

June 3, 2026 ยท View on GitHub

SonarDelphi exposes a number of language-specific properties as analysis parameters, which can be:

  • configured via the SonarQube UI (Administration > General Settings > Delphi)
  • specified in sonar-project.properties
  • passed as command-line parameters to the sonar-scanner

By default, all __history and __recovery directories are excluded from the analysis. However, you can change the property sonar.delphi.exclusions to a different pattern if you want to force their analysis (not recommended).

Language-specific properties

General

KeyValueDefault Value
sonar.delphi.file.suffixesList of suffixes for Delphi files to analyze. To not filter, leave the list empty..pas,.dpr,.dpk
sonar.delphi.exclusionsList of file path patterns to be excluded from analysis of Delphi files.**/__history/**,**/__recovery/**

Toolchain

KeyValueDefault Value
sonar.delphi.installationPathPath to the Delphi installation folder.

:warning: Note: This must point to a valid Delphi IDE installation for the scan to succeed.
C:\Program Files (x86)\Embarcadero\Studio\22.0
sonar.delphi.toolchainThe compiler toolchain.
Options: DCC32, DCC64, DCCOSX, DCCOSX64, DCCIOSARM, DCCIOSARM64, DCCIOS32, DCCAARM, DCCAARM64, DCCLINUX64
See: Delphi Toolchains
DCC32
sonar.delphi.compilerVersionThe Delphi conditional symbol representing the compiler version.
Format: VER<nnn>.
See: Compiler Versions
VER350

Project Options

Note

Project options are indexed from project (.dproj) files.

These properties allow you to add or remove values from those indexed options.

KeyValueDefault Value
sonar.delphi.searchPathList of directories to search for include files and unit imports. Each path may be absolute or relative to the project base directory.-
sonar.delphi.codePageCode page to use when interpreting ANSI data.-
sonar.delphi.conditionalDefinesList of conditional defines to consider defined while parsing the project.-
sonar.delphi.conditionalUndefinesList of conditional defines to consider undefined while parsing the project.-
sonar.delphi.unitScopeNamesList of unit scope names, used for import resolution.-
sonar.delphi.unitAliasesList of unit aliases, used for import resolution.
Format: AliasName=UnitName
-

Test and Coverage

KeyValueDefault Value
sonar.delphi.testAttributeA fully qualified type name. Any code within a type that is annotated with this attribute will be treated as test code.DUnitX.Attributes.TestFixtureAttribute
sonar.delphi.testTypeA fully qualified type name. Any code within this type or its descendants will be treated as test code.TestFramework.TTestCase
sonar.delphi.nunit.reportPathsList of directories containing the *.xml NUnit report files. Each path may be absolute or relative to the project base directory.-
sonar.delphi.coverage.reportPathsList of directories containing the *.xml Delphi Code Coverage report files. Each path may be absolute or relative to the project base directory.-