here are the steps to test it on the detekt repository:
git clone https://github.com/arturbosch/detekt
Install this plugin
SonarQube -> Quality Profiles -> Copy Sonar way profile -> Bulk Change -> Add all detekt rules to the copied profile
gradle sonar (expects to run sonarqube on localhost:9000; you can change it in the gradle.properties file - e.g. systemProp.sonar.host.url=http://localhost:9000)
Notice that no report needs to be generated as detekt is run programmatically.
PS: You can also test it on the sonar-detekt repository itself (mvn sonar:sonar). However there shouldn’t be any code smells in current master.
FAILURE: Build failed with an exception.
* Where:
Settings file '/home/ganncamp/testProjects/kotlin/detekt/settings.gradle.kts' line: 22
* What went wrong:
Script compilation errors:
Line 22: plugins {
^ Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public inline operator fun <T : Any, C : NamedDomainObjectContainer<TypeVariable(T)>> TypeVariable(C).invoke(configuration: NamedDomainObjectContainerScope<TypeVariable(T)>.() -> Unit): TypeVariable(C) defined in org.gradle.kotlin.dsl
public operator fun <T> Closure<TypeVariable(T)>.invoke(): TypeVariable(T) defined in org.gradle.kotlin.dsl
public operator fun <T> Closure<TypeVariable(T)>.invoke(x: Any?): TypeVariable(T) defined in org.gradle.kotlin.dsl
public operator fun <T> Closure<TypeVariable(T)>.invoke(vararg xs: Any?): TypeVariable(T) defined in org.gradle.kotlin.dsl
public operator fun <V> Callable<TypeVariable(V)>.invoke(): TypeVariable(V) defined in org.gradle.kotlin.dsl
public inline operator fun <reified T> Action<in TypeVariable(T)>.invoke(target: TypeVariable(T)): Unit defined in org.gradle.kotlin.dsl
public operator fun <T> NamedDomainObjectProvider<TypeVariable(T)>.invoke(action: TypeVariable(T).() -> Unit): Unit defined in org.gradle.kotlin.dsl
@Incubating public operator fun ArtifactHandler.invoke(configuration: ArtifactHandlerScope.() -> Unit): Unit defined in org.gradle.kotlin.dsl
@Incubating public operator fun DependencyConstraintHandler.invoke(configuration: DependencyConstraintHandlerScope.() -> Unit): Unit defined in org.gradle.kotlin.dsl
public inline operator fun <T> ExtraPropertiesExtension.invoke(initialValueProvider: () -> TypeVariable(T)): InitialValueExtraPropertyDelegateProvider<TypeVariable(T)> defined in org.gradle.kotlin.dsl
public operator fun <T> ExtraPropertiesExtension.invoke(initialValue: TypeVariable(T)): InitialValueExtraPropertyDelegateProvider<TypeVariable(T)> defined in org.gradle.kotlin.dsl
public operator fun <T> Spec<TypeVariable(T)>.invoke(arg: TypeVariable(T)): Boolean defined in org.gradle.kotlin.dsl
public inline operator fun TaskContainer.invoke(configuration: TaskContainerScope.() -> Unit): TaskContainer defined in org.gradle.kotlin.dsl
Line 23: id("com.gradle.enterprise") version "3.2.1"
^ Unresolved reference: id
2 errors
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3m 11s
BTW, the bureaucratic review looks fine except that it seems odd to me to put an “RC1” into the marketplace. I would expect this to be either “GA” or just plain “2.0.0”…
It seems like you are using an older version of Gradle.
Please use ./gradlew sonar inside the detekt repository to build with the newest Gradle version (6.3) via the Gradle Wrapper.
I’ve updated the PR to include just the 2.0.0 release without the RC-1.
I had some time to come back to this & got through an analysis.
In general, this looks good. I have some non-blocking feedback, and I’ve asked for a change to your PR. Once that’s taken care of, I’ll pull the trigger.
It seems that you have 2 different rules related to line length:
I find this difficult to understand, and suspect users will too.
It strikes me that you’re putting what I would consider rule description into your issue messages and (often altho not in this particular case) leaving the descriptions largely blank.
Fully-fleshed descriptions will help your users understand why they should follow your advice. At the same time, I believe keeping the advice itself (the issue message) short and sweet will help them triage issues efficiently.
Complex on what scale?
I encourage you to use secondary messages to indicate what in code increments complexity
Similarly, this rule would benefit from making the scale explicit: