detekt / sonar-detekt

SonarQube plugin for Kotlin
https://detekt.dev
GNU Lesser General Public License v3.0
493 stars 52 forks source link
code-analysis code-quality hacktoberfest kotlin linter sonarqube

sonar-detekt

Now that Sonarqube officially supports Kotlin with detekt issue import, this plugin repository has been archived.

Some links which may help you setup sonar-kotlin with detekt findings:


Join the chat at https://kotlinlang.slack.com/messages/C88E12QH4/convo/C0BQ5GZ0S-1511956674.000289/ Pre Merge Checks FOSSA Status

sonar-kotlin-in-action

Features

Non supported features as of 2.x.x

The official sonar-kotlin plugin now supports these features.

Usage

Sonar Update Center

Building from source

Use Java 17 to build sonar-detekt:

Configurations, Baselines and Filters

Read about detekt configuration files here and about detekt baseline formats here.

Best ways to get started is to configure the detekt-gradle-plugin in your project and use its detektBaseline and detektGenerateConfig tasks.

Settings

To make use of this features, you have to set up some properties:

configs

detekt path filters support multiple regex entries by adding a , for separating. detekt yaml configuration path also supports multiple configuration files where the first entered override some values of the later added config files.

Limitations

Sonar analyzes each module individually which makes it harder to search for your config files. If you use relative paths, sonar-detekt first tries to find the provided path inside this module and if it can't find it, we are searching for the file in the parent folder. This leads to the limitation that only projects with sub-projects of depth 1 are supported. If you need more config files in your project hierarchies, provide them in the sub-projects with the same relative path available.

Mentions

As mentioned/used in ...

License

FOSSA Status