SonarQube - Admin configuration settings for languages
This document is intended to detail the language specific admin configuration settings for SonarQube.
SonarQube is installed at https://sonarqube.mdtproductdevelopment.com and is running Enterprise Edition version LTS 9.9
.
Overview
- Users having admin rights on the SonarQube instance sonarqube.mdtproductdevelopment.com can configure
the language specific settings by selecting a particular language at
Administration --> Configuration --> General Settings --> Languages
. - Link to the language configuration - sonarqube.mdtproductiondevelopment.com.
- Analysis support for the different languages depends on the SonarQube edition. SonarQube installed at sonarqube.mdtproductdevelopment.com being Enterprise, supports analysis for all the available languages.
- Can also reference the official docs for language settings here
Admin configuration - Language specific settings
Language-wise description and configuration values
C#
-
Analyze generated code
- Description : If set to "true", the files containing generated code are analyzed. If set to "false", the files containing generated code are ignored.
- Configuration value:
False
-
File suffixes
- Description : Comma-separated list of suffixes of files to analyze.
- Configuration value:
.cs
-
Ignore header comments
- Description : If set to "true", the file headers (that are usually the same on each file: licensing information for example) are not considered as comments. Thus metrics such as "Comment lines" do not get incremented. If set to "false", those file headers are considered as comments and metrics such as "Comment lines" get incremented.
- Configuration value:
True
Java
-
File suffixes
- Description : Comma-separated list of suffixes of files to analyze.
- Configuration value:
.java
.jav
-
JUnit Report Paths
- Description : Comma-separated paths to the various directories containing the *.xml JUnit report files. Each path may be absolute or relative to the project base directory.
- Configuration value:
blank
This is a global level configuration. Value can be overridden at the project level based on the directories containing the test source files.
JavaScript/TypeScript
-
Global variables
- Description : List of global variables.
- Configuration value:
angular
goog
google
OpenLayers
d3
dojo
dojox
dijit
Backbone
moment
casper
-
Ignore header comments
- Description : True to not count file header comments in comment metrics.
- Configuration value:
True
-
JavaScript execution environments
- Description : List of environments names. The analyzer automatically adds global variables based on that list. Available environment names: amd, applescript, atomtest, browser, commonjs, couch, embertest, flow, greasemonkey, jasmine, jest, jquery, meteor, mocha, mongo, nashorn, node, phantomjs, prototypejs, protractor, qunit, rhino, serviceworker, shared-node-browser, shelljs, webextensions, worker, wsh, yui.
- Configuration value:
amd
applescript
atomtest
browser
commonjs
couch
embertest
flow
greasemonkey
jasmine
jest
jquery
meteor
mocha
mongo
nashorn
node
phantomjs
prototypejs
protractor
qunit
rhino
serviceworker
shared-node-browser
shelljs
webextensions
worker
wsh
yui
-
JavaScript File Suffixes
- Description : List of suffixes for files to analyze.
- Configuration value:
.js
jsx
.mjs
.vue
-
Maximum size of analyzed files
- Description : Threshold for the maximum size of analyzed files (in kilobytes). Files that are larger are excluded from the analysis.
- Configuration value:
1000
-
TypeScript File Suffixes
- Description : List of suffixes for files to analyze.
- Configuration value:
.ts
.tsx
-
Libraries -> jQuery object aliases
- Description : List of names used to address jQuery object.
- Configuration value:
$
jQuery
-
Tests and Coverage -> LCOV Files
- Description : Paths (absolute or relative) to the files with LCOV data.
- Configuration value:
blank
This is a global level configuration. Value can be overridden at the project level based on the directories containing test source files.
-
TypeScript -> TypeScript tsconfig.json location
- Description : Path (relative to project base or absolute) to the tsconfig JSON file
- Configuration value:
blank
This is a global level configuration. Value can be overridden at the project level based on the directory containing tsconfig.json file.
CSS
-
File Suffixes
- Description : List of suffixes for files to analyze.
- Configuration value:
.css
.less
.scss
-
Popular Rule Engines -> Stylelint Report Files
- Description : Paths (absolute or relative) to the JSON files with stylelint issues.
- Configuration value:
blank
This is a global level configuration. Value can be overridden at the project level based on the directories containing the report files.
HTML
-
HTML File suffixes
- Description : List of file suffixes that will be scanned.
- Configuration value:
.html
.xhtml
.cshtml
.vbhtml
.aspx
.ascx
.rhtml
.erb
.shtm
.shtml
-
JSP File suffixes
- Description : List of JSP file suffixes that will be scanned.
- Configuration value:
.jsp
.jspf
.jspx
T-SQL
-
File Suffixes
- Description : Comma-separated list of suffixes for files to analyze.
- Configuration value:
.tsql
.sql
Python
-
File Suffixes
- Description : List of suffixes of Python files to analyze.
- Configuration value:
py
-
Tests and Coverage -> Path to coverage report(s)
- Description : List of paths pointing to coverage reports. Ant patterns are accepted for relative path. The reports have to conform to the Cobertura XML format.
- Configuration value:
coverage-reports/*coverage-*.xml
-
Tests and Coverage -> Skip the details when importing the Xunit reports
- Description : When enabled the test execution statistics is provided only on project level. Use this mode when paths in report are not found. Disabled by default.
- Configuration value:
False
-
Tests and Coverage -> Path to xunit report(s)
- Description : Path to the report of test execution, relative to project's root. Ant patterns are accepted. The reports have to conform to the junitreport XML format.
- Configuration value:
xunit-reports/xunit-result-*.xml
C / C++ / Objective-C
C / C++
-
C file suffixes
- Description : List of suffixes of C files to analyze.
- Configuration value:
.c
.h
-
C++ file suffixes
- Description : List of suffixes of C++ files to analyze.
- Configuration value:
.cc
.cpp
.cxx
.c++
.hh
.hpp
.hxx
.h++
.ipp
Objective-C
-
Objective-C file suffixes
- Description : List of suffixes of Objective-C files to analyze.
- Configuration value:
.m
Coverage
-
Bullseye XML report
- Description : Path to the Bullseye XML Coverage Report. The path may be either absolute or relative to the project base directory.
- Configuration value:
blank
This is a global level configuration. Value can be overridden at the project level based on the directories containing the report files.
-
Gcov reports
- Description : Path to the directory containing the *.gcov Gcov report files. The path may be either absolute or relative to the project base directory.
- Configuration value:
blank
This is a global level configuration. Value can be overridden at the project level based on the directories containing the report files.
-
llvm-cov report
- Description : Path to the Coverage Report generated by "llvm-cov show". The path may be either absolute or relative to the project base directory.
- Configuration value:
blank
This is a global level configuration. Value can be overridden at the project level based on the directories containing the report files.
-
Visual Studio XML reports
- Description :
Pattern for search for Visual Studio Coverage XML reports. The pattern may be either absolute or relative to the project base directory.
For example: "/.coveragexml" will find all ".coveragexml" files in all sub-directories of current project.
- Configuration value:
blank
This is a global level configuration. Value can be overridden at the project level based on the directories containing the report files.
- Configuration value:
Tests
-
CppUnit reports
- Description : Path to the directory containing the *.xml CppUnit report files. The path may be either absolute or relative to the project base directory.
- Configuration value:
blank
This is a global level configuration. Value can be overridden at the project level based on the directories containing the report files.
Miscellaneous
-
Ignore header comments
- Description : If set to "true", the file headers (that are usually the same on each file: licensing information for example) are not considered as comments. Thus metrics such as "Comment lines" do not get incremented. If set to "false", those file headers are considered as comments and metrics such as "Comment lines" get incremented.
- Configuration value:
True
References
- SonarQube official documentation
- Setting definition and notes of the language configurations