Parameters

Following we have gathered the most common parameters used in analysis.

SonarScanner

Parameter Description Example of usage
sonar.projectKey The project's unique key. Allowed characters are: letters, numbers, -, _, . and :, with at least one non-digit. -Dsonar.projectKey="$JOB_NAME" 
sonar.projectName Name of the project that will be displayed on the web interface. -Dsonar.projectName="$JOB_NAME"
sonar.sources Comma-separated paths to directories containing main source files.
Read from build system for Maven, Gradle, MSBuild projects. Defaults to project base directory when neither sonar.sources sonar.tests is provided.
-Dsonar.sources=./src
sonar.tests Comma-separated paths to directories containing test source files.
Read from build system for Maven, Gradle, MSBuild projects. Else default to empty.
-Dsonar.tests=./test
sonar.projectVersion The project version. After you change this parameter, the "New Code" tab will show difference between previous version and current one. -Dsonar.projectVersion=1.0
sonar.coverageReportPaths Path to export the coverage report.
See Code Coverage with Unit Test Framework.
-Dsonar.coverageReportPaths=
"$WORKSPACE/codecoverage/codecoverage.xml"
sonar.objectscript.cobertura.reportPaths Path to the Cobertura XML reports. Multiple paths may be comma-delimited. May be absolute or relative to the project base directory.
See Code Coverage with Test Coverage Tool.
-Dsonar.objectscript.cobertura.reportPaths=
"$WORKSPACE/codecoverage/codecoverage.xml"
sonar.objectscript.codeVersion Version of the IRIS or Caché database for which the code is intended. -Dsonar.objectscript.codeVersion=2020.4
-x Enables debug information. -x

 

See also: Analysis Parameters