본문 바로가기

개발이야기/open source

소나큐브 파라미터 정리


Server

Key

Description

Default value

sonar.host.url

소나큐브 서버 url

http://localhost:9000

Project Configuration

Key

Description

Default value

sonar.projectKey

The project key that is unique for each project. 
Allowed characters are: letters, numbers, '-', '_', '.' and ':', with at least one non-digit. 

When using Maven, it is automatically set to <groupId>:<artifactId>.

 
sonar.sources

Comma-separated paths to directories containing source files.
Compatible with Maven. If not set, the source code is retrieved from the default Maven source code location. 

 

Optional Parameters

Project identity

Key

Description

Default value

sonar.projectName

소나큐브에 나타날 프로젝트 name

  • If there is no name defined yet, use the project key
  • If there is already a name in the DB, don't overwrite;
sonar.projectVersion
소나큐브에 나타날 프로젝트 version
"not provided"

Authentication

If Anyone does not have permission to perform analyses, you'll need to supply the credentials of a user with Execute Analysis permission for the analysis to run under.

Key
Description
Default value
sonar.login

sonarqube 로그인 id 혹은  authentication token 

 
sonar.password

sonarqube 로그인 pw 혹은  authentication token 

 

Web Services

Key
Description
Default value
sonar.ws.timeout

소나큐브에 정적분석 요청시, 최대로 기다릴 시간(timeout)

 60

Project Configuration

Key

Description

Default value

sonar.projectDescription

소나큐브에서 보여질 프로젝트 설명

 
sonar.links.homepage프로젝트 홈페이지 url 

sonar.links.ci

프로젝트 ci 홈페이지

 
sonar.links.issue

프로젝트 issue 트래커 홈페이지

 
sonar.links.scm프로젝트 소스 홈페이지 
sonar.links.scm_devDeveloper connection
Not compatible with Maven, which uses the <scm><developerConnection> attribute.
 
sonar.tests

프로젝트 테스트 디렉토리 ex. src/test 

 

sonar.language

소나큐브로 분석할 언어 또는  Plugin Library 로 추가한 언어.

만약 정하지 않으면 모든 언어 분석함(plugin으로 설치한 언어 포함)

 

sonar.sourceEncoding

소스 인코딩 방식

ex. euc-kr

System encoding

sonar.projectDate

소나큐브 프로젝트에 기록할 날짜

Current date

DEPRECATED FROM SQ 6.6 

 sonar.branch

소나큐브 6.7버젼부터 더이상 쓰이지 않음(삭제됨). Please consider using the Developer Edition for branch features.

 

sonar.profile

This property is deprecated since SQ 4.5 LTS (see SONAR-5370 - Deprecate usage of "sonar.profile" as an analysis parameter CLOSED ) and should not be used.

Default profile for the given language

 

sonar.projectBaseDir

프로젝트 base directory

ex. src/

 
 sonar.working.directory

Set the working directory for an analysis triggered with the SonarQube Scanner or the SonarQube Ant Task (versions greater than 2.0).

Path must be relative and unique for each project.

Beware: the specified folder is deleted before each analysis.

.sonar
sonar.scm.provider
This property can be used to explicitly tell SonarQube which SCM plugin should be used to grab SCM data on the project (in case auto-detection does not work). The value of this property is always lowercase and depends on the plugin (ex. "tfvc" for the TFVC plugin). Check the documentation page of each plugin to know more. 
sonar.scm.forceReloadAllBy default, blame information is only retrieved for changed files. Set this property to true to load blame information for all files. This can be useful is you feel that some SCM data is outdated but SonarQube does not get the latest information from the SCM engine.false

Exclusions / Inclusions

See Narrowing the Focus to:

  • Exclude files from analysis
  • Prevent some files from being checked for duplications
  • Prevent some files from being taken into account for code coverage by unit tests and integration tests
  • Ignore issues on certain components and against certain coding rules 
Key
Description
Default value
sonar.inclusionsComma-delimited list of file path patterns to be included in analysis. When set, only files matching the paths set here will be included in analysis. 
sonar.exclusionsComma-delimited list of file path patterns to be excluded from analysis. 
sonar.coverage.exclusionsComma-delimited list of file path patterns to be excluded from coverage calculations 
sonar.test.exclusionsComma-delimited list of test file path patterns to be excluded from analysis. 
sonar.test.inclusionsComma-delimited list of test file path patterns to be included in analysis. When set, only test files matching the paths set here will be included in analysis. 
sonar.issue.ignore.allfileFiles containing text matching this regular expression will be ignored by analysis. 
sonar.cpd.exclusionsComma-delimited list of file path patterns to be excluded from duplication detection 

Duplications

KeyDescription

Default value

sonar.cpd.exclusions(see the Exclusions/Inclusions section) 
sonar.cpd.${language}.minimumtokensA piece of code is considered duplicated as soon as there are at least 100 duplicated tokens in a row (overide with sonar.cpd.${language}.minimumTokens) spread on at least 10 lines of code (override with sonar.cpd.${language}.minimumLines). For Java projects, a piece of code is considered as duplicated when there is a series of at least 10 statements in a row, regardless of the number of tokens and lines. This threshold cannot be overridden. 100
sonar.cpd.${language}.minimumLines10

Analysis Logging

Key
Description
Default value
sonar.log.level

소나큐브 로그 level

INFO
sonar.verbose

Add more detail to both client and server-side analysis logs.

  • Activates DEBUG mode for the scanner. This is a shortcut of sonar.log.level=DEBUG.
  • Adds client-side environment variables and system properties to server-side log of analysis report processing. 
    NOTE There is the potential for this setting to expose sensitive information such as passwords if they are stored as server-side environment variables.
false
sonar.showProfiling

Display logs to see where the analyzer spends time.

This parameter is generating a file containing these timing infos in

<workingDir>/profiling/<moduleKey>-profiler.xml where <workingDir> is:
  • .sonar/profiling/ when analysis is run with Sonar Scanner
  • target/sonar/profiling/ when Maven is used 
false
sonar.scanner.dumpToFileOutputs to the specified file the full list of properties passed to the scanner API as a means to debug analysis. 

Parameters specific to Integration

Those parameters are listed here for completeness of this documentation page - but regular users should not have to worry about them because they mainly target integration use cases.

Key

Description

DEPRECATED FROM SQ 6.6
sonar.analysis.mode

This parameter is set to preview as part of PR analysis.


반응형