Skip to content

Module code-analysis

A custom plugin for code analysis which uses Detekt and Sonarqube under the hood.

Download from MavenCentral

// buildSrc/build.gradle.kts

dependencies {


In the root build.gradle.kts

plugins {


Completely configured, and it adds automatically the detekt.xml config used by the IDEA plugin, so the IDEA plugin is enabled by default.

Sonarqube configurations

Sonar project key

Two options:

  • codeAnalysis.sonar.projectKey=projectKey (remember to change projectKey with your real key)
  • Set the project key to match ${group}:{}, for example: com.javiersc.semver:semantic-versioning-kmp
Sonar login token

As Gradle property:


As environment variable:


Remember to change token with the real token.

Sonar host url

Remember to change url with the real token. Default

Sonar organization

Remember to change org with the real token.