mirror of
https://github.com/jlengrand/detekt.git
synced 2026-03-10 08:11:23 +00:00
Update dependencies (#2031)
* Update dependencies * Remove usage of deprecated `before` method * Regenerate docs
This commit is contained in:
committed by
Artur Bosch
parent
fc9fdca498
commit
f5a8086bd1
@@ -22,12 +22,14 @@ dependencies {
|
||||
}
|
||||
|
||||
tasks.withType<DokkaTask>().configureEach {
|
||||
// suppresses undocumented classes but not dokka warnings https://github.com/Kotlin/dokka/issues/90
|
||||
reportUndocumented = false
|
||||
outputFormat = "jekyll"
|
||||
outputDirectory = "$rootDir/docs/pages/kdoc"
|
||||
@Suppress("MagicNumber")
|
||||
jdkVersion = 8
|
||||
configuration {
|
||||
// suppresses undocumented classes but not dokka warnings https://github.com/Kotlin/dokka/issues/90
|
||||
reportUndocumented = false
|
||||
@Suppress("MagicNumber")
|
||||
jdkVersion = 8
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Test>().configureEach {
|
||||
|
||||
@@ -13,17 +13,17 @@ plugins {
|
||||
id("com.gradle.plugin-publish") version "0.10.1"
|
||||
id("com.jfrog.bintray") version "1.8.4"
|
||||
kotlin("jvm") version "1.3.50"
|
||||
id("org.jetbrains.dokka") version "0.9.18"
|
||||
id("com.github.ben-manes.versions") version "0.21.0"
|
||||
id("io.gitlab.arturbosch.detekt") version "1.0.1"
|
||||
id("org.jetbrains.dokka") version "0.10.0"
|
||||
id("com.github.ben-manes.versions") version "0.27.0"
|
||||
id("io.gitlab.arturbosch.detekt") version "1.1.1"
|
||||
}
|
||||
|
||||
group = "io.gitlab.arturbosch.detekt"
|
||||
version = "1.1.1"
|
||||
|
||||
val spekVersion = "2.0.2"
|
||||
val junitPlatformVersion = "1.4.1"
|
||||
val assertjVersion = "3.12.2"
|
||||
val spekVersion = "2.0.8"
|
||||
val junitPlatformVersion = "1.5.2"
|
||||
val assertjVersion = "3.13.2"
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib"))
|
||||
@@ -47,6 +47,7 @@ gradlePlugin {
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
systemProperty("SPEK_TIMEOUT", 0) // disable test timeout
|
||||
testLogging {
|
||||
// set options for log level LIFECYCLE
|
||||
events = setOf(
|
||||
@@ -81,11 +82,13 @@ pluginBundle {
|
||||
}
|
||||
|
||||
tasks.dokka {
|
||||
// suppresses undocumented classes but not dokka warnings
|
||||
// https://github.com/Kotlin/dokka/issues/229 && https://github.com/Kotlin/dokka/issues/319
|
||||
reportUndocumented = false
|
||||
outputFormat = "javadoc"
|
||||
outputDirectory = "$buildDir/javadoc"
|
||||
configuration {
|
||||
// suppresses undocumented classes but not dokka warnings
|
||||
// https://github.com/Kotlin/dokka/issues/229 && https://github.com/Kotlin/dokka/issues/319
|
||||
reportUndocumented = false
|
||||
}
|
||||
}
|
||||
|
||||
val generateDefaultDetektVersionFile by tasks.registering {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -19,7 +19,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
context("using ${builder.gradleBuildName}") {
|
||||
describe("without detekt config") {
|
||||
|
||||
before {
|
||||
beforeGroup {
|
||||
gradleRunner = builder.build()
|
||||
result = gradleRunner.runDetektTask()
|
||||
}
|
||||
@@ -46,7 +46,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
|
||||
describe("without multiple detekt configs") {
|
||||
|
||||
before {
|
||||
beforeGroup {
|
||||
val config = """
|
||||
|detekt {
|
||||
| config = files("firstConfig.yml", "secondConfig.yml")
|
||||
@@ -70,7 +70,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
describe("with custom baseline file") {
|
||||
val baselineFilename = "detekt-baseline.xml"
|
||||
|
||||
before {
|
||||
beforeGroup {
|
||||
|
||||
val config = """
|
||||
|detekt {
|
||||
@@ -96,7 +96,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
val customSrc1 = "gensrc/kotlin"
|
||||
val customSrc2 = "src/main/kotlin"
|
||||
|
||||
before {
|
||||
beforeGroup {
|
||||
|
||||
val config = """
|
||||
|detekt {
|
||||
@@ -126,7 +126,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
|
||||
describe("with custom reports dir") {
|
||||
|
||||
before {
|
||||
beforeGroup {
|
||||
|
||||
val config = """
|
||||
|detekt {
|
||||
@@ -158,7 +158,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
|
||||
describe("with custom reports dir and custom report filename") {
|
||||
|
||||
before {
|
||||
beforeGroup {
|
||||
|
||||
val config = """
|
||||
|detekt {
|
||||
@@ -193,7 +193,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
|
||||
describe("with disabled reports") {
|
||||
|
||||
before {
|
||||
beforeGroup {
|
||||
|
||||
val config = """
|
||||
|detekt {
|
||||
@@ -222,7 +222,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
|
||||
describe("with custom report types") {
|
||||
describe("configured correctly") {
|
||||
before {
|
||||
beforeGroup {
|
||||
|
||||
val config = """
|
||||
|detekt {
|
||||
@@ -255,7 +255,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
}
|
||||
|
||||
describe("report id is missing") {
|
||||
before {
|
||||
beforeGroup {
|
||||
|
||||
val config = """
|
||||
|detekt {
|
||||
@@ -276,7 +276,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
}
|
||||
|
||||
describe("report filename is missing") {
|
||||
before {
|
||||
beforeGroup {
|
||||
|
||||
val config = """
|
||||
|detekt {
|
||||
@@ -297,7 +297,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
}
|
||||
|
||||
describe("report filename is a directory") {
|
||||
before {
|
||||
beforeGroup {
|
||||
|
||||
val aDirectory = "\${rootDir}/src"
|
||||
|
||||
@@ -323,7 +323,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
describe("using the report id of a well known type") {
|
||||
DetektReportType.values().forEach { wellKnownType ->
|
||||
context(wellKnownType.name) {
|
||||
before {
|
||||
beforeGroup {
|
||||
|
||||
val config = """
|
||||
|detekt {
|
||||
@@ -348,7 +348,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
|
||||
describe("with flags") {
|
||||
|
||||
before {
|
||||
beforeGroup {
|
||||
|
||||
val config = """
|
||||
|detekt {
|
||||
@@ -398,7 +398,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
}
|
||||
|
||||
describe("with an additional plugin") {
|
||||
before {
|
||||
beforeGroup {
|
||||
val config = """
|
||||
|dependencies {
|
||||
| detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:$VERSION_UNDER_TEST")
|
||||
@@ -422,7 +422,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
|
||||
describe("with a custom tool version") {
|
||||
val customVersion = "1.0.0.RC8"
|
||||
before {
|
||||
beforeGroup {
|
||||
val config = """
|
||||
|detekt {
|
||||
| toolVersion = "$customVersion"
|
||||
@@ -449,7 +449,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
describe("and creating a custom task") {
|
||||
context("using the groovy dsl") {
|
||||
val builder = groovy().dryRun()
|
||||
before {
|
||||
beforeGroup {
|
||||
val config = """
|
||||
|task detektFailFast(type: io.gitlab.arturbosch.detekt.Detekt) {
|
||||
| description = "Runs a failfast detekt build."
|
||||
@@ -525,7 +525,7 @@ internal object DetektTaskDslTest : Spek({
|
||||
|
||||
context("using the kotlin dsl") {
|
||||
val builder = kotlin().dryRun()
|
||||
before {
|
||||
beforeGroup {
|
||||
val config = """
|
||||
|task<io.gitlab.arturbosch.detekt.Detekt>("detektFailFast") {
|
||||
| description = "Runs a failfast detekt build."
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.spekframework.spek2.style.specification.describe
|
||||
|
||||
object MultiVersionTest : Spek({
|
||||
|
||||
val testedGradleVersions = listOf("4.9", "5.6")
|
||||
val testedGradleVersions = listOf("4.9", "5.6.2")
|
||||
|
||||
describe("detekt plugin running on different Gradle versions") {
|
||||
listOf(groovy().dryRun(), kotlin().dryRun()).forEach { builder ->
|
||||
|
||||
@@ -4,57 +4,386 @@ title: alltypes - detekt-api
|
||||
|
||||
### All Types
|
||||
|
||||
| [io.gitlab.arturbosch.detekt.api.AnnotationExcluder](../io.gitlab.arturbosch.detekt.api/-annotation-excluder/index.html) | Primary use case for an AnnotationExcluder is to decide if a KtElement should be excluded from further analysis. This is done by checking if a special annotation is present over the element. |
|
||||
| [io.gitlab.arturbosch.detekt.api.BaseConfig](../io.gitlab.arturbosch.detekt.api/-base-config/index.html) | Convenient base configuration which parses/casts the configuration value based on the type of the default value. |
|
||||
| [io.gitlab.arturbosch.detekt.api.BaseRule](../io.gitlab.arturbosch.detekt.api/-base-rule/index.html) | Defines the visiting mechanism for KtFile's. |
|
||||
| [io.gitlab.arturbosch.detekt.api.CodeSmell](../io.gitlab.arturbosch.detekt.api/-code-smell/index.html) | A code smell indicates any possible design problem inside a program's source code. The type of a code smell is described by an [Issue](../io.gitlab.arturbosch.detekt.api/-issue/index.html). |
|
||||
| [io.gitlab.arturbosch.detekt.api.Compactable](../io.gitlab.arturbosch.detekt.api/-compactable/index.html) | Provides a compact string representation. |
|
||||
| [io.gitlab.arturbosch.detekt.api.CompositeConfig](../io.gitlab.arturbosch.detekt.api/-composite-config/index.html) | Wraps two different configuration which should be considered when retrieving properties. |
|
||||
| [io.gitlab.arturbosch.detekt.api.Config](../io.gitlab.arturbosch.detekt.api/-config/index.html) | A configuration holds information about how to configure specific rules. |
|
||||
| [io.gitlab.arturbosch.detekt.api.ConfigAware](../io.gitlab.arturbosch.detekt.api/-config-aware/index.html) | Interface which is implemented by each Rule class to provide utility functions to retrieve specific or generic properties from the underlying detekt configuration file. |
|
||||
| [io.gitlab.arturbosch.detekt.api.ConsoleReport](../io.gitlab.arturbosch.detekt.api/-console-report/index.html) | Extension point which describes how findings should be printed on the console. |
|
||||
| [io.gitlab.arturbosch.detekt.api.Context](../io.gitlab.arturbosch.detekt.api/-context/index.html) | A context describes the storing and reporting mechanism of [Finding](../io.gitlab.arturbosch.detekt.api/-finding/index.html)'s inside a [Rule](../io.gitlab.arturbosch.detekt.api/-rule/index.html). Additionally it handles suppression and aliases management. |
|
||||
| [io.gitlab.arturbosch.detekt.api.CorrectableCodeSmell](../io.gitlab.arturbosch.detekt.api/-correctable-code-smell/index.html) | Represents a code smell for that can be auto corrected. |
|
||||
| [io.gitlab.arturbosch.detekt.api.Debt](../io.gitlab.arturbosch.detekt.api/-debt/index.html) | Debt describes the estimated amount of work needed to fix a given issue. |
|
||||
| [io.gitlab.arturbosch.detekt.api.DefaultContext](../io.gitlab.arturbosch.detekt.api/-default-context/index.html) | Default [Context](../io.gitlab.arturbosch.detekt.api/-context/index.html) implementation. |
|
||||
| [io.gitlab.arturbosch.detekt.api.Detektion](../io.gitlab.arturbosch.detekt.api/-detektion/index.html) | Storage for all kinds of findings and additional information which needs to be transferred from the detekt engine to the user. |
|
||||
| [io.gitlab.arturbosch.detekt.api.internal.DetektPomModel](../io.gitlab.arturbosch.detekt.api.internal/-detekt-pom-model/index.html) | Adapted from https://github.com/pinterest/ktlint/blob/master/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/KtLint.kt Licenced under the MIT licence - https://github.com/pinterest/ktlint/blob/master/LICENSE |
|
||||
| [io.gitlab.arturbosch.detekt.api.DetektVisitor](../io.gitlab.arturbosch.detekt.api/-detekt-visitor/index.html) | Basic visitor which is used inside detekt. Guarantees a better looking name as the extended base class :). |
|
||||
| [io.gitlab.arturbosch.detekt.api.Entity](../io.gitlab.arturbosch.detekt.api/-entity/index.html) | Stores information about a specific code fragment. |
|
||||
| [io.gitlab.arturbosch.detekt.api.Extension](../io.gitlab.arturbosch.detekt.api/-extension/index.html) | Defines extension points in detekt. Currently supported extensions are: |
|
||||
| [io.gitlab.arturbosch.detekt.api.FileProcessListener](../io.gitlab.arturbosch.detekt.api/-file-process-listener/index.html) | Gather additional metrics about the analyzed kotlin file. Pay attention to the thread policy of each function! |
|
||||
| [io.gitlab.arturbosch.detekt.api.Finding](../io.gitlab.arturbosch.detekt.api/-finding/index.html) | Base interface of detection findings. Inherits a bunch of useful behaviour from sub interfaces. |
|
||||
| [io.gitlab.arturbosch.detekt.api.HasEntity](../io.gitlab.arturbosch.detekt.api/-has-entity/index.html) | Describes a source code position. |
|
||||
| [io.gitlab.arturbosch.detekt.api.HasMetrics](../io.gitlab.arturbosch.detekt.api/-has-metrics/index.html) | Adds metric container behaviour. |
|
||||
| [io.gitlab.arturbosch.detekt.api.HierarchicalConfig](../io.gitlab.arturbosch.detekt.api/-hierarchical-config/index.html) | A configuration which keeps track of the config it got sub-config'ed from by the [subConfig](../io.gitlab.arturbosch.detekt.api/-config/sub-config.html) function. It's main usage is to recreate the property-path which was taken when using the [subConfig](../io.gitlab.arturbosch.detekt.api/-config/sub-config.html) function repeatedly. |
|
||||
| [io.gitlab.arturbosch.detekt.api.Issue](../io.gitlab.arturbosch.detekt.api/-issue/index.html) | An issue represents a problem in the codebase. |
|
||||
| [org.jetbrains.kotlin.psi.KtAnnotated](../io.gitlab.arturbosch.detekt.api/org.jetbrains.kotlin.psi.-kt-annotated/index.html) (extensions in package io.gitlab.arturbosch.detekt.api) | |
|
||||
| [org.jetbrains.kotlin.psi.KtAnnotated](../io.gitlab.arturbosch.detekt.api.internal/org.jetbrains.kotlin.psi.-kt-annotated/index.html) (extensions in package io.gitlab.arturbosch.detekt.api.internal) | |
|
||||
| [org.jetbrains.kotlin.psi.KtCallExpression](../io.gitlab.arturbosch.detekt.api.internal/org.jetbrains.kotlin.psi.-kt-call-expression/index.html) (extensions in package io.gitlab.arturbosch.detekt.api.internal) | |
|
||||
| [org.jetbrains.kotlin.psi.KtElement](../io.gitlab.arturbosch.detekt.api/org.jetbrains.kotlin.psi.-kt-element/index.html) (extensions in package io.gitlab.arturbosch.detekt.api) | |
|
||||
| [org.jetbrains.kotlin.psi.KtElement](../io.gitlab.arturbosch.detekt.api.internal/org.jetbrains.kotlin.psi.-kt-element/index.html) (extensions in package io.gitlab.arturbosch.detekt.api.internal) | |
|
||||
| [org.jetbrains.kotlin.psi.KtFile](../io.gitlab.arturbosch.detekt.api.internal/org.jetbrains.kotlin.psi.-kt-file/index.html) (extensions in package io.gitlab.arturbosch.detekt.api.internal) | |
|
||||
| [io.gitlab.arturbosch.detekt.api.LazyRegex](../io.gitlab.arturbosch.detekt.api/-lazy-regex/index.html) | LazyRegex class provides a lazy evaluation of a Regex pattern for usages inside Rules. It computes the value once when reaching the point of its usage and returns the same value when requested again. |
|
||||
| [io.gitlab.arturbosch.detekt.api.Location](../io.gitlab.arturbosch.detekt.api/-location/index.html) | Specifies a position within a source code fragment. |
|
||||
| [io.gitlab.arturbosch.detekt.api.internal.McCabeVisitor](../io.gitlab.arturbosch.detekt.api.internal/-mc-cabe-visitor/index.html) | Counts the cyclomatic complexity of functions. |
|
||||
| [io.gitlab.arturbosch.detekt.api.Metric](../io.gitlab.arturbosch.detekt.api/-metric/index.html) | Metric type, can be an integer or double value. Internally it is stored as an integer, but the conversion factor and is double attributes can be used to retrieve it as a double value. |
|
||||
| [io.gitlab.arturbosch.detekt.api.MultiRule](../io.gitlab.arturbosch.detekt.api/-multi-rule/index.html) | Composite rule which delegates work to child rules. Can be used to combine different rules which do similar work like scanning the source code line by line to increase performance. |
|
||||
| [io.gitlab.arturbosch.detekt.api.Notification](../io.gitlab.arturbosch.detekt.api/-notification/index.html) | Any kind of notification which should be printed to the console. For example when using the formatting rule set, any change to your kotlin file is a notification. |
|
||||
| [io.gitlab.arturbosch.detekt.api.OutputReport](../io.gitlab.arturbosch.detekt.api/-output-report/index.html) | Translates detekt's result container - [Detektion](../io.gitlab.arturbosch.detekt.api/-detektion/index.html) - into an output report which is written inside a file. |
|
||||
| [io.gitlab.arturbosch.detekt.api.internal.PathFilters](../io.gitlab.arturbosch.detekt.api.internal/-path-filters/index.html) | |
|
||||
| [io.gitlab.arturbosch.detekt.api.ProjectMetric](../io.gitlab.arturbosch.detekt.api/-project-metric/index.html) | Anything that can be expressed as a number value for projects. |
|
||||
| [io.gitlab.arturbosch.detekt.api.Rule](../io.gitlab.arturbosch.detekt.api/-rule/index.html) | A rule defines how one specific code structure should look like. If code is found which does not meet this structure, it is considered as harmful regarding maintainability or readability. |
|
||||
| [io.gitlab.arturbosch.detekt.api.RuleId](../io.gitlab.arturbosch.detekt.api/-rule-id.html) | The type to use when referring to rule ids giving it more context then a String would. |
|
||||
| [io.gitlab.arturbosch.detekt.api.RuleSet](../io.gitlab.arturbosch.detekt.api/-rule-set/index.html) | A rule set is a collection of rules and must be defined within a rule set provider implementation. |
|
||||
| [io.gitlab.arturbosch.detekt.api.RuleSetId](../io.gitlab.arturbosch.detekt.api/-rule-set-id.html) | |
|
||||
| [io.gitlab.arturbosch.detekt.api.RuleSetProvider](../io.gitlab.arturbosch.detekt.api/-rule-set-provider/index.html) | A rule set provider, as the name states, is responsible for creating rule sets. |
|
||||
| [io.gitlab.arturbosch.detekt.api.Severity](../io.gitlab.arturbosch.detekt.api/-severity/index.html) | Rules can classified into different severity grades. Maintainer can choose a grade which is most harmful to their projects. |
|
||||
| [io.gitlab.arturbosch.detekt.api.internal.SimpleNotification](../io.gitlab.arturbosch.detekt.api.internal/-simple-notification/index.html) | |
|
||||
| [io.gitlab.arturbosch.detekt.api.SingleAssign](../io.gitlab.arturbosch.detekt.api/-single-assign/index.html) | Allows to assign a property just once. Further assignments result in [IllegalStateException](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-state-exception/index.html)'s. |
|
||||
| [io.gitlab.arturbosch.detekt.api.SourceLocation](../io.gitlab.arturbosch.detekt.api/-source-location/index.html) | Stores line and column information of a location. |
|
||||
| [io.gitlab.arturbosch.detekt.api.SplitPattern](../io.gitlab.arturbosch.detekt.api/-split-pattern/index.html) | Splits given text into parts and provides testing utilities for its elements. Basic use cases are to specify different function or class names in the detekt yaml config and test for their appearance in specific rules. |
|
||||
| [io.gitlab.arturbosch.detekt.api.TextLocation](../io.gitlab.arturbosch.detekt.api/-text-location/index.html) | Stores character start and end positions of an text file. |
|
||||
| [io.gitlab.arturbosch.detekt.api.ThresholdedCodeSmell](../io.gitlab.arturbosch.detekt.api/-thresholded-code-smell/index.html) | Represents a code smell for which a specific metric can be determined which is responsible for the existence of this rule violation. |
|
||||
| [io.gitlab.arturbosch.detekt.api.ThresholdRule](../io.gitlab.arturbosch.detekt.api/-threshold-rule/index.html) | Provides a threshold attribute for this rule, which is specified manually for default values but can be also obtained from within a configuration object. |
|
||||
| [io.gitlab.arturbosch.detekt.api.YamlConfig](../io.gitlab.arturbosch.detekt.api/-yaml-config/index.html) | Config implementation using the yaml format. SubConfigurations can return sub maps according to the yaml specification. |
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.AnnotationExcluder](../io.gitlab.arturbosch.detekt.api/-annotation-excluder/index.html)
|
||||
|
||||
Primary use case for an AnnotationExcluder is to decide if a KtElement should be
|
||||
excluded from further analysis. This is done by checking if a special annotation
|
||||
is present over the element.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.BaseConfig](../io.gitlab.arturbosch.detekt.api/-base-config/index.html)
|
||||
|
||||
Convenient base configuration which parses/casts the configuration value based on the type of the default value.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.BaseRule](../io.gitlab.arturbosch.detekt.api/-base-rule/index.html)
|
||||
|
||||
Defines the visiting mechanism for KtFile's.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.CodeSmell](../io.gitlab.arturbosch.detekt.api/-code-smell/index.html)
|
||||
|
||||
A code smell indicates any possible design problem inside a program's source code.
|
||||
The type of a code smell is described by an [Issue](../io.gitlab.arturbosch.detekt.api/-issue/index.html).
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Compactable](../io.gitlab.arturbosch.detekt.api/-compactable/index.html)
|
||||
|
||||
Provides a compact string representation.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.CompositeConfig](../io.gitlab.arturbosch.detekt.api/-composite-config/index.html)
|
||||
|
||||
Wraps two different configuration which should be considered when retrieving properties.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Config](../io.gitlab.arturbosch.detekt.api/-config/index.html)
|
||||
|
||||
A configuration holds information about how to configure specific rules.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.ConfigAware](../io.gitlab.arturbosch.detekt.api/-config-aware/index.html)
|
||||
|
||||
Interface which is implemented by each Rule class to provide
|
||||
utility functions to retrieve specific or generic properties
|
||||
from the underlying detekt configuration file.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.ConsoleReport](../io.gitlab.arturbosch.detekt.api/-console-report/index.html)
|
||||
|
||||
Extension point which describes how findings should be printed on the console.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Context](../io.gitlab.arturbosch.detekt.api/-context/index.html)
|
||||
|
||||
A context describes the storing and reporting mechanism of [Finding](../io.gitlab.arturbosch.detekt.api/-finding/index.html)'s inside a [Rule](../io.gitlab.arturbosch.detekt.api/-rule/index.html).
|
||||
Additionally it handles suppression and aliases management.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.CorrectableCodeSmell](../io.gitlab.arturbosch.detekt.api/-correctable-code-smell/index.html)
|
||||
|
||||
Represents a code smell for that can be auto corrected.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Debt](../io.gitlab.arturbosch.detekt.api/-debt/index.html)
|
||||
|
||||
Debt describes the estimated amount of work needed to fix a given issue.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.DefaultContext](../io.gitlab.arturbosch.detekt.api/-default-context/index.html)
|
||||
|
||||
Default [Context](../io.gitlab.arturbosch.detekt.api/-context/index.html) implementation.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Detektion](../io.gitlab.arturbosch.detekt.api/-detektion/index.html)
|
||||
|
||||
Storage for all kinds of findings and additional information
|
||||
which needs to be transferred from the detekt engine to the user.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.internal.DetektPomModel](../io.gitlab.arturbosch.detekt.api.internal/-detekt-pom-model/index.html)
|
||||
|
||||
Adapted from https://github.com/pinterest/ktlint/blob/master/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/KtLint.kt
|
||||
Licenced under the MIT licence - https://github.com/pinterest/ktlint/blob/master/LICENSE
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.DetektVisitor](../io.gitlab.arturbosch.detekt.api/-detekt-visitor/index.html)
|
||||
|
||||
Basic visitor which is used inside detekt.
|
||||
Guarantees a better looking name as the extended base class :).
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Entity](../io.gitlab.arturbosch.detekt.api/-entity/index.html)
|
||||
|
||||
Stores information about a specific code fragment.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Extension](../io.gitlab.arturbosch.detekt.api/-extension/index.html)
|
||||
|
||||
Defines extension points in detekt.
|
||||
Currently supported extensions are:
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.FileProcessListener](../io.gitlab.arturbosch.detekt.api/-file-process-listener/index.html)
|
||||
|
||||
Gather additional metrics about the analyzed kotlin file.
|
||||
Pay attention to the thread policy of each function!
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Finding](../io.gitlab.arturbosch.detekt.api/-finding/index.html)
|
||||
|
||||
Base interface of detection findings. Inherits a bunch of useful behaviour
|
||||
from sub interfaces.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.HasEntity](../io.gitlab.arturbosch.detekt.api/-has-entity/index.html)
|
||||
|
||||
Describes a source code position.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.HasMetrics](../io.gitlab.arturbosch.detekt.api/-has-metrics/index.html)
|
||||
|
||||
Adds metric container behaviour.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.HierarchicalConfig](../io.gitlab.arturbosch.detekt.api/-hierarchical-config/index.html)
|
||||
|
||||
A configuration which keeps track of the config it got sub-config'ed from by the [subConfig](../io.gitlab.arturbosch.detekt.api/-config/sub-config.html) function.
|
||||
It's main usage is to recreate the property-path which was taken when using the [subConfig](../io.gitlab.arturbosch.detekt.api/-config/sub-config.html) function repeatedly.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Issue](../io.gitlab.arturbosch.detekt.api/-issue/index.html)
|
||||
|
||||
An issue represents a problem in the codebase.
|
||||
|
||||
|
||||
| (extensions in package io.gitlab.arturbosch.detekt.api)
|
||||
|
||||
##### [org.jetbrains.kotlin.psi.KtAnnotated](../io.gitlab.arturbosch.detekt.api/org.jetbrains.kotlin.psi.-kt-annotated/index.html)
|
||||
|
||||
|
||||
| (extensions in package io.gitlab.arturbosch.detekt.api.internal)
|
||||
|
||||
##### [org.jetbrains.kotlin.psi.KtAnnotated](../io.gitlab.arturbosch.detekt.api.internal/org.jetbrains.kotlin.psi.-kt-annotated/index.html)
|
||||
|
||||
|
||||
| (extensions in package io.gitlab.arturbosch.detekt.api.internal)
|
||||
|
||||
##### [org.jetbrains.kotlin.psi.KtCallExpression](../io.gitlab.arturbosch.detekt.api.internal/org.jetbrains.kotlin.psi.-kt-call-expression/index.html)
|
||||
|
||||
|
||||
| (extensions in package io.gitlab.arturbosch.detekt.api)
|
||||
|
||||
##### [org.jetbrains.kotlin.psi.KtElement](../io.gitlab.arturbosch.detekt.api/org.jetbrains.kotlin.psi.-kt-element/index.html)
|
||||
|
||||
|
||||
| (extensions in package io.gitlab.arturbosch.detekt.api.internal)
|
||||
|
||||
##### [org.jetbrains.kotlin.psi.KtElement](../io.gitlab.arturbosch.detekt.api.internal/org.jetbrains.kotlin.psi.-kt-element/index.html)
|
||||
|
||||
|
||||
| (extensions in package io.gitlab.arturbosch.detekt.api.internal)
|
||||
|
||||
##### [org.jetbrains.kotlin.psi.KtFile](../io.gitlab.arturbosch.detekt.api.internal/org.jetbrains.kotlin.psi.-kt-file/index.html)
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.LazyRegex](../io.gitlab.arturbosch.detekt.api/-lazy-regex/index.html)
|
||||
|
||||
LazyRegex class provides a lazy evaluation of a Regex pattern for usages inside Rules.
|
||||
It computes the value once when reaching the point of its usage and returns the same
|
||||
value when requested again.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Location](../io.gitlab.arturbosch.detekt.api/-location/index.html)
|
||||
|
||||
Specifies a position within a source code fragment.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.internal.McCabeVisitor](../io.gitlab.arturbosch.detekt.api.internal/-mc-cabe-visitor/index.html)
|
||||
|
||||
Counts the cyclomatic complexity of functions.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Metric](../io.gitlab.arturbosch.detekt.api/-metric/index.html)
|
||||
|
||||
Metric type, can be an integer or double value. Internally it is stored as an integer,
|
||||
but the conversion factor and is double attributes can be used to retrieve it as a double value.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.MultiRule](../io.gitlab.arturbosch.detekt.api/-multi-rule/index.html)
|
||||
|
||||
Composite rule which delegates work to child rules.
|
||||
Can be used to combine different rules which do similar work like
|
||||
scanning the source code line by line to increase performance.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Notification](../io.gitlab.arturbosch.detekt.api/-notification/index.html)
|
||||
|
||||
Any kind of notification which should be printed to the console.
|
||||
For example when using the formatting rule set, any change to
|
||||
your kotlin file is a notification.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.OutputReport](../io.gitlab.arturbosch.detekt.api/-output-report/index.html)
|
||||
|
||||
Translates detekt's result container - [Detektion](../io.gitlab.arturbosch.detekt.api/-detektion/index.html) - into an output report
|
||||
which is written inside a file.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.internal.PathFilters](../io.gitlab.arturbosch.detekt.api.internal/-path-filters/index.html)
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.ProjectMetric](../io.gitlab.arturbosch.detekt.api/-project-metric/index.html)
|
||||
|
||||
Anything that can be expressed as a number value for projects.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Rule](../io.gitlab.arturbosch.detekt.api/-rule/index.html)
|
||||
|
||||
A rule defines how one specific code structure should look like. If code is found
|
||||
which does not meet this structure, it is considered as harmful regarding maintainability
|
||||
or readability.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.RuleId](../io.gitlab.arturbosch.detekt.api/-rule-id.html)
|
||||
|
||||
The type to use when referring to rule ids giving it more context then a String would.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.RuleSet](../io.gitlab.arturbosch.detekt.api/-rule-set/index.html)
|
||||
|
||||
A rule set is a collection of rules and must be defined within a rule set provider implementation.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.RuleSetId](../io.gitlab.arturbosch.detekt.api/-rule-set-id.html)
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.RuleSetProvider](../io.gitlab.arturbosch.detekt.api/-rule-set-provider/index.html)
|
||||
|
||||
A rule set provider, as the name states, is responsible for creating rule sets.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.Severity](../io.gitlab.arturbosch.detekt.api/-severity/index.html)
|
||||
|
||||
Rules can classified into different severity grades. Maintainer can choose
|
||||
a grade which is most harmful to their projects.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.internal.SimpleNotification](../io.gitlab.arturbosch.detekt.api.internal/-simple-notification/index.html)
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.SingleAssign](../io.gitlab.arturbosch.detekt.api/-single-assign/index.html)
|
||||
|
||||
Allows to assign a property just once.
|
||||
Further assignments result in [IllegalStateException](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-state-exception/index.html)'s.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.SourceLocation](../io.gitlab.arturbosch.detekt.api/-source-location/index.html)
|
||||
|
||||
Stores line and column information of a location.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.SplitPattern](../io.gitlab.arturbosch.detekt.api/-split-pattern/index.html)
|
||||
|
||||
Splits given text into parts and provides testing utilities for its elements.
|
||||
Basic use cases are to specify different function or class names in the detekt
|
||||
yaml config and test for their appearance in specific rules.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.TextLocation](../io.gitlab.arturbosch.detekt.api/-text-location/index.html)
|
||||
|
||||
Stores character start and end positions of an text file.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.ThresholdedCodeSmell](../io.gitlab.arturbosch.detekt.api/-thresholded-code-smell/index.html)
|
||||
|
||||
Represents a code smell for which a specific metric can be determined which is responsible
|
||||
for the existence of this rule violation.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.ThresholdRule](../io.gitlab.arturbosch.detekt.api/-threshold-rule/index.html)
|
||||
|
||||
Provides a threshold attribute for this rule, which is specified manually for default values
|
||||
but can be also obtained from within a configuration object.
|
||||
|
||||
|
||||
|
|
||||
|
||||
##### [io.gitlab.arturbosch.detekt.api.YamlConfig](../io.gitlab.arturbosch.detekt.api/-yaml-config/index.html)
|
||||
|
||||
Config implementation using the yaml format. SubConfigurations can return sub maps according to the
|
||||
yaml specification.
|
||||
|
||||
|
||||
|
||||
@@ -6,4 +6,4 @@ title: DetektPomModel.getModelAspect - detekt-api
|
||||
|
||||
# getModelAspect
|
||||
|
||||
`fun <T : PomModelAspect?> getModelAspect(aspect: `[`Class`](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html)`<`[`T`](get-model-aspect.html#T)`>): `[`T`](get-model-aspect.html#T)`?`
|
||||
`fun <T : PomModelAspect?> getModelAspect(aspect: `[`Class`](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html)`<T>): T?`
|
||||
@@ -13,10 +13,10 @@ Licenced under the MIT licence - https://github.com/pinterest/ktlint/blob/master
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `DetektPomModel(project: Project)`<br>Adapted from https://github.com/pinterest/ktlint/blob/master/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/KtLint.kt Licenced under the MIT licence - https://github.com/pinterest/ktlint/blob/master/LICENSE |
|
||||
| [<init>](-init-.html) | Adapted from https://github.com/pinterest/ktlint/blob/master/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/KtLint.kt Licenced under the MIT licence - https://github.com/pinterest/ktlint/blob/master/LICENSE`DetektPomModel(project: Project)` |
|
||||
|
||||
### Functions
|
||||
|
||||
| [getModelAspect](get-model-aspect.html) | `fun <T : PomModelAspect?> getModelAspect(aspect: `[`Class`](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html)`<`[`T`](get-model-aspect.html#T)`>): `[`T`](get-model-aspect.html#T)`?` |
|
||||
| [getModelAspect](get-model-aspect.html) | `fun <T : PomModelAspect?> getModelAspect(aspect: `[`Class`](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html)`<T>): T?` |
|
||||
| [runTransaction](run-transaction.html) | `fun runTransaction(transaction: PomTransaction): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Counts the cyclomatic complexity of functions.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `McCabeVisitor(ignoreSimpleWhenEntries: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)`<br>Counts the cyclomatic complexity of functions. |
|
||||
| [<init>](-init-.html) | Counts the cyclomatic complexity of functions.`McCabeVisitor(ignoreSimpleWhenEntries: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` |
|
||||
|
||||
### Properties
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
title: McCabeVisitor.isInsideObjectLiteral - detekt-api
|
||||
---
|
||||
|
||||
[detekt-api](../../index.html) / [io.gitlab.arturbosch.detekt.api.internal](../index.html) / [McCabeVisitor](index.html) / [isInsideObjectLiteral](./is-inside-object-literal.html)
|
||||
|
||||
# isInsideObjectLiteral
|
||||
|
||||
`fun isInsideObjectLiteral(function: KtNamedFunction): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
|
||||
@@ -6,7 +6,4 @@ title: SimpleNotification.message - detekt-api
|
||||
|
||||
# message
|
||||
|
||||
`val message: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
|
||||
Overrides [Notification.message](../../io.gitlab.arturbosch.detekt.api/-notification/message.html)
|
||||
|
||||
`val message: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
@@ -8,8 +8,8 @@ title: io.gitlab.arturbosch.detekt.api.internal - detekt-api
|
||||
|
||||
### Types
|
||||
|
||||
| [DetektPomModel](-detekt-pom-model/index.html) | `class DetektPomModel : UserDataHolderBase, PomModel`<br>Adapted from https://github.com/pinterest/ktlint/blob/master/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/KtLint.kt Licenced under the MIT licence - https://github.com/pinterest/ktlint/blob/master/LICENSE |
|
||||
| [McCabeVisitor](-mc-cabe-visitor/index.html) | `class McCabeVisitor : `[`DetektVisitor`](../io.gitlab.arturbosch.detekt.api/-detekt-visitor/index.html)<br>Counts the cyclomatic complexity of functions. |
|
||||
| [DetektPomModel](-detekt-pom-model/index.html) | Adapted from https://github.com/pinterest/ktlint/blob/master/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/KtLint.kt Licenced under the MIT licence - https://github.com/pinterest/ktlint/blob/master/LICENSE`class DetektPomModel : UserDataHolderBase, PomModel` |
|
||||
| [McCabeVisitor](-mc-cabe-visitor/index.html) | Counts the cyclomatic complexity of functions.`class McCabeVisitor : `[`DetektVisitor`](../io.gitlab.arturbosch.detekt.api/-detekt-visitor/index.html) |
|
||||
| [PathFilters](-path-filters/index.html) | `class PathFilters` |
|
||||
| [SimpleNotification](-simple-notification/index.html) | `data class SimpleNotification : `[`Notification`](../io.gitlab.arturbosch.detekt.api/-notification/index.html) |
|
||||
|
||||
@@ -27,7 +27,7 @@ title: io.gitlab.arturbosch.detekt.api.internal - detekt-api
|
||||
|
||||
### Functions
|
||||
|
||||
| [createCompilerConfiguration](create-compiler-configuration.html) | `fun createCompilerConfiguration(pathsToAnalyze: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html)`>, classpath: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>, languageVersion: LanguageVersion?, jvmTarget: JvmTarget): CompilerConfiguration`<br>Creates a compiler configuration for the kotlin compiler with all known sources and classpath jars. Be aware that if any path of [pathsToAnalyze](create-compiler-configuration.html#io.gitlab.arturbosch.detekt.api.internal$createCompilerConfiguration(kotlin.collections.List((java.nio.file.Path)), kotlin.collections.List((kotlin.String)), org.jetbrains.kotlin.config.LanguageVersion, org.jetbrains.kotlin.config.JvmTarget)/pathsToAnalyze) is a directory it is scanned for java and kotlin files. |
|
||||
| [createKotlinCoreEnvironment](create-kotlin-core-environment.html) | `fun createKotlinCoreEnvironment(configuration: CompilerConfiguration = CompilerConfiguration()): KotlinCoreEnvironment`<br>Creates an environment instance which can be used to compile source code to KtFile's. This environment also allows to modify the resulting AST files. |
|
||||
| [pathMatcher](path-matcher.html) | `fun pathMatcher(pattern: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`PathMatcher`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/PathMatcher.html)<br>Converts given [pattern](path-matcher.html#io.gitlab.arturbosch.detekt.api.internal$pathMatcher(kotlin.String)/pattern) into a [PathMatcher](https://docs.oracle.com/javase/8/docs/api/java/nio/file/PathMatcher.html) specified by [FileSystem.getPathMatcher](https://docs.oracle.com/javase/8/docs/api/java/nio/file/FileSystem.html#getPathMatcher(java.lang.String)). We only support the "glob:" syntax to stay os independently. Internally a globbing pattern is transformed to a regex respecting the Windows file system. |
|
||||
| [createCompilerConfiguration](create-compiler-configuration.html) | Creates a compiler configuration for the kotlin compiler with all known sources and classpath jars. Be aware that if any path of [pathsToAnalyze](create-compiler-configuration.html#io.gitlab.arturbosch.detekt.api.internal$createCompilerConfiguration(kotlin.collections.List((java.nio.file.Path)), kotlin.collections.List((kotlin.String)), org.jetbrains.kotlin.config.LanguageVersion, org.jetbrains.kotlin.config.JvmTarget)/pathsToAnalyze) is a directory it is scanned for java and kotlin files.`fun createCompilerConfiguration(pathsToAnalyze: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html)`>, classpath: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>, languageVersion: LanguageVersion?, jvmTarget: JvmTarget): CompilerConfiguration` |
|
||||
| [createKotlinCoreEnvironment](create-kotlin-core-environment.html) | Creates an environment instance which can be used to compile source code to KtFile's. This environment also allows to modify the resulting AST files.`fun createKotlinCoreEnvironment(configuration: CompilerConfiguration = CompilerConfiguration()): KotlinCoreEnvironment` |
|
||||
| [pathMatcher](path-matcher.html) | Converts given [pattern](path-matcher.html#io.gitlab.arturbosch.detekt.api.internal$pathMatcher(kotlin.String)/pattern) into a [PathMatcher](https://docs.oracle.com/javase/8/docs/api/java/nio/file/PathMatcher.html) specified by [FileSystem.getPathMatcher](https://docs.oracle.com/javase/8/docs/api/java/nio/file/FileSystem.html#getPathMatcher(java.lang.String)). We only support the "glob:" syntax to stay os independently. Internally a globbing pattern is transformed to a regex respecting the Windows file system.`fun pathMatcher(pattern: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`PathMatcher`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/PathMatcher.html) |
|
||||
|
||||
|
||||
@@ -6,5 +6,5 @@ title: io.gitlab.arturbosch.detekt.api.internal.org.jetbrains.kotlin.psi.KtAnnot
|
||||
|
||||
### Extensions for org.jetbrains.kotlin.psi.KtAnnotated
|
||||
|
||||
| [isSuppressedBy](is-suppressed-by.html) | `fun KtAnnotated.isSuppressedBy(id: `[`RuleId`](../../io.gitlab.arturbosch.detekt.api/-rule-id.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>, ruleSetId: `[`RuleSetId`](../../io.gitlab.arturbosch.detekt.api/-rule-set-id.html)`? = null): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Checks if this kt element is suppressed by @Suppress or @SuppressWarnings annotations. |
|
||||
| [isSuppressedBy](is-suppressed-by.html) | Checks if this kt element is suppressed by @Suppress or @SuppressWarnings annotations.`fun KtAnnotated.isSuppressedBy(id: `[`RuleId`](../../io.gitlab.arturbosch.detekt.api/-rule-id.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>, ruleSetId: `[`RuleSetId`](../../io.gitlab.arturbosch.detekt.api/-rule-set-id.html)`? = null): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
|
||||
|
||||
@@ -6,5 +6,5 @@ title: io.gitlab.arturbosch.detekt.api.internal.org.jetbrains.kotlin.psi.KtEleme
|
||||
|
||||
### Extensions for org.jetbrains.kotlin.psi.KtElement
|
||||
|
||||
| [isSuppressedBy](is-suppressed-by.html) | `fun KtElement.isSuppressedBy(id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>, ruleSetId: `[`RuleSetId`](../../io.gitlab.arturbosch.detekt.api/-rule-set-id.html)`? = null): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Checks if this psi element is suppressed by @Suppress or @SuppressWarnings annotations. If this element cannot have annotations, the first annotative parent is searched. |
|
||||
| [isSuppressedBy](is-suppressed-by.html) | Checks if this psi element is suppressed by @Suppress or @SuppressWarnings annotations. If this element cannot have annotations, the first annotative parent is searched.`fun KtElement.isSuppressedBy(id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>, ruleSetId: `[`RuleSetId`](../../io.gitlab.arturbosch.detekt.api/-rule-set-id.html)`? = null): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ is present over the element.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `AnnotationExcluder(root: KtFile, excludes: `[`SplitPattern`](../-split-pattern/index.html)`)`<br>Primary use case for an AnnotationExcluder is to decide if a KtElement should be excluded from further analysis. This is done by checking if a special annotation is present over the element. |
|
||||
| [<init>](-init-.html) | Primary use case for an AnnotationExcluder is to decide if a KtElement should be excluded from further analysis. This is done by checking if a special annotation is present over the element.`AnnotationExcluder(root: KtFile, excludes: `[`SplitPattern`](../-split-pattern/index.html)`)` |
|
||||
|
||||
### Functions
|
||||
|
||||
| [shouldExclude](should-exclude.html) | `fun shouldExclude(annotations: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<KtAnnotationEntry>): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Is true if any given annotation name is declared in the SplitPattern which basically describes entries to exclude. |
|
||||
| [shouldExclude](should-exclude.html) | Is true if any given annotation name is declared in the SplitPattern which basically describes entries to exclude.`fun shouldExclude(annotations: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<KtAnnotationEntry>): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
|
||||
|
||||
@@ -12,11 +12,7 @@ Convenient base configuration which parses/casts the configuration value based o
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `BaseConfig()`<br>Convenient base configuration which parses/casts the configuration value based on the type of the default value. |
|
||||
|
||||
### Inherited Properties
|
||||
|
||||
| [parent](../-hierarchical-config/parent.html) | `abstract val parent: `[`HierarchicalConfig.Parent`](../-hierarchical-config/-parent/index.html)`?`<br>Returns the parent config which encloses this config part. |
|
||||
| [<init>](-init-.html) | Convenient base configuration which parses/casts the configuration value based on the type of the default value.`BaseConfig()` |
|
||||
|
||||
### Functions
|
||||
|
||||
@@ -25,5 +21,5 @@ Convenient base configuration which parses/casts the configuration value based o
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [YamlConfig](../-yaml-config/index.html) | `class YamlConfig : `[`BaseConfig`](./index.html)<br>Config implementation using the yaml format. SubConfigurations can return sub maps according to the yaml specification. |
|
||||
| [YamlConfig](../-yaml-config/index.html) | Config implementation using the yaml format. SubConfigurations can return sub maps according to the yaml specification.`class YamlConfig : `[`BaseConfig`](./index.html) |
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ detekt core engine to only care about a single type.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `BaseRule(context: `[`Context`](../-context/index.html)` = DefaultContext())`<br>Defines the visiting mechanism for KtFile's. |
|
||||
| [<init>](-init-.html) | Defines the visiting mechanism for KtFile's.`BaseRule(context: `[`Context`](../-context/index.html)` = DefaultContext())` |
|
||||
|
||||
### Properties
|
||||
|
||||
@@ -31,14 +31,14 @@ detekt core engine to only care about a single type.
|
||||
|
||||
### Functions
|
||||
|
||||
| [postVisit](post-visit.html) | `open fun postVisit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Could be overridden by subclasses to specify a behaviour which should be done after visiting kotlin elements. |
|
||||
| [preVisit](pre-visit.html) | `open fun preVisit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Could be overridden by subclasses to specify a behaviour which should be done before visiting kotlin elements. |
|
||||
| [visit](visit.html) | `open fun visit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Init function to start visiting the [KtFile](#). Can be overridden to start a different visiting process. |
|
||||
| [visitCondition](visit-condition.html) | `abstract fun visitCondition(root: KtFile): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Basic mechanism to decide if a rule should run or not. |
|
||||
| [visitFile](visit-file.html) | `fun visitFile(root: KtFile, bindingContext: BindingContext = BindingContext.EMPTY): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Before starting visiting kotlin elements, a check is performed if this rule should be triggered. Pre- and post-visit-hooks are executed before/after the visiting process. BindingContext holds the result of the semantic analysis of the source code by the Kotlin compiler. Rules that rely on symbols and types being resolved can use the BindingContext for this analysis. Note that detekt must receive the correct compile classpath for the code being analyzed otherwise the default value BindingContext.EMPTY will be used and it will not be possible for detekt to resolve types or symbols. |
|
||||
| [postVisit](post-visit.html) | Could be overridden by subclasses to specify a behaviour which should be done after visiting kotlin elements.`open fun postVisit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [preVisit](pre-visit.html) | Could be overridden by subclasses to specify a behaviour which should be done before visiting kotlin elements.`open fun preVisit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [visit](visit.html) | Init function to start visiting the [KtFile](#). Can be overridden to start a different visiting process.`open fun visit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [visitCondition](visit-condition.html) | Basic mechanism to decide if a rule should run or not.`abstract fun visitCondition(root: KtFile): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
| [visitFile](visit-file.html) | Before starting visiting kotlin elements, a check is performed if this rule should be triggered. Pre- and post-visit-hooks are executed before/after the visiting process. BindingContext holds the result of the semantic analysis of the source code by the Kotlin compiler. Rules that rely on symbols and types being resolved can use the BindingContext for this analysis. Note that detekt must receive the correct compile classpath for the code being analyzed otherwise the default value BindingContext.EMPTY will be used and it will not be possible for detekt to resolve types or symbols.`fun visitFile(root: KtFile, bindingContext: BindingContext = BindingContext.EMPTY): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [MultiRule](../-multi-rule/index.html) | `abstract class MultiRule : `[`BaseRule`](./index.html)<br>Composite rule which delegates work to child rules. Can be used to combine different rules which do similar work like scanning the source code line by line to increase performance. |
|
||||
| [Rule](../-rule/index.html) | `abstract class Rule : `[`BaseRule`](./index.html)`, `[`ConfigAware`](../-config-aware/index.html)<br>A rule defines how one specific code structure should look like. If code is found which does not meet this structure, it is considered as harmful regarding maintainability or readability. |
|
||||
| [MultiRule](../-multi-rule/index.html) | Composite rule which delegates work to child rules. Can be used to combine different rules which do similar work like scanning the source code line by line to increase performance.`abstract class MultiRule : `[`BaseRule`](./index.html) |
|
||||
| [Rule](../-rule/index.html) | A rule defines how one specific code structure should look like. If code is found which does not meet this structure, it is considered as harmful regarding maintainability or readability.`abstract class Rule : `[`BaseRule`](./index.html)`, `[`ConfigAware`](../-config-aware/index.html) |
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ title: CodeSmell.compactWithSignature - detekt-api
|
||||
|
||||
`open fun compactWithSignature(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
|
||||
Overrides [Compactable.compactWithSignature](../-compactable/compact-with-signature.html)
|
||||
|
||||
Same as [compact](../-compactable/compact.html) except the content should contain a substring which represents
|
||||
this exact findings via a custom identifier.
|
||||
|
||||
|
||||
@@ -8,7 +8,5 @@ title: CodeSmell.compact - detekt-api
|
||||
|
||||
`open fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
|
||||
Overrides [Compactable.compact](../-compactable/compact.html)
|
||||
|
||||
Contract to format implementing object to a string representation.
|
||||
|
||||
|
||||
@@ -6,7 +6,4 @@ title: CodeSmell.entity - detekt-api
|
||||
|
||||
# entity
|
||||
|
||||
`open val entity: `[`Entity`](../-entity/index.html)
|
||||
|
||||
Overrides [HasEntity.entity](../-has-entity/entity.html)
|
||||
|
||||
`open val entity: `[`Entity`](../-entity/index.html)
|
||||
@@ -6,7 +6,4 @@ title: CodeSmell.id - detekt-api
|
||||
|
||||
# id
|
||||
|
||||
`open val id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
|
||||
Overrides [Finding.id](../-finding/id.html)
|
||||
|
||||
`open val id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
@@ -19,7 +19,7 @@ locations can be stored in additional [Entity](../-entity/index.html)'s.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `CodeSmell(issue: `[`Issue`](../-issue/index.html)`, entity: `[`Entity`](../-entity/index.html)`, message: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, metrics: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Metric`](../-metric/index.html)`> = listOf(), references: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Entity`](../-entity/index.html)`> = listOf())`<br>A code smell indicates any possible design problem inside a program's source code. The type of a code smell is described by an [Issue](../-issue/index.html). |
|
||||
| [<init>](-init-.html) | A code smell indicates any possible design problem inside a program's source code. The type of a code smell is described by an [Issue](../-issue/index.html).`CodeSmell(issue: `[`Issue`](../-issue/index.html)`, entity: `[`Entity`](../-entity/index.html)`, message: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, metrics: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Metric`](../-metric/index.html)`> = listOf(), references: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Entity`](../-entity/index.html)`> = listOf())` |
|
||||
|
||||
### Properties
|
||||
|
||||
@@ -32,13 +32,13 @@ locations can be stored in additional [Entity](../-entity/index.html)'s.
|
||||
|
||||
### Functions
|
||||
|
||||
| [compact](compact.html) | `open fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Contract to format implementing object to a string representation. |
|
||||
| [compactWithSignature](compact-with-signature.html) | `open fun compactWithSignature(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Same as [compact](../-compactable/compact.html) except the content should contain a substring which represents this exact findings via a custom identifier. |
|
||||
| [messageOrDescription](message-or-description.html) | `open fun messageOrDescription(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Explanation why this finding was raised. |
|
||||
| [compact](compact.html) | Contract to format implementing object to a string representation.`open fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [compactWithSignature](compact-with-signature.html) | Same as [compact](../-compactable/compact.html) except the content should contain a substring which represents this exact findings via a custom identifier.`open fun compactWithSignature(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [messageOrDescription](message-or-description.html) | Explanation why this finding was raised.`open fun messageOrDescription(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [toString](to-string.html) | `open fun toString(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [CorrectableCodeSmell](../-correctable-code-smell/index.html) | `open class CorrectableCodeSmell : `[`CodeSmell`](./index.html)<br>Represents a code smell for that can be auto corrected. |
|
||||
| [ThresholdedCodeSmell](../-thresholded-code-smell/index.html) | `open class ThresholdedCodeSmell : `[`CodeSmell`](./index.html)<br>Represents a code smell for which a specific metric can be determined which is responsible for the existence of this rule violation. |
|
||||
| [CorrectableCodeSmell](../-correctable-code-smell/index.html) | Represents a code smell for that can be auto corrected.`open class CorrectableCodeSmell : `[`CodeSmell`](./index.html) |
|
||||
| [ThresholdedCodeSmell](../-thresholded-code-smell/index.html) | Represents a code smell for which a specific metric can be determined which is responsible for the existence of this rule violation.`open class ThresholdedCodeSmell : `[`CodeSmell`](./index.html) |
|
||||
|
||||
|
||||
@@ -6,7 +6,4 @@ title: CodeSmell.issue - detekt-api
|
||||
|
||||
# issue
|
||||
|
||||
`val issue: `[`Issue`](../-issue/index.html)
|
||||
|
||||
Overrides [Finding.issue](../-finding/issue.html)
|
||||
|
||||
`val issue: `[`Issue`](../-issue/index.html)
|
||||
@@ -8,7 +8,5 @@ title: CodeSmell.messageOrDescription - detekt-api
|
||||
|
||||
`open fun messageOrDescription(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
|
||||
Overrides [Finding.messageOrDescription](../-finding/message-or-description.html)
|
||||
|
||||
Explanation why this finding was raised.
|
||||
|
||||
|
||||
@@ -6,7 +6,4 @@ title: CodeSmell.message - detekt-api
|
||||
|
||||
# message
|
||||
|
||||
`open val message: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
|
||||
Overrides [Finding.message](../-finding/message.html)
|
||||
|
||||
`open val message: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
@@ -6,7 +6,4 @@ title: CodeSmell.metrics - detekt-api
|
||||
|
||||
# metrics
|
||||
|
||||
`open val metrics: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Metric`](../-metric/index.html)`>`
|
||||
|
||||
Overrides [HasMetrics.metrics](../-has-metrics/metrics.html)
|
||||
|
||||
`open val metrics: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Metric`](../-metric/index.html)`>`
|
||||
@@ -6,7 +6,4 @@ title: CodeSmell.references - detekt-api
|
||||
|
||||
# references
|
||||
|
||||
`open val references: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Entity`](../-entity/index.html)`>`
|
||||
|
||||
Overrides [Finding.references](../-finding/references.html)
|
||||
|
||||
`open val references: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Entity`](../-entity/index.html)`>`
|
||||
@@ -12,12 +12,12 @@ Provides a compact string representation.
|
||||
|
||||
### Functions
|
||||
|
||||
| [compact](compact.html) | `abstract fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Contract to format implementing object to a string representation. |
|
||||
| [compactWithSignature](compact-with-signature.html) | `open fun compactWithSignature(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Same as [compact](compact.html) except the content should contain a substring which represents this exact findings via a custom identifier. |
|
||||
| [compact](compact.html) | Contract to format implementing object to a string representation.`abstract fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [compactWithSignature](compact-with-signature.html) | Same as [compact](compact.html) except the content should contain a substring which represents this exact findings via a custom identifier.`open fun compactWithSignature(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [Entity](../-entity/index.html) | `data class Entity : `[`Compactable`](./index.html)<br>Stores information about a specific code fragment. |
|
||||
| [Finding](../-finding/index.html) | `interface Finding : `[`Compactable`](./index.html)`, `[`HasEntity`](../-has-entity/index.html)`, `[`HasMetrics`](../-has-metrics/index.html)<br>Base interface of detection findings. Inherits a bunch of useful behaviour from sub interfaces. |
|
||||
| [Location](../-location/index.html) | `data class Location : `[`Compactable`](./index.html)<br>Specifies a position within a source code fragment. |
|
||||
| [Entity](../-entity/index.html) | Stores information about a specific code fragment.`data class Entity : `[`Compactable`](./index.html) |
|
||||
| [Finding](../-finding/index.html) | Base interface of detection findings. Inherits a bunch of useful behaviour from sub interfaces.`interface Finding : `[`Compactable`](./index.html)`, `[`HasEntity`](../-has-entity/index.html)`, `[`HasMetrics`](../-has-metrics/index.html) |
|
||||
| [Location](../-location/index.html) | Specifies a position within a source code fragment.`data class Location : `[`Compactable`](./index.html) |
|
||||
|
||||
|
||||
@@ -12,12 +12,12 @@ Wraps two different configuration which should be considered when retrieving pro
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `CompositeConfig(lookFirst: `[`Config`](../-config/index.html)`, lookSecond: `[`Config`](../-config/index.html)`)`<br>Wraps two different configuration which should be considered when retrieving properties. |
|
||||
| [<init>](-init-.html) | Wraps two different configuration which should be considered when retrieving properties.`CompositeConfig(lookFirst: `[`Config`](../-config/index.html)`, lookSecond: `[`Config`](../-config/index.html)`)` |
|
||||
|
||||
### Functions
|
||||
|
||||
| [subConfig](sub-config.html) | `fun subConfig(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Config`](../-config/index.html)<br>Tries to retrieve part of the configuration based on given key. |
|
||||
| [subConfig](sub-config.html) | Tries to retrieve part of the configuration based on given key.`fun subConfig(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Config`](../-config/index.html) |
|
||||
| [toString](to-string.html) | `fun toString(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [valueOrDefault](value-or-default.html) | `fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: `[`T`](value-or-default.html#T)`): `[`T`](value-or-default.html#T)<br>Retrieves a sub configuration or value based on given key. If configuration property cannot be found the specified default value is returned. |
|
||||
| [valueOrNull](value-or-null.html) | `fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`T`](value-or-null.html#T)`?`<br>Retrieves a sub configuration or value based on given key. If the configuration property cannot be found, null is returned. |
|
||||
| [valueOrDefault](value-or-default.html) | Retrieves a sub configuration or value based on given key. If configuration property cannot be found the specified default value is returned.`fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: T): T` |
|
||||
| [valueOrNull](value-or-null.html) | Retrieves a sub configuration or value based on given key. If the configuration property cannot be found, null is returned.`fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): T?` |
|
||||
|
||||
|
||||
@@ -8,7 +8,5 @@ title: CompositeConfig.subConfig - detekt-api
|
||||
|
||||
`fun subConfig(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Config`](../-config/index.html)
|
||||
|
||||
Overrides [Config.subConfig](../-config/sub-config.html)
|
||||
|
||||
Tries to retrieve part of the configuration based on given key.
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@ title: CompositeConfig.valueOrDefault - detekt-api
|
||||
|
||||
# valueOrDefault
|
||||
|
||||
`fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: `[`T`](value-or-default.html#T)`): `[`T`](value-or-default.html#T)
|
||||
|
||||
Overrides [Config.valueOrDefault](../-config/value-or-default.html)
|
||||
`fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: T): T`
|
||||
|
||||
Retrieves a sub configuration or value based on given key. If configuration property cannot be found
|
||||
the specified default value is returned.
|
||||
|
||||
@@ -6,9 +6,7 @@ title: CompositeConfig.valueOrNull - detekt-api
|
||||
|
||||
# valueOrNull
|
||||
|
||||
`fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`T`](value-or-null.html#T)`?`
|
||||
|
||||
Overrides [Config.valueOrNull](../-config/value-or-null.html)
|
||||
`fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): T?`
|
||||
|
||||
Retrieves a sub configuration or value based on given key.
|
||||
If the configuration property cannot be found, null is returned.
|
||||
|
||||
@@ -25,19 +25,19 @@ be error-prone.
|
||||
|
||||
### Properties
|
||||
|
||||
| [active](active.html) | `open val active: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Is this rule specified as active in configuration? If an rule is not specified in the underlying configuration, we assume it should not be run. |
|
||||
| [autoCorrect](auto-correct.html) | `open val autoCorrect: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Does this rule have auto correct specified in configuration? For auto correction to work the rule set itself enable it. |
|
||||
| [ruleId](rule-id.html) | `abstract val ruleId: `[`RuleId`](../-rule-id.html)<br>Id which is used to retrieve the sub config for the rule implementing this interface. |
|
||||
| [ruleSetConfig](rule-set-config.html) | `abstract val ruleSetConfig: `[`Config`](../-config/index.html)<br>Wrapped configuration of the ruleSet this rule is in. Use #valueOrDefault function to retrieve properties specified for the rule implementing this interface instead. Only use this property directly if you need a specific rule set property. |
|
||||
| [active](active.html) | Is this rule specified as active in configuration? If an rule is not specified in the underlying configuration, we assume it should not be run.`open val active: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
| [autoCorrect](auto-correct.html) | Does this rule have auto correct specified in configuration? For auto correction to work the rule set itself enable it.`open val autoCorrect: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
| [ruleId](rule-id.html) | Id which is used to retrieve the sub config for the rule implementing this interface.`abstract val ruleId: `[`RuleId`](../-rule-id.html) |
|
||||
| [ruleSetConfig](rule-set-config.html) | Wrapped configuration of the ruleSet this rule is in. Use #valueOrDefault function to retrieve properties specified for the rule implementing this interface instead. Only use this property directly if you need a specific rule set property.`abstract val ruleSetConfig: `[`Config`](../-config/index.html) |
|
||||
|
||||
### Functions
|
||||
|
||||
| [subConfig](sub-config.html) | `open fun subConfig(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Config`](../-config/index.html)<br>Tries to retrieve part of the configuration based on given key. |
|
||||
| [valueOrDefault](value-or-default.html) | `open fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: `[`T`](value-or-default.html#T)`): `[`T`](value-or-default.html#T)<br>Retrieves a sub configuration or value based on given key. If configuration property cannot be found the specified default value is returned. |
|
||||
| [valueOrNull](value-or-null.html) | `open fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`T`](value-or-null.html#T)`?`<br>Retrieves a sub configuration or value based on given key. If the configuration property cannot be found, null is returned. |
|
||||
| [withAutoCorrect](with-auto-correct.html) | `open fun withAutoCorrect(block: () -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>If your rule supports to automatically correct the misbehaviour of underlying smell, specify your code inside this method call, to allow the user of your rule to trigger auto correction only when needed. |
|
||||
| [subConfig](sub-config.html) | Tries to retrieve part of the configuration based on given key.`open fun subConfig(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Config`](../-config/index.html) |
|
||||
| [valueOrDefault](value-or-default.html) | Retrieves a sub configuration or value based on given key. If configuration property cannot be found the specified default value is returned.`open fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: T): T` |
|
||||
| [valueOrNull](value-or-null.html) | Retrieves a sub configuration or value based on given key. If the configuration property cannot be found, null is returned.`open fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): T?` |
|
||||
| [withAutoCorrect](with-auto-correct.html) | If your rule supports to automatically correct the misbehaviour of underlying smell, specify your code inside this method call, to allow the user of your rule to trigger auto correction only when needed.`open fun withAutoCorrect(block: () -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [Rule](../-rule/index.html) | `abstract class Rule : `[`BaseRule`](../-base-rule/index.html)`, `[`ConfigAware`](./index.html)<br>A rule defines how one specific code structure should look like. If code is found which does not meet this structure, it is considered as harmful regarding maintainability or readability. |
|
||||
| [Rule](../-rule/index.html) | A rule defines how one specific code structure should look like. If code is found which does not meet this structure, it is considered as harmful regarding maintainability or readability.`abstract class Rule : `[`BaseRule`](../-base-rule/index.html)`, `[`ConfigAware`](./index.html) |
|
||||
|
||||
|
||||
@@ -8,7 +8,5 @@ title: ConfigAware.subConfig - detekt-api
|
||||
|
||||
`open fun subConfig(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Config`](../-config/index.html)
|
||||
|
||||
Overrides [Config.subConfig](../-config/sub-config.html)
|
||||
|
||||
Tries to retrieve part of the configuration based on given key.
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@ title: ConfigAware.valueOrDefault - detekt-api
|
||||
|
||||
# valueOrDefault
|
||||
|
||||
`open fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: `[`T`](value-or-default.html#T)`): `[`T`](value-or-default.html#T)
|
||||
|
||||
Overrides [Config.valueOrDefault](../-config/value-or-default.html)
|
||||
`open fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: T): T`
|
||||
|
||||
Retrieves a sub configuration or value based on given key. If configuration property cannot be found
|
||||
the specified default value is returned.
|
||||
|
||||
@@ -6,9 +6,7 @@ title: ConfigAware.valueOrNull - detekt-api
|
||||
|
||||
# valueOrNull
|
||||
|
||||
`open fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`T`](value-or-null.html#T)`?`
|
||||
|
||||
Overrides [Config.valueOrNull](../-config/value-or-null.html)
|
||||
`open fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): T?`
|
||||
|
||||
Retrieves a sub configuration or value based on given key.
|
||||
If the configuration property cannot be found, null is returned.
|
||||
|
||||
@@ -12,6 +12,6 @@ Is thrown when loading a configuration results in errors.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `InvalidConfigurationError(msg: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` = "Provided configuration file is invalid:" +
|
||||
" Structure must be from type Map<String,Any>!")`<br>Is thrown when loading a configuration results in errors. |
|
||||
| [<init>](-init-.html) | Is thrown when loading a configuration results in errors.`InvalidConfigurationError(msg: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` = "Provided configuration file is invalid:" +
|
||||
" Structure must be from type Map<String,Any>!")` |
|
||||
|
||||
|
||||
@@ -12,25 +12,25 @@ A configuration holds information about how to configure specific rules.
|
||||
|
||||
### Exceptions
|
||||
|
||||
| [InvalidConfigurationError](-invalid-configuration-error/index.html) | `class InvalidConfigurationError : `[`RuntimeException`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-runtime-exception/index.html)<br>Is thrown when loading a configuration results in errors. |
|
||||
| [InvalidConfigurationError](-invalid-configuration-error/index.html) | Is thrown when loading a configuration results in errors.`class InvalidConfigurationError : `[`RuntimeException`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-runtime-exception/index.html) |
|
||||
|
||||
### Functions
|
||||
|
||||
| [subConfig](sub-config.html) | `abstract fun subConfig(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Config`](./index.html)<br>Tries to retrieve part of the configuration based on given key. |
|
||||
| [valueOrDefault](value-or-default.html) | `abstract fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: `[`T`](value-or-default.html#T)`): `[`T`](value-or-default.html#T)<br>Retrieves a sub configuration or value based on given key. If configuration property cannot be found the specified default value is returned. |
|
||||
| [valueOrNull](value-or-null.html) | `abstract fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`T`](value-or-null.html#T)`?`<br>Retrieves a sub configuration or value based on given key. If the configuration property cannot be found, null is returned. |
|
||||
| [subConfig](sub-config.html) | Tries to retrieve part of the configuration based on given key.`abstract fun subConfig(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Config`](./index.html) |
|
||||
| [valueOrDefault](value-or-default.html) | Retrieves a sub configuration or value based on given key. If configuration property cannot be found the specified default value is returned.`abstract fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: T): T` |
|
||||
| [valueOrNull](value-or-null.html) | Retrieves a sub configuration or value based on given key. If the configuration property cannot be found, null is returned.`abstract fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): T?` |
|
||||
|
||||
### Companion Object Properties
|
||||
|
||||
| [ACTIVE_KEY](-a-c-t-i-v-e_-k-e-y.html) | `const val ACTIVE_KEY: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [empty](empty.html) | `val empty: `[`Config`](./index.html)<br>An empty configuration with no properties. This config should only be used in test cases. Always returns the default value except when 'active' is queried, it returns true . |
|
||||
| [empty](empty.html) | An empty configuration with no properties. This config should only be used in test cases. Always returns the default value except when 'active' is queried, it returns true .`val empty: `[`Config`](./index.html) |
|
||||
| [EXCLUDES_KEY](-e-x-c-l-u-d-e-s_-k-e-y.html) | `const val EXCLUDES_KEY: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [INCLUDES_KEY](-i-n-c-l-u-d-e-s_-k-e-y.html) | `const val INCLUDES_KEY: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [PRIMITIVES](-p-r-i-m-i-t-i-v-e-s.html) | `val PRIMITIVES: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`KClass`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-class/index.html)`<out `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`>>` |
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [CompositeConfig](../-composite-config/index.html) | `class CompositeConfig : `[`Config`](./index.html)<br>Wraps two different configuration which should be considered when retrieving properties. |
|
||||
| [ConfigAware](../-config-aware/index.html) | `interface ConfigAware : `[`Config`](./index.html)<br>Interface which is implemented by each Rule class to provide utility functions to retrieve specific or generic properties from the underlying detekt configuration file. |
|
||||
| [HierarchicalConfig](../-hierarchical-config/index.html) | `interface HierarchicalConfig : `[`Config`](./index.html)<br>A configuration which keeps track of the config it got sub-config'ed from by the [subConfig](sub-config.html) function. It's main usage is to recreate the property-path which was taken when using the [subConfig](sub-config.html) function repeatedly. |
|
||||
| [CompositeConfig](../-composite-config/index.html) | Wraps two different configuration which should be considered when retrieving properties.`class CompositeConfig : `[`Config`](./index.html) |
|
||||
| [ConfigAware](../-config-aware/index.html) | Interface which is implemented by each Rule class to provide utility functions to retrieve specific or generic properties from the underlying detekt configuration file.`interface ConfigAware : `[`Config`](./index.html) |
|
||||
| [HierarchicalConfig](../-hierarchical-config/index.html) | A configuration which keeps track of the config it got sub-config'ed from by the [subConfig](sub-config.html) function. It's main usage is to recreate the property-path which was taken when using the [subConfig](sub-config.html) function repeatedly.`interface HierarchicalConfig : `[`Config`](./index.html) |
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ title: Config.valueOrDefault - detekt-api
|
||||
|
||||
# valueOrDefault
|
||||
|
||||
`abstract fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: `[`T`](value-or-default.html#T)`): `[`T`](value-or-default.html#T)
|
||||
`abstract fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: T): T`
|
||||
|
||||
Retrieves a sub configuration or value based on given key. If configuration property cannot be found
|
||||
the specified default value is returned.
|
||||
|
||||
@@ -6,7 +6,7 @@ title: Config.valueOrNull - detekt-api
|
||||
|
||||
# valueOrNull
|
||||
|
||||
`abstract fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`T`](value-or-null.html#T)`?`
|
||||
`abstract fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): T?`
|
||||
|
||||
Retrieves a sub configuration or value based on given key.
|
||||
If the configuration property cannot be found, null is returned.
|
||||
|
||||
@@ -16,19 +16,10 @@ in the 'console-reports' property of a detekt yaml config.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `ConsoleReport()`<br>Extension point which describes how findings should be printed on the console. |
|
||||
|
||||
### Inherited Properties
|
||||
|
||||
| [id](../-extension/id.html) | `open val id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Name of the extension. |
|
||||
| [priority](../-extension/priority.html) | `open val priority: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>Is used to run extensions in a specific order. The higher the priority the sooner the extension will run in detekt's lifecycle. |
|
||||
| [<init>](-init-.html) | Extension point which describes how findings should be printed on the console.`ConsoleReport()` |
|
||||
|
||||
### Functions
|
||||
|
||||
| [print](print.html) | `fun print(printer: `[`PrintStream`](https://docs.oracle.com/javase/8/docs/api/java/io/PrintStream.html)`, detektion: `[`Detektion`](../-detektion/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Prints the rendered report to the given printer if anything was rendered at all. |
|
||||
| [render](render.html) | `abstract fun render(detektion: `[`Detektion`](../-detektion/index.html)`): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`<br>Converts the given [detektion](render.html#io.gitlab.arturbosch.detekt.api.ConsoleReport$render(io.gitlab.arturbosch.detekt.api.Detektion)/detektion) into a string representation to present it to the client. The implementation specifies which parts of the report are important to the user. |
|
||||
|
||||
### Inherited Functions
|
||||
|
||||
| [init](../-extension/init.html) | `open fun init(config: `[`Config`](../-config/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Allows to read any or even user defined properties from the detekt yaml config to setup this extension. |
|
||||
| [print](print.html) | Prints the rendered report to the given printer if anything was rendered at all.`fun print(printer: `[`PrintStream`](https://docs.oracle.com/javase/8/docs/api/java/io/PrintStream.html)`, detektion: `[`Detektion`](../-detektion/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [render](render.html) | Converts the given [detektion](render.html#io.gitlab.arturbosch.detekt.api.ConsoleReport$render(io.gitlab.arturbosch.detekt.api.Detektion)/detektion) into a string representation to present it to the client. The implementation specifies which parts of the report are important to the user.`abstract fun render(detektion: `[`Detektion`](../-detektion/index.html)`): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` |
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ before the next KtFile.
|
||||
|
||||
### Functions
|
||||
|
||||
| [clearFindings](clear-findings.html) | `abstract fun clearFindings(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Clears previous findings. Normally this is done on every new [KtFile](#) analyzed and should be called by clients. |
|
||||
| [report](report.html) | `abstract fun ~~report~~(finding: `[`Finding`](../-finding/index.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`> = emptySet()): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Reports a single new violation.`open fun report(finding: `[`Finding`](../-finding/index.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`> = emptySet(), ruleSetId: `[`RuleSetId`](../-rule-set-id.html)`? = null): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Reports a single new violation. By contract the implementation can check if this finding is already suppressed and should not get reported. An alias set can be given to additionally check if an alias was used when suppressing. Additionally suppression by rule set id is supported.`abstract fun ~~report~~(findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`> = emptySet()): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>`open fun report(findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`> = emptySet(), ruleSetId: `[`RuleSetId`](../-rule-set-id.html)`? = null): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Same as [report](report.html) but reports a list of findings. |
|
||||
| [clearFindings](clear-findings.html) | Clears previous findings. Normally this is done on every new [KtFile](#) analyzed and should be called by clients.`abstract fun clearFindings(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [report](report.html) | Reports a single new violation.`abstract fun ~~report~~(finding: `[`Finding`](../-finding/index.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`> = emptySet()): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Reports a single new violation. By contract the implementation can check if this finding is already suppressed and should not get reported. An alias set can be given to additionally check if an alias was used when suppressing. Additionally suppression by rule set id is supported.`open fun report(finding: `[`Finding`](../-finding/index.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`> = emptySet(), ruleSetId: `[`RuleSetId`](../-rule-set-id.html)`? = null): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Same as [report](report.html) but reports a list of findings.`abstract fun ~~report~~(findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`> = emptySet()): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>`open fun report(findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`> = emptySet(), ruleSetId: `[`RuleSetId`](../-rule-set-id.html)`? = null): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [BaseRule](../-base-rule/index.html) | `abstract class BaseRule : `[`DetektVisitor`](../-detekt-visitor/index.html)`, `[`Context`](./index.html)<br>Defines the visiting mechanism for KtFile's. |
|
||||
| [DefaultContext](../-default-context/index.html) | `open class DefaultContext : `[`Context`](./index.html)<br>Default [Context](./index.html) implementation. |
|
||||
| [BaseRule](../-base-rule/index.html) | Defines the visiting mechanism for KtFile's.`abstract class BaseRule : `[`DetektVisitor`](../-detekt-visitor/index.html)`, `[`Context`](./index.html) |
|
||||
| [DefaultContext](../-default-context/index.html) | Default [Context](./index.html) implementation.`open class DefaultContext : `[`Context`](./index.html) |
|
||||
|
||||
|
||||
@@ -16,28 +16,13 @@ Represents a code smell for that can be auto corrected.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `CorrectableCodeSmell(issue: `[`Issue`](../-issue/index.html)`, entity: `[`Entity`](../-entity/index.html)`, message: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, metrics: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Metric`](../-metric/index.html)`> = listOf(), references: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Entity`](../-entity/index.html)`> = listOf(), autoCorrectEnabled: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)`<br>Represents a code smell for that can be auto corrected. |
|
||||
| [<init>](-init-.html) | Represents a code smell for that can be auto corrected.`CorrectableCodeSmell(issue: `[`Issue`](../-issue/index.html)`, entity: `[`Entity`](../-entity/index.html)`, message: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, metrics: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Metric`](../-metric/index.html)`> = listOf(), references: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Entity`](../-entity/index.html)`> = listOf(), autoCorrectEnabled: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` |
|
||||
|
||||
### Properties
|
||||
|
||||
| [autoCorrectEnabled](auto-correct-enabled.html) | `val autoCorrectEnabled: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
|
||||
### Inherited Properties
|
||||
|
||||
| [entity](../-code-smell/entity.html) | `open val entity: `[`Entity`](../-entity/index.html) |
|
||||
| [id](../-code-smell/id.html) | `open val id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [issue](../-code-smell/issue.html) | `val issue: `[`Issue`](../-issue/index.html) |
|
||||
| [message](../-code-smell/message.html) | `open val message: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [metrics](../-code-smell/metrics.html) | `open val metrics: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Metric`](../-metric/index.html)`>` |
|
||||
| [references](../-code-smell/references.html) | `open val references: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Entity`](../-entity/index.html)`>` |
|
||||
|
||||
### Functions
|
||||
|
||||
| [toString](to-string.html) | `open fun toString(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
|
||||
### Inherited Functions
|
||||
|
||||
| [compact](../-code-smell/compact.html) | `open fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Contract to format implementing object to a string representation. |
|
||||
| [compactWithSignature](../-code-smell/compact-with-signature.html) | `open fun compactWithSignature(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Same as [compact](../-compactable/compact.html) except the content should contain a substring which represents this exact findings via a custom identifier. |
|
||||
| [messageOrDescription](../-code-smell/message-or-description.html) | `open fun messageOrDescription(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Explanation why this finding was raised. |
|
||||
|
||||
|
||||
@@ -6,7 +6,4 @@ title: CorrectableCodeSmell.toString - detekt-api
|
||||
|
||||
# toString
|
||||
|
||||
`open fun toString(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
|
||||
Overrides [CodeSmell.toString](../-code-smell/to-string.html)
|
||||
|
||||
`open fun toString(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
@@ -12,7 +12,7 @@ Debt describes the estimated amount of work needed to fix a given issue.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `Debt(days: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0, hours: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0, mins: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0)`<br>Debt describes the estimated amount of work needed to fix a given issue. |
|
||||
| [<init>](-init-.html) | Debt describes the estimated amount of work needed to fix a given issue.`Debt(days: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0, hours: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0, mins: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0)` |
|
||||
|
||||
### Properties
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ title: DefaultContext.clearFindings - detekt-api
|
||||
|
||||
`fun clearFindings(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
|
||||
Overrides [Context.clearFindings](../-context/clear-findings.html)
|
||||
|
||||
Clears previous findings.
|
||||
Normally this is done on every new [KtFile](#) analyzed and should be called by clients.
|
||||
|
||||
|
||||
@@ -8,7 +8,5 @@ title: DefaultContext.findings - detekt-api
|
||||
|
||||
`open val findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>`
|
||||
|
||||
Overrides [Context.findings](../-context/findings.html)
|
||||
|
||||
Returns a copy of violations for this rule.
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@ Default [Context](../-context/index.html) implementation.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `DefaultContext()`<br>Default [Context](../-context/index.html) implementation. |
|
||||
| [<init>](-init-.html) | Default [Context](../-context/index.html) implementation.`DefaultContext()` |
|
||||
|
||||
### Properties
|
||||
|
||||
| [findings](findings.html) | `open val findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>`<br>Returns a copy of violations for this rule. |
|
||||
| [findings](findings.html) | Returns a copy of violations for this rule.`open val findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>` |
|
||||
|
||||
### Functions
|
||||
|
||||
| [clearFindings](clear-findings.html) | `fun clearFindings(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Clears previous findings. Normally this is done on every new [KtFile](#) analyzed and should be called by clients. |
|
||||
| [report](report.html) | `open fun report(finding: `[`Finding`](../-finding/index.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>, ruleSetId: `[`RuleSetId`](../-rule-set-id.html)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Reports a single code smell finding.`open fun report(findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>, ruleSetId: `[`RuleSetId`](../-rule-set-id.html)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Reports a list of code smell findings.`open fun report(finding: `[`Finding`](../-finding/index.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Reports a single new violation.`open fun report(findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Same as [report](../-context/report.html) but reports a list of findings. |
|
||||
| [clearFindings](clear-findings.html) | Clears previous findings. Normally this is done on every new [KtFile](#) analyzed and should be called by clients.`fun clearFindings(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [report](report.html) | Reports a single code smell finding.`open fun report(finding: `[`Finding`](../-finding/index.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>, ruleSetId: `[`RuleSetId`](../-rule-set-id.html)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Reports a list of code smell findings.`open fun report(findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>, ruleSetId: `[`RuleSetId`](../-rule-set-id.html)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Reports a single new violation.`open fun report(finding: `[`Finding`](../-finding/index.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Same as [report](../-context/report.html) but reports a list of findings.`open fun report(findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ title: DefaultContext.report - detekt-api
|
||||
|
||||
`open fun report(finding: `[`Finding`](../-finding/index.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>, ruleSetId: `[`RuleSetId`](../-rule-set-id.html)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
|
||||
Overrides [Context.report](../-context/report.html)
|
||||
|
||||
Reports a single code smell finding.
|
||||
|
||||
Before adding a finding, it is checked if it is not suppressed
|
||||
@@ -17,8 +15,6 @@ by @Suppress or @SuppressWarnings annotations.
|
||||
|
||||
`open fun report(findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>, ruleSetId: `[`RuleSetId`](../-rule-set-id.html)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
|
||||
Overrides [Context.report](../-context/report.html)
|
||||
|
||||
Reports a list of code smell findings.
|
||||
|
||||
Before adding a finding, it is checked if it is not suppressed
|
||||
@@ -26,13 +22,9 @@ by @Suppress or @SuppressWarnings annotations.
|
||||
|
||||
`open fun report(finding: `[`Finding`](../-finding/index.html)`, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
|
||||
Overrides [Context.report](../-context/report.html)
|
||||
|
||||
Reports a single new violation.
|
||||
|
||||
`open fun report(findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>, aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
|
||||
Overrides [Context.report](../-context/report.html)
|
||||
|
||||
Same as [report](../-context/report.html) but reports a list of findings.
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ Guarantees a better looking name as the extended base class :).
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `DetektVisitor()`<br>Basic visitor which is used inside detekt. Guarantees a better looking name as the extended base class :). |
|
||||
| [<init>](-init-.html) | Basic visitor which is used inside detekt. Guarantees a better looking name as the extended base class :).`DetektVisitor()` |
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [BaseRule](../-base-rule/index.html) | `abstract class BaseRule : `[`DetektVisitor`](./index.html)`, `[`Context`](../-context/index.html)<br>Defines the visiting mechanism for KtFile's. |
|
||||
| [McCabeVisitor](../../io.gitlab.arturbosch.detekt.api.internal/-mc-cabe-visitor/index.html) | `class McCabeVisitor : `[`DetektVisitor`](./index.html)<br>Counts the cyclomatic complexity of functions. |
|
||||
| [BaseRule](../-base-rule/index.html) | Defines the visiting mechanism for KtFile's.`abstract class BaseRule : `[`DetektVisitor`](./index.html)`, `[`Context`](../-context/index.html) |
|
||||
| [McCabeVisitor](../../io.gitlab.arturbosch.detekt.api.internal/-mc-cabe-visitor/index.html) | Counts the cyclomatic complexity of functions.`class McCabeVisitor : `[`DetektVisitor`](./index.html) |
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ title: Detektion.addData - detekt-api
|
||||
|
||||
# addData
|
||||
|
||||
`abstract fun <V> addData(key: Key<`[`V`](add-data.html#V)`>, value: `[`V`](add-data.html#V)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
`abstract fun <V> addData(key: Key<V>, value: V): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
|
||||
Stores an arbitrary value inside the result binded to the given key.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ title: Detektion.getData - detekt-api
|
||||
|
||||
# getData
|
||||
|
||||
`abstract fun <V> getData(key: Key<`[`V`](get-data.html#V)`>): `[`V`](get-data.html#V)`?`
|
||||
`abstract fun <V> getData(key: Key<V>): V?`
|
||||
|
||||
Retrieves a value stored by the given key of the result.
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ which needs to be transferred from the detekt engine to the user.
|
||||
|
||||
### Functions
|
||||
|
||||
| [add](add.html) | `abstract fun add(notification: `[`Notification`](../-notification/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Stores a notification in the result.`abstract fun add(projectMetric: `[`ProjectMetric`](../-project-metric/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Stores a metric calculated for the whole project in the result. |
|
||||
| [addData](add-data.html) | `abstract fun <V> addData(key: Key<`[`V`](add-data.html#V)`>, value: `[`V`](add-data.html#V)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Stores an arbitrary value inside the result binded to the given key. |
|
||||
| [getData](get-data.html) | `abstract fun <V> getData(key: Key<`[`V`](get-data.html#V)`>): `[`V`](get-data.html#V)`?`<br>Retrieves a value stored by the given key of the result. |
|
||||
| [add](add.html) | Stores a notification in the result.`abstract fun add(notification: `[`Notification`](../-notification/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Stores a metric calculated for the whole project in the result.`abstract fun add(projectMetric: `[`ProjectMetric`](../-project-metric/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [addData](add-data.html) | Stores an arbitrary value inside the result binded to the given key.`abstract fun <V> addData(key: Key<V>, value: V): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [getData](get-data.html) | Retrieves a value stored by the given key of the result.`abstract fun <V> getData(key: Key<V>): V?` |
|
||||
|
||||
|
||||
@@ -8,7 +8,5 @@ title: Entity.compact - detekt-api
|
||||
|
||||
`fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
|
||||
Overrides [Compactable.compact](../-compactable/compact.html)
|
||||
|
||||
Contract to format implementing object to a string representation.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Stores information about a specific code fragment.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `Entity(name: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, className: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, signature: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, location: `[`Location`](../-location/index.html)`, ktElement: KtElement? = null)`<br>Stores information about a specific code fragment. |
|
||||
| [<init>](-init-.html) | Stores information about a specific code fragment.`Entity(name: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, className: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, signature: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, location: `[`Location`](../-location/index.html)`, ktElement: KtElement? = null)` |
|
||||
|
||||
### Properties
|
||||
|
||||
@@ -24,13 +24,9 @@ Stores information about a specific code fragment.
|
||||
|
||||
### Functions
|
||||
|
||||
| [compact](compact.html) | `fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Contract to format implementing object to a string representation. |
|
||||
|
||||
### Inherited Functions
|
||||
|
||||
| [compactWithSignature](../-compactable/compact-with-signature.html) | `open fun compactWithSignature(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Same as [compact](../-compactable/compact.html) except the content should contain a substring which represents this exact findings via a custom identifier. |
|
||||
| [compact](compact.html) | Contract to format implementing object to a string representation.`fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
|
||||
### Companion Object Functions
|
||||
|
||||
| [from](from.html) | `fun from(element: PsiElement, offset: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0): `[`Entity`](./index.html)<br>Factory function which retrieves all needed information from the PsiElement itself. |
|
||||
| [from](from.html) | Factory function which retrieves all needed information from the PsiElement itself.`fun from(element: PsiElement, offset: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0): `[`Entity`](./index.html) |
|
||||
|
||||
|
||||
@@ -17,16 +17,16 @@ Currently supported extensions are:
|
||||
|
||||
### Properties
|
||||
|
||||
| [id](id.html) | `open val id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Name of the extension. |
|
||||
| [priority](priority.html) | `open val priority: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>Is used to run extensions in a specific order. The higher the priority the sooner the extension will run in detekt's lifecycle. |
|
||||
| [id](id.html) | Name of the extension.`open val id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [priority](priority.html) | Is used to run extensions in a specific order. The higher the priority the sooner the extension will run in detekt's lifecycle.`open val priority: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) |
|
||||
|
||||
### Functions
|
||||
|
||||
| [init](init.html) | `open fun init(config: `[`Config`](../-config/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Allows to read any or even user defined properties from the detekt yaml config to setup this extension. |
|
||||
| [init](init.html) | Allows to read any or even user defined properties from the detekt yaml config to setup this extension.`open fun init(config: `[`Config`](../-config/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [ConsoleReport](../-console-report/index.html) | `abstract class ConsoleReport : `[`Extension`](./index.html)<br>Extension point which describes how findings should be printed on the console. |
|
||||
| [FileProcessListener](../-file-process-listener/index.html) | `interface FileProcessListener : `[`Extension`](./index.html)<br>Gather additional metrics about the analyzed kotlin file. Pay attention to the thread policy of each function! |
|
||||
| [OutputReport](../-output-report/index.html) | `abstract class OutputReport : `[`Extension`](./index.html)<br>Translates detekt's result container - [Detektion](../-detektion/index.html) - into an output report which is written inside a file. |
|
||||
| [ConsoleReport](../-console-report/index.html) | Extension point which describes how findings should be printed on the console.`abstract class ConsoleReport : `[`Extension`](./index.html) |
|
||||
| [FileProcessListener](../-file-process-listener/index.html) | Gather additional metrics about the analyzed kotlin file. Pay attention to the thread policy of each function!`interface FileProcessListener : `[`Extension`](./index.html) |
|
||||
| [OutputReport](../-output-report/index.html) | Translates detekt's result container - [Detektion](../-detektion/index.html) - into an output report which is written inside a file.`abstract class OutputReport : `[`Extension`](./index.html) |
|
||||
|
||||
|
||||
@@ -11,19 +11,10 @@ title: FileProcessListener - detekt-api
|
||||
Gather additional metrics about the analyzed kotlin file.
|
||||
Pay attention to the thread policy of each function!
|
||||
|
||||
### Inherited Properties
|
||||
|
||||
| [id](../-extension/id.html) | `open val id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Name of the extension. |
|
||||
| [priority](../-extension/priority.html) | `open val priority: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>Is used to run extensions in a specific order. The higher the priority the sooner the extension will run in detekt's lifecycle. |
|
||||
|
||||
### Functions
|
||||
|
||||
| [onFinish](on-finish.html) | `open fun onFinish(files: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<KtFile>, result: `[`Detektion`](../-detektion/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Mainly use this method to save computed metrics from KtFile's to the {@link Detektion} container. Do not do heavy computations here as this method is called from the main thread. |
|
||||
| [onProcess](on-process.html) | `open fun onProcess(file: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Called when processing of a file begins. This method is called from a thread pool thread. Heavy computations allowed. |
|
||||
| [onProcessComplete](on-process-complete.html) | `open fun onProcessComplete(file: KtFile, findings: `[`Map`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Called when processing of a file completes. This method is called from a thread pool thread. Heavy computations allowed. |
|
||||
| [onStart](on-start.html) | `open fun onStart(files: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<KtFile>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Use this to gather some additional information for the real onProcess function. This calculation should be lightweight as this method is called from the main thread. |
|
||||
|
||||
### Inherited Functions
|
||||
|
||||
| [init](../-extension/init.html) | `open fun init(config: `[`Config`](../-config/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Allows to read any or even user defined properties from the detekt yaml config to setup this extension. |
|
||||
| [onFinish](on-finish.html) | Mainly use this method to save computed metrics from KtFile's to the {@link Detektion} container. Do not do heavy computations here as this method is called from the main thread.`open fun onFinish(files: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<KtFile>, result: `[`Detektion`](../-detektion/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [onProcess](on-process.html) | Called when processing of a file begins. This method is called from a thread pool thread. Heavy computations allowed.`open fun onProcess(file: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [onProcessComplete](on-process-complete.html) | Called when processing of a file completes. This method is called from a thread pool thread. Heavy computations allowed.`open fun onProcessComplete(file: KtFile, findings: `[`Map`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [onStart](on-start.html) | Use this to gather some additional information for the real onProcess function. This calculation should be lightweight as this method is called from the main thread.`open fun onStart(files: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<KtFile>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
|
||||
|
||||
@@ -21,30 +21,11 @@ an entity. Metrics and entity references can also considered for deeper characte
|
||||
| [message](message.html) | `abstract val message: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [references](references.html) | `abstract val references: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Entity`](../-entity/index.html)`>` |
|
||||
|
||||
### Inherited Properties
|
||||
|
||||
| [charPosition](../-has-entity/char-position.html) | `open val charPosition: `[`TextLocation`](../-text-location/index.html) |
|
||||
| [entity](../-has-entity/entity.html) | `abstract val entity: `[`Entity`](../-entity/index.html) |
|
||||
| [file](../-has-entity/file.html) | `open val file: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [inClass](../-has-entity/in-class.html) | `open val inClass: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [location](../-has-entity/location.html) | `open val location: `[`Location`](../-location/index.html) |
|
||||
| [locationAsString](../-has-entity/location-as-string.html) | `open val locationAsString: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [metrics](../-has-metrics/metrics.html) | `abstract val metrics: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Metric`](../-metric/index.html)`>` |
|
||||
| [name](../-has-entity/name.html) | `open val name: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [signature](../-has-entity/signature.html) | `open val signature: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [startPosition](../-has-entity/start-position.html) | `open val startPosition: `[`SourceLocation`](../-source-location/index.html) |
|
||||
|
||||
### Functions
|
||||
|
||||
| [messageOrDescription](message-or-description.html) | `abstract fun messageOrDescription(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Explanation why this finding was raised. |
|
||||
|
||||
### Inherited Functions
|
||||
|
||||
| [compact](../-compactable/compact.html) | `abstract fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Contract to format implementing object to a string representation. |
|
||||
| [compactWithSignature](../-compactable/compact-with-signature.html) | `open fun compactWithSignature(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Same as [compact](../-compactable/compact.html) except the content should contain a substring which represents this exact findings via a custom identifier. |
|
||||
| [metricByType](../-has-metrics/metric-by-type.html) | `open fun metricByType(type: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Metric`](../-metric/index.html)`?`<br>Finds the first metric matching given [type](../-has-metrics/metric-by-type.html#io.gitlab.arturbosch.detekt.api.HasMetrics$metricByType(kotlin.String)/type). |
|
||||
| [messageOrDescription](message-or-description.html) | Explanation why this finding was raised.`abstract fun messageOrDescription(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [CodeSmell](../-code-smell/index.html) | `open class CodeSmell : `[`Finding`](./index.html)<br>A code smell indicates any possible design problem inside a program's source code. The type of a code smell is described by an [Issue](../-issue/index.html). |
|
||||
| [CodeSmell](../-code-smell/index.html) | A code smell indicates any possible design problem inside a program's source code. The type of a code smell is described by an [Issue](../-issue/index.html).`open class CodeSmell : `[`Finding`](./index.html) |
|
||||
|
||||
|
||||
@@ -24,5 +24,5 @@ Describes a source code position.
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [Finding](../-finding/index.html) | `interface Finding : `[`Compactable`](../-compactable/index.html)`, `[`HasEntity`](./index.html)`, `[`HasMetrics`](../-has-metrics/index.html)<br>Base interface of detection findings. Inherits a bunch of useful behaviour from sub interfaces. |
|
||||
| [Finding](../-finding/index.html) | Base interface of detection findings. Inherits a bunch of useful behaviour from sub interfaces.`interface Finding : `[`Compactable`](../-compactable/index.html)`, `[`HasEntity`](./index.html)`, `[`HasMetrics`](../-has-metrics/index.html) |
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ Adds metric container behaviour.
|
||||
|
||||
### Functions
|
||||
|
||||
| [metricByType](metric-by-type.html) | `open fun metricByType(type: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Metric`](../-metric/index.html)`?`<br>Finds the first metric matching given [type](metric-by-type.html#io.gitlab.arturbosch.detekt.api.HasMetrics$metricByType(kotlin.String)/type). |
|
||||
| [metricByType](metric-by-type.html) | Finds the first metric matching given [type](metric-by-type.html#io.gitlab.arturbosch.detekt.api.HasMetrics$metricByType(kotlin.String)/type).`open fun metricByType(type: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Metric`](../-metric/index.html)`?` |
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [Finding](../-finding/index.html) | `interface Finding : `[`Compactable`](../-compactable/index.html)`, `[`HasEntity`](../-has-entity/index.html)`, `[`HasMetrics`](./index.html)<br>Base interface of detection findings. Inherits a bunch of useful behaviour from sub interfaces. |
|
||||
| [Finding](../-finding/index.html) | Base interface of detection findings. Inherits a bunch of useful behaviour from sub interfaces.`interface Finding : `[`Compactable`](../-compactable/index.html)`, `[`HasEntity`](../-has-entity/index.html)`, `[`HasMetrics`](./index.html) |
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Keeps track of which key was taken to [subConfig](../../-config/sub-config.html)
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `Parent(config: `[`Config`](../../-config/index.html)`, key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)`<br>Keeps track of which key was taken to [subConfig](../../-config/sub-config.html) this configuration. |
|
||||
| [<init>](-init-.html) | Keeps track of which key was taken to [subConfig](../../-config/sub-config.html) this configuration.`Parent(config: `[`Config`](../../-config/index.html)`, key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` |
|
||||
|
||||
### Properties
|
||||
|
||||
|
||||
@@ -13,19 +13,13 @@ It's main usage is to recreate the property-path which was taken when using the
|
||||
|
||||
### Types
|
||||
|
||||
| [Parent](-parent/index.html) | `data class Parent`<br>Keeps track of which key was taken to [subConfig](../-config/sub-config.html) this configuration. |
|
||||
| [Parent](-parent/index.html) | Keeps track of which key was taken to [subConfig](../-config/sub-config.html) this configuration.`data class Parent` |
|
||||
|
||||
### Properties
|
||||
|
||||
| [parent](parent.html) | `abstract val parent: `[`HierarchicalConfig.Parent`](-parent/index.html)`?`<br>Returns the parent config which encloses this config part. |
|
||||
|
||||
### Inherited Functions
|
||||
|
||||
| [subConfig](../-config/sub-config.html) | `abstract fun subConfig(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Config`](../-config/index.html)<br>Tries to retrieve part of the configuration based on given key. |
|
||||
| [valueOrDefault](../-config/value-or-default.html) | `abstract fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: `[`T`](../-config/value-or-default.html#T)`): `[`T`](../-config/value-or-default.html#T)<br>Retrieves a sub configuration or value based on given key. If configuration property cannot be found the specified default value is returned. |
|
||||
| [valueOrNull](../-config/value-or-null.html) | `abstract fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`T`](../-config/value-or-null.html#T)`?`<br>Retrieves a sub configuration or value based on given key. If the configuration property cannot be found, null is returned. |
|
||||
| [parent](parent.html) | Returns the parent config which encloses this config part.`abstract val parent: Parent?` |
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [BaseConfig](../-base-config/index.html) | `abstract class BaseConfig : `[`HierarchicalConfig`](./index.html)<br>Convenient base configuration which parses/casts the configuration value based on the type of the default value. |
|
||||
| [BaseConfig](../-base-config/index.html) | Convenient base configuration which parses/casts the configuration value based on the type of the default value.`abstract class BaseConfig : `[`HierarchicalConfig`](./index.html) |
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ title: HierarchicalConfig.parent - detekt-api
|
||||
|
||||
# parent
|
||||
|
||||
`abstract val parent: `[`HierarchicalConfig.Parent`](-parent/index.html)`?`
|
||||
`abstract val parent: Parent?`
|
||||
|
||||
Returns the parent config which encloses this config part.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ An issue represents a problem in the codebase.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `Issue(id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, severity: `[`Severity`](../-severity/index.html)`, description: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, debt: `[`Debt`](../-debt/index.html)`)`<br>An issue represents a problem in the codebase. |
|
||||
| [<init>](-init-.html) | An issue represents a problem in the codebase.`Issue(id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, severity: `[`Severity`](../-severity/index.html)`, description: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, debt: `[`Debt`](../-debt/index.html)`)` |
|
||||
|
||||
### Properties
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ value when requested again.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `LazyRegex(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)`<br>LazyRegex class provides a lazy evaluation of a Regex pattern for usages inside Rules. It computes the value once when reaching the point of its usage and returns the same value when requested again. |
|
||||
| [<init>](-init-.html) | LazyRegex class provides a lazy evaluation of a Regex pattern for usages inside Rules. It computes the value once when reaching the point of its usage and returns the same value when requested again.`LazyRegex(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` |
|
||||
|
||||
### Functions
|
||||
|
||||
|
||||
@@ -8,7 +8,5 @@ title: Location.compact - detekt-api
|
||||
|
||||
`fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
|
||||
Overrides [Compactable.compact](../-compactable/compact.html)
|
||||
|
||||
Contract to format implementing object to a string representation.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Specifies a position within a source code fragment.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `Location(source: `[`SourceLocation`](../-source-location/index.html)`, text: `[`TextLocation`](../-text-location/index.html)`, locationString: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, file: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)`<br>Specifies a position within a source code fragment. |
|
||||
| [<init>](-init-.html) | Specifies a position within a source code fragment.`Location(source: `[`SourceLocation`](../-source-location/index.html)`, text: `[`TextLocation`](../-text-location/index.html)`, locationString: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, file: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` |
|
||||
|
||||
### Properties
|
||||
|
||||
@@ -23,14 +23,10 @@ Specifies a position within a source code fragment.
|
||||
|
||||
### Functions
|
||||
|
||||
| [compact](compact.html) | `fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Contract to format implementing object to a string representation. |
|
||||
|
||||
### Inherited Functions
|
||||
|
||||
| [compactWithSignature](../-compactable/compact-with-signature.html) | `open fun compactWithSignature(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Same as [compact](../-compactable/compact.html) except the content should contain a substring which represents this exact findings via a custom identifier. |
|
||||
| [compact](compact.html) | Contract to format implementing object to a string representation.`fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
|
||||
### Companion Object Functions
|
||||
|
||||
| [from](from.html) | `fun from(element: PsiElement, offset: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0): `[`Location`](./index.html)<br>Creates a [Location](./index.html) from a [PsiElement](#). If the element can't be determined, the [KtFile](#) with a character offset can be used. |
|
||||
| [startLineAndColumn](start-line-and-column.html) | `fun startLineAndColumn(element: PsiElement, offset: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0): LineAndColumn`<br>Determines the line and column of a [PsiElement](#) in the source file. |
|
||||
| [from](from.html) | Creates a [Location](./index.html) from a [PsiElement](#). If the element can't be determined, the [KtFile](#) with a character offset can be used.`fun from(element: PsiElement, offset: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0): `[`Location`](./index.html) |
|
||||
| [startLineAndColumn](start-line-and-column.html) | Determines the line and column of a [PsiElement](#) in the source file.`fun startLineAndColumn(element: PsiElement, offset: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0): LineAndColumn` |
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ but the conversion factor and is double attributes can be used to retrieve it as
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `Metric(type: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, value: `[`Double`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`, threshold: `[`Double`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`, conversionFactor: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = DEFAULT_FLOAT_CONVERSION_FACTOR)``Metric(type: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, value: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, threshold: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, isDouble: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = false, conversionFactor: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = DEFAULT_FLOAT_CONVERSION_FACTOR)`<br>Metric type, can be an integer or double value. Internally it is stored as an integer, but the conversion factor and is double attributes can be used to retrieve it as a double value. |
|
||||
| [<init>](-init-.html) | `Metric(type: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, value: `[`Double`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`, threshold: `[`Double`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`, conversionFactor: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = DEFAULT_FLOAT_CONVERSION_FACTOR)`<br>Metric type, can be an integer or double value. Internally it is stored as an integer, but the conversion factor and is double attributes can be used to retrieve it as a double value.`Metric(type: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, value: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, threshold: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, isDouble: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = false, conversionFactor: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = DEFAULT_FLOAT_CONVERSION_FACTOR)` |
|
||||
|
||||
### Properties
|
||||
|
||||
@@ -25,7 +25,7 @@ but the conversion factor and is double attributes can be used to retrieve it as
|
||||
|
||||
### Functions
|
||||
|
||||
| [doubleThreshold](double-threshold.html) | `fun doubleThreshold(): `[`Double`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)<br>Specified threshold for this metric as a double value. |
|
||||
| [doubleValue](double-value.html) | `fun doubleValue(): `[`Double`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)<br>Convenient method to retrieve the raised value as a double. Internally the value is stored as an int with a conversion factor to not loose any precision in calculations. |
|
||||
| [doubleThreshold](double-threshold.html) | Specified threshold for this metric as a double value.`fun doubleThreshold(): `[`Double`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html) |
|
||||
| [doubleValue](double-value.html) | Convenient method to retrieve the raised value as a double. Internally the value is stored as an int with a conversion factor to not loose any precision in calculations.`fun doubleValue(): `[`Double`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html) |
|
||||
| [toString](to-string.html) | `fun toString(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
|
||||
|
||||
@@ -14,28 +14,17 @@ scanning the source code line by line to increase performance.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `MultiRule()`<br>Composite rule which delegates work to child rules. Can be used to combine different rules which do similar work like scanning the source code line by line to increase performance. |
|
||||
| [<init>](-init-.html) | Composite rule which delegates work to child rules. Can be used to combine different rules which do similar work like scanning the source code line by line to increase performance.`MultiRule()` |
|
||||
|
||||
### Properties
|
||||
|
||||
| [activeRules](active-rules.html) | `var activeRules: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`Rule`](../-rule/index.html)`>` |
|
||||
| [rules](rules.html) | `abstract val rules: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Rule`](../-rule/index.html)`>` |
|
||||
|
||||
### Inherited Properties
|
||||
|
||||
| [bindingContext](../-base-rule/binding-context.html) | `var bindingContext: BindingContext` |
|
||||
| [context](../-base-rule/context.html) | `val context: `[`Context`](../-context/index.html) |
|
||||
| [ruleId](../-base-rule/rule-id.html) | `open val ruleId: `[`RuleId`](../-rule-id.html) |
|
||||
|
||||
### Functions
|
||||
|
||||
| [postVisit](post-visit.html) | `open fun postVisit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Could be overridden by subclasses to specify a behaviour which should be done after visiting kotlin elements. |
|
||||
| [preVisit](pre-visit.html) | `open fun preVisit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Could be overridden by subclasses to specify a behaviour which should be done before visiting kotlin elements. |
|
||||
| [runIfActive](run-if-active.html) | `fun <T : `[`Rule`](../-rule/index.html)`> `[`T`](run-if-active.html#T)`.runIfActive(block: `[`T`](run-if-active.html#T)`.() -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Preferred way to run child rules because this composite rule takes care of evaluating if a specific child should be run at all. |
|
||||
| [visitCondition](visit-condition.html) | `open fun visitCondition(root: KtFile): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Basic mechanism to decide if a rule should run or not. |
|
||||
|
||||
### Inherited Functions
|
||||
|
||||
| [visit](../-base-rule/visit.html) | `open fun visit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Init function to start visiting the [KtFile](#). Can be overridden to start a different visiting process. |
|
||||
| [visitFile](../-base-rule/visit-file.html) | `fun visitFile(root: KtFile, bindingContext: BindingContext = BindingContext.EMPTY): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Before starting visiting kotlin elements, a check is performed if this rule should be triggered. Pre- and post-visit-hooks are executed before/after the visiting process. BindingContext holds the result of the semantic analysis of the source code by the Kotlin compiler. Rules that rely on symbols and types being resolved can use the BindingContext for this analysis. Note that detekt must receive the correct compile classpath for the code being analyzed otherwise the default value BindingContext.EMPTY will be used and it will not be possible for detekt to resolve types or symbols. |
|
||||
| [postVisit](post-visit.html) | Could be overridden by subclasses to specify a behaviour which should be done after visiting kotlin elements.`open fun postVisit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [preVisit](pre-visit.html) | Could be overridden by subclasses to specify a behaviour which should be done before visiting kotlin elements.`open fun preVisit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [runIfActive](run-if-active.html) | Preferred way to run child rules because this composite rule takes care of evaluating if a specific child should be run at all.`fun <T : `[`Rule`](../-rule/index.html)`> T.runIfActive(block: T.() -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [visitCondition](visit-condition.html) | Basic mechanism to decide if a rule should run or not.`open fun visitCondition(root: KtFile): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ title: MultiRule.postVisit - detekt-api
|
||||
|
||||
`protected open fun postVisit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
|
||||
Overrides [BaseRule.postVisit](../-base-rule/post-visit.html)
|
||||
|
||||
Could be overridden by subclasses to specify a behaviour which should be done after
|
||||
visiting kotlin elements.
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ title: MultiRule.preVisit - detekt-api
|
||||
|
||||
`protected open fun preVisit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
|
||||
Overrides [BaseRule.preVisit](../-base-rule/pre-visit.html)
|
||||
|
||||
Could be overridden by subclasses to specify a behaviour which should be done before
|
||||
visiting kotlin elements.
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
title: MultiRule.ruleFilters - detekt-api
|
||||
---
|
||||
|
||||
[detekt-api](../../index.html) / [io.gitlab.arturbosch.detekt.api](../index.html) / [MultiRule](index.html) / [ruleFilters](./rule-filters.html)
|
||||
|
||||
# ruleFilters
|
||||
|
||||
`var ruleFilters: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`RuleId`](../-rule-id.html)`>`
|
||||
@@ -6,7 +6,7 @@ title: MultiRule.runIfActive - detekt-api
|
||||
|
||||
# runIfActive
|
||||
|
||||
`fun <T : `[`Rule`](../-rule/index.html)`> `[`T`](run-if-active.html#T)`.runIfActive(block: `[`T`](run-if-active.html#T)`.() -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
`fun <T : `[`Rule`](../-rule/index.html)`> T.runIfActive(block: T.() -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
|
||||
Preferred way to run child rules because this composite rule
|
||||
takes care of evaluating if a specific child should be run at all.
|
||||
|
||||
@@ -8,8 +8,6 @@ title: MultiRule.visitCondition - detekt-api
|
||||
|
||||
`open fun visitCondition(root: KtFile): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
|
||||
|
||||
Overrides [BaseRule.visitCondition](../-base-rule/visit-condition.html)
|
||||
|
||||
Basic mechanism to decide if a rule should run or not.
|
||||
|
||||
By default any rule which is declared 'active' in the [Config](../-config/index.html)
|
||||
|
||||
@@ -13,24 +13,15 @@ which is written inside a file.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `OutputReport()`<br>Translates detekt's result container - [Detektion](../-detektion/index.html) - into an output report which is written inside a file. |
|
||||
| [<init>](-init-.html) | Translates detekt's result container - [Detektion](../-detektion/index.html) - into an output report which is written inside a file.`OutputReport()` |
|
||||
|
||||
### Properties
|
||||
|
||||
| [ending](ending.html) | `abstract val ending: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Supported ending of this report type. |
|
||||
| [name](name.html) | `open val name: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`<br>Name of the report. Is used to exclude this report in the yaml config. |
|
||||
|
||||
### Inherited Properties
|
||||
|
||||
| [id](../-extension/id.html) | `open val id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Name of the extension. |
|
||||
| [priority](../-extension/priority.html) | `open val priority: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>Is used to run extensions in a specific order. The higher the priority the sooner the extension will run in detekt's lifecycle. |
|
||||
| [ending](ending.html) | Supported ending of this report type.`abstract val ending: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [name](name.html) | Name of the report. Is used to exclude this report in the yaml config.`open val name: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` |
|
||||
|
||||
### Functions
|
||||
|
||||
| [render](render.html) | `abstract fun render(detektion: `[`Detektion`](../-detektion/index.html)`): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`<br>Defines the translation process of detekt's result into a string. |
|
||||
| [write](write.html) | `fun write(filePath: `[`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html)`, detektion: `[`Detektion`](../-detektion/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Renders result and writes it to the given [filePath](write.html#io.gitlab.arturbosch.detekt.api.OutputReport$write(java.nio.file.Path, io.gitlab.arturbosch.detekt.api.Detektion)/filePath). |
|
||||
|
||||
### Inherited Functions
|
||||
|
||||
| [init](../-extension/init.html) | `open fun init(config: `[`Config`](../-config/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Allows to read any or even user defined properties from the detekt yaml config to setup this extension. |
|
||||
| [render](render.html) | Defines the translation process of detekt's result into a string.`abstract fun render(detektion: `[`Detektion`](../-detektion/index.html)`): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` |
|
||||
| [write](write.html) | Renders result and writes it to the given [filePath](write.html#io.gitlab.arturbosch.detekt.api.OutputReport$write(java.nio.file.Path, io.gitlab.arturbosch.detekt.api.Detektion)/filePath).`fun write(filePath: `[`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html)`, detektion: `[`Detektion`](../-detektion/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Anything that can be expressed as a number value for projects.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `ProjectMetric(type: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, value: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, priority: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = -1, isDouble: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = false, conversionFactor: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = DEFAULT_FLOAT_CONVERSION_FACTOR)`<br>Anything that can be expressed as a number value for projects. |
|
||||
| [<init>](-init-.html) | Anything that can be expressed as a number value for projects.`ProjectMetric(type: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, value: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, priority: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = -1, isDouble: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = false, conversionFactor: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = DEFAULT_FLOAT_CONVERSION_FACTOR)` |
|
||||
|
||||
### Properties
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@ http://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html
|
||||
|
||||
### Properties
|
||||
|
||||
| [ruleSetId](rule-set-id.html) | `abstract val ruleSetId: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Every rule set must be pre-configured with an ID to validate if this rule set must be created for current analysis. |
|
||||
| [ruleSetId](rule-set-id.html) | Every rule set must be pre-configured with an ID to validate if this rule set must be created for current analysis.`abstract val ruleSetId: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
|
||||
### Functions
|
||||
|
||||
| [buildRuleset](build-ruleset.html) | `open fun buildRuleset(config: `[`Config`](../-config/index.html)`): `[`RuleSet`](../-rule-set/index.html)`?`<br>Can return a rule set if this specific rule set is not considered as ignore. |
|
||||
| [instance](instance.html) | `abstract fun instance(config: `[`Config`](../-config/index.html)`): `[`RuleSet`](../-rule-set/index.html)<br>This function must be implemented to provide custom rule sets. Make sure to pass the configuration to each rule to allow rules to be self configurable. |
|
||||
| [buildRuleset](build-ruleset.html) | Can return a rule set if this specific rule set is not considered as ignore.`open fun buildRuleset(config: `[`Config`](../-config/index.html)`): `[`RuleSet`](../-rule-set/index.html)`?` |
|
||||
| [instance](instance.html) | This function must be implemented to provide custom rule sets. Make sure to pass the configuration to each rule to allow rules to be self configurable.`abstract fun instance(config: `[`Config`](../-config/index.html)`): `[`RuleSet`](../-rule-set/index.html) |
|
||||
|
||||
|
||||
@@ -12,15 +12,15 @@ A rule set is a collection of rules and must be defined within a rule set provid
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `RuleSet(id: `[`RuleSetId`](../-rule-set-id.html)`, rules: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`BaseRule`](../-base-rule/index.html)`>)`<br>A rule set is a collection of rules and must be defined within a rule set provider implementation. |
|
||||
| [<init>](-init-.html) | A rule set is a collection of rules and must be defined within a rule set provider implementation.`RuleSet(id: `[`RuleSetId`](../-rule-set-id.html)`, rules: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`BaseRule`](../-base-rule/index.html)`>)` |
|
||||
|
||||
### Properties
|
||||
|
||||
| [id](id.html) | `val id: `[`RuleSetId`](../-rule-set-id.html) |
|
||||
| [pathFilters](path-filters.html) | `var pathFilters: `[`PathFilters`](../../io.gitlab.arturbosch.detekt.api.internal/-path-filters/index.html)`?`<br>Is used to determine if a given [KtFile](#) should be analyzed at all. |
|
||||
| [pathFilters](path-filters.html) | Is used to determine if a given [KtFile](#) should be analyzed at all.`var pathFilters: `[`PathFilters`](../../io.gitlab.arturbosch.detekt.api.internal/-path-filters/index.html)`?` |
|
||||
| [rules](rules.html) | `val rules: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`BaseRule`](../-base-rule/index.html)`>` |
|
||||
|
||||
### Functions
|
||||
|
||||
| [accept](accept.html) | `fun accept(file: KtFile, bindingContext: BindingContext = BindingContext.EMPTY): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>`<br>Visits given file with all rules of this rule set, returning a list of all code smell findings. |
|
||||
| [accept](accept.html) | Visits given file with all rules of this rule set, returning a list of all code smell findings.`fun accept(file: KtFile, bindingContext: BindingContext = BindingContext.EMPTY): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>` |
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
---
|
||||
title: Rule.excludes - detekt-api
|
||||
---
|
||||
|
||||
[detekt-api](../../index.html) / [io.gitlab.arturbosch.detekt.api](../index.html) / [Rule](index.html) / [excludes](./excludes.html)
|
||||
|
||||
# excludes
|
||||
|
||||
`open val excludes: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`PathMatcher`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/PathMatcher.html)`>?`
|
||||
|
||||
When specified this rule will not run on KtFile's having a path matching any exclusion pattern.
|
||||
|
||||
**Return**
|
||||
path matchers or null which means no KtFile's get excluded except inclusion patterns are defined
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
---
|
||||
title: Rule.includes - detekt-api
|
||||
---
|
||||
|
||||
[detekt-api](../../index.html) / [io.gitlab.arturbosch.detekt.api](../index.html) / [Rule](index.html) / [includes](./includes.html)
|
||||
|
||||
# includes
|
||||
|
||||
`open val includes: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`PathMatcher`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/PathMatcher.html)`>?`
|
||||
|
||||
When specified this rule only runs on KtFile's with paths matching any inclusion pattern.
|
||||
|
||||
**Return**
|
||||
path matchers or null which means for every KtFile this rule must run
|
||||
|
||||
@@ -18,41 +18,23 @@ two predefined (preVisit/postVisit) functions which can be overridden to setup/t
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `Rule(ruleSetConfig: `[`Config`](../-config/index.html)` = Config.empty, ruleContext: `[`Context`](../-context/index.html)` = DefaultContext())`<br>A rule defines how one specific code structure should look like. If code is found which does not meet this structure, it is considered as harmful regarding maintainability or readability. |
|
||||
| [<init>](-init-.html) | A rule defines how one specific code structure should look like. If code is found which does not meet this structure, it is considered as harmful regarding maintainability or readability.`Rule(ruleSetConfig: `[`Config`](../-config/index.html)` = Config.empty, ruleContext: `[`Context`](../-context/index.html)` = DefaultContext())` |
|
||||
|
||||
### Properties
|
||||
|
||||
| [aliases](aliases.html) | `val aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>`<br>List of rule ids which can optionally be used in suppress annotations to refer to this rule. |
|
||||
| [defaultRuleIdAliases](default-rule-id-aliases.html) | `open val defaultRuleIdAliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>`<br>The default names which can be used instead of this #ruleId to refer to this rule in suppression's. |
|
||||
| [filters](filters.html) | `open val filters: `[`PathFilters`](../../io.gitlab.arturbosch.detekt.api.internal/-path-filters/index.html)`?`<br>Rules are aware of the paths they should run on via configuration properties. |
|
||||
| [issue](issue.html) | `abstract val issue: `[`Issue`](../-issue/index.html)<br>A rule is motivated to point out a specific issue in the code base. |
|
||||
| [ruleId](rule-id.html) | `val ruleId: `[`RuleId`](../-rule-id.html)<br>An id this rule is identified with. Conventionally the rule id is derived from the issue id as these two classes have a coexistence. |
|
||||
| [ruleSetConfig](rule-set-config.html) | `open val ruleSetConfig: `[`Config`](../-config/index.html)<br>Wrapped configuration of the ruleSet this rule is in. Use #valueOrDefault function to retrieve properties specified for the rule implementing this interface instead. Only use this property directly if you need a specific rule set property. |
|
||||
|
||||
### Inherited Properties
|
||||
|
||||
| [active](../-config-aware/active.html) | `open val active: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Is this rule specified as active in configuration? If an rule is not specified in the underlying configuration, we assume it should not be run. |
|
||||
| [autoCorrect](../-config-aware/auto-correct.html) | `open val autoCorrect: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Does this rule have auto correct specified in configuration? For auto correction to work the rule set itself enable it. |
|
||||
| [bindingContext](../-base-rule/binding-context.html) | `var bindingContext: BindingContext` |
|
||||
| [context](../-base-rule/context.html) | `val context: `[`Context`](../-context/index.html) |
|
||||
| [aliases](aliases.html) | List of rule ids which can optionally be used in suppress annotations to refer to this rule.`val aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>` |
|
||||
| [defaultRuleIdAliases](default-rule-id-aliases.html) | The default names which can be used instead of this #ruleId to refer to this rule in suppression's.`open val defaultRuleIdAliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>` |
|
||||
| [filters](filters.html) | Rules are aware of the paths they should run on via configuration properties.`open val filters: `[`PathFilters`](../../io.gitlab.arturbosch.detekt.api.internal/-path-filters/index.html)`?` |
|
||||
| [issue](issue.html) | A rule is motivated to point out a specific issue in the code base.`abstract val issue: `[`Issue`](../-issue/index.html) |
|
||||
| [ruleId](rule-id.html) | An id this rule is identified with. Conventionally the rule id is derived from the issue id as these two classes have a coexistence.`val ruleId: `[`RuleId`](../-rule-id.html) |
|
||||
| [ruleSetConfig](rule-set-config.html) | Wrapped configuration of the ruleSet this rule is in. Use #valueOrDefault function to retrieve properties specified for the rule implementing this interface instead. Only use this property directly if you need a specific rule set property.`open val ruleSetConfig: `[`Config`](../-config/index.html) |
|
||||
|
||||
### Functions
|
||||
|
||||
| [report](report.html) | `fun report(finding: `[`Finding`](../-finding/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>`fun report(findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Simplified version of [Context.report](../-context/report.html) with rule defaults. |
|
||||
| [visitCondition](visit-condition.html) | `open fun visitCondition(root: KtFile): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Basic mechanism to decide if a rule should run or not. |
|
||||
|
||||
### Inherited Functions
|
||||
|
||||
| [postVisit](../-base-rule/post-visit.html) | `open fun postVisit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Could be overridden by subclasses to specify a behaviour which should be done after visiting kotlin elements. |
|
||||
| [preVisit](../-base-rule/pre-visit.html) | `open fun preVisit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Could be overridden by subclasses to specify a behaviour which should be done before visiting kotlin elements. |
|
||||
| [subConfig](../-config-aware/sub-config.html) | `open fun subConfig(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Config`](../-config/index.html)<br>Tries to retrieve part of the configuration based on given key. |
|
||||
| [valueOrDefault](../-config-aware/value-or-default.html) | `open fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: `[`T`](../-config-aware/value-or-default.html#T)`): `[`T`](../-config-aware/value-or-default.html#T)<br>Retrieves a sub configuration or value based on given key. If configuration property cannot be found the specified default value is returned. |
|
||||
| [valueOrNull](../-config-aware/value-or-null.html) | `open fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`T`](../-config-aware/value-or-null.html#T)`?`<br>Retrieves a sub configuration or value based on given key. If the configuration property cannot be found, null is returned. |
|
||||
| [visit](../-base-rule/visit.html) | `open fun visit(root: KtFile): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Init function to start visiting the [KtFile](#). Can be overridden to start a different visiting process. |
|
||||
| [visitFile](../-base-rule/visit-file.html) | `fun visitFile(root: KtFile, bindingContext: BindingContext = BindingContext.EMPTY): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Before starting visiting kotlin elements, a check is performed if this rule should be triggered. Pre- and post-visit-hooks are executed before/after the visiting process. BindingContext holds the result of the semantic analysis of the source code by the Kotlin compiler. Rules that rely on symbols and types being resolved can use the BindingContext for this analysis. Note that detekt must receive the correct compile classpath for the code being analyzed otherwise the default value BindingContext.EMPTY will be used and it will not be possible for detekt to resolve types or symbols. |
|
||||
| [withAutoCorrect](../-config-aware/with-auto-correct.html) | `open fun withAutoCorrect(block: () -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>If your rule supports to automatically correct the misbehaviour of underlying smell, specify your code inside this method call, to allow the user of your rule to trigger auto correction only when needed. |
|
||||
| [report](report.html) | Simplified version of [Context.report](../-context/report.html) with rule defaults.`fun report(finding: `[`Finding`](../-finding/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>`fun report(findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [visitCondition](visit-condition.html) | Basic mechanism to decide if a rule should run or not.`open fun visitCondition(root: KtFile): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
|
||||
### Inheritors
|
||||
|
||||
| [ThresholdRule](../-threshold-rule/index.html) | `abstract class ThresholdRule : `[`Rule`](./index.html)<br>Provides a threshold attribute for this rule, which is specified manually for default values but can be also obtained from within a configuration object. |
|
||||
| [ThresholdRule](../-threshold-rule/index.html) | Provides a threshold attribute for this rule, which is specified manually for default values but can be also obtained from within a configuration object.`abstract class ThresholdRule : `[`Rule`](./index.html) |
|
||||
|
||||
|
||||
@@ -8,10 +8,6 @@ title: Rule.ruleId - detekt-api
|
||||
|
||||
`val ruleId: `[`RuleId`](../-rule-id.html)
|
||||
|
||||
Overrides [BaseRule.ruleId](../-base-rule/rule-id.html)
|
||||
|
||||
Overrides [ConfigAware.ruleId](../-config-aware/rule-id.html)
|
||||
|
||||
An id this rule is identified with.
|
||||
Conventionally the rule id is derived from the issue id as these two classes have a coexistence.
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ title: Rule.ruleSetConfig - detekt-api
|
||||
|
||||
`open val ruleSetConfig: `[`Config`](../-config/index.html)
|
||||
|
||||
Overrides [ConfigAware.ruleSetConfig](../-config-aware/rule-set-config.html)
|
||||
|
||||
Wrapped configuration of the ruleSet this rule is in.
|
||||
Use #valueOrDefault function to retrieve properties specified for the rule
|
||||
implementing this interface instead.
|
||||
|
||||
@@ -8,8 +8,6 @@ title: Rule.visitCondition - detekt-api
|
||||
|
||||
`open fun visitCondition(root: KtFile): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
|
||||
|
||||
Overrides [BaseRule.visitCondition](../-base-rule/visit-condition.html)
|
||||
|
||||
Basic mechanism to decide if a rule should run or not.
|
||||
|
||||
By default any rule which is declared 'active' in the [Config](../-config/index.html)
|
||||
|
||||
@@ -6,7 +6,7 @@ title: SingleAssign.getValue - detekt-api
|
||||
|
||||
# getValue
|
||||
|
||||
`operator fun getValue(thisRef: `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?, property: `[`KProperty`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property/index.html)`<*>): `[`T`](index.html#T)
|
||||
`operator fun getValue(thisRef: `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?, property: `[`KProperty`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property/index.html)`<*>): T`
|
||||
|
||||
Returns the [_value](#) if it was set before. Else an error is thrown.
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ Further assignments result in [IllegalStateException](https://kotlinlang.org/api
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `SingleAssign()`<br>Allows to assign a property just once. Further assignments result in [IllegalStateException](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-state-exception/index.html)'s. |
|
||||
| [<init>](-init-.html) | Allows to assign a property just once. Further assignments result in [IllegalStateException](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-state-exception/index.html)'s.`SingleAssign()` |
|
||||
|
||||
### Functions
|
||||
|
||||
| [getValue](get-value.html) | `operator fun getValue(thisRef: `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?, property: `[`KProperty`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property/index.html)`<*>): `[`T`](index.html#T)<br>Returns the [_value](#) if it was set before. Else an error is thrown. |
|
||||
| [setValue](set-value.html) | `operator fun setValue(thisRef: `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?, property: `[`KProperty`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property/index.html)`<*>, value: `[`T`](index.html#T)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Sets [_value](#) to the given [value](set-value.html#io.gitlab.arturbosch.detekt.api.SingleAssign$setValue(kotlin.Any, kotlin.reflect.KProperty((kotlin.Any)), io.gitlab.arturbosch.detekt.api.SingleAssign.T)/value). If it was set before, an error is thrown. |
|
||||
| [getValue](get-value.html) | Returns the [_value](#) if it was set before. Else an error is thrown.`operator fun getValue(thisRef: `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?, property: `[`KProperty`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property/index.html)`<*>): T` |
|
||||
| [setValue](set-value.html) | Sets [_value](#) to the given [value](set-value.html#io.gitlab.arturbosch.detekt.api.SingleAssign$setValue(kotlin.Any, kotlin.reflect.KProperty((kotlin.Any)), io.gitlab.arturbosch.detekt.api.SingleAssign.T)/value). If it was set before, an error is thrown.`operator fun setValue(thisRef: `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?, property: `[`KProperty`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property/index.html)`<*>, value: T): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ title: SingleAssign.setValue - detekt-api
|
||||
|
||||
# setValue
|
||||
|
||||
`operator fun setValue(thisRef: `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?, property: `[`KProperty`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property/index.html)`<*>, value: `[`T`](index.html#T)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
`operator fun setValue(thisRef: `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?, property: `[`KProperty`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property/index.html)`<*>, value: T): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
|
||||
Sets [_value](#) to the given [value](set-value.html#io.gitlab.arturbosch.detekt.api.SingleAssign$setValue(kotlin.Any, kotlin.reflect.KProperty((kotlin.Any)), io.gitlab.arturbosch.detekt.api.SingleAssign.T)/value). If it was set before, an error is thrown.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Stores line and column information of a location.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `SourceLocation(line: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, column: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)`<br>Stores line and column information of a location. |
|
||||
| [<init>](-init-.html) | Stores line and column information of a location.`SourceLocation(line: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, column: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` |
|
||||
|
||||
### Properties
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@ yaml config and test for their appearance in specific rules.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `SplitPattern(text: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, delimiters: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` = ",", removeTrailingAsterisks: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = true)`<br>Splits given text into parts and provides testing utilities for its elements. Basic use cases are to specify different function or class names in the detekt yaml config and test for their appearance in specific rules. |
|
||||
| [<init>](-init-.html) | Splits given text into parts and provides testing utilities for its elements. Basic use cases are to specify different function or class names in the detekt yaml config and test for their appearance in specific rules.`SplitPattern(text: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, delimiters: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` = ",", removeTrailingAsterisks: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = true)` |
|
||||
|
||||
### Functions
|
||||
|
||||
| [any](any.html) | `fun any(value: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Is there any element which matches the given [value](any.html#io.gitlab.arturbosch.detekt.api.SplitPattern$any(kotlin.String)/value)? |
|
||||
| [contains](contains.html) | `fun contains(value: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Does any part contain given [value](contains.html#io.gitlab.arturbosch.detekt.api.SplitPattern$contains(kotlin.String)/value)? |
|
||||
| [equals](equals.html) | `fun ~~equals~~(value: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Is there any element which matches given [value](equals.html#io.gitlab.arturbosch.detekt.api.SplitPattern$equals(kotlin.String)/value)? |
|
||||
| [mapAll](map-all.html) | `fun <T> mapAll(transform: (`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`) -> `[`T`](map-all.html#T)`): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`T`](map-all.html#T)`>`<br>Transforms all parts by given [transform](map-all.html#io.gitlab.arturbosch.detekt.api.SplitPattern$mapAll(kotlin.Function1((kotlin.String, io.gitlab.arturbosch.detekt.api.SplitPattern.mapAll.T)))/transform) function. |
|
||||
| [matches](matches.html) | `fun matches(value: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>`<br>Finds all parts which match the given [value](matches.html#io.gitlab.arturbosch.detekt.api.SplitPattern$matches(kotlin.String)/value). |
|
||||
| [none](none.html) | `fun none(value: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Tests if none of the parts contain the given [value](none.html#io.gitlab.arturbosch.detekt.api.SplitPattern$none(kotlin.String)/value). |
|
||||
| [startWith](start-with.html) | `fun startWith(value: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Tests if any part starts with the given [value](start-with.html#io.gitlab.arturbosch.detekt.api.SplitPattern$startWith(kotlin.String)/value) |
|
||||
| [any](any.html) | Is there any element which matches the given [value](any.html#io.gitlab.arturbosch.detekt.api.SplitPattern$any(kotlin.String)/value)?`fun any(value: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
| [contains](contains.html) | Does any part contain given [value](contains.html#io.gitlab.arturbosch.detekt.api.SplitPattern$contains(kotlin.String)/value)?`fun contains(value: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
| [equals](equals.html) | Is there any element which matches given [value](equals.html#io.gitlab.arturbosch.detekt.api.SplitPattern$equals(kotlin.String)/value)?`fun ~~equals~~(value: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
| [mapAll](map-all.html) | Transforms all parts by given [transform](map-all.html#io.gitlab.arturbosch.detekt.api.SplitPattern$mapAll(kotlin.Function1((kotlin.String, io.gitlab.arturbosch.detekt.api.SplitPattern.mapAll.T)))/transform) function.`fun <T> mapAll(transform: (`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`) -> T): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<T>` |
|
||||
| [matches](matches.html) | Finds all parts which match the given [value](matches.html#io.gitlab.arturbosch.detekt.api.SplitPattern$matches(kotlin.String)/value).`fun matches(value: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>` |
|
||||
| [none](none.html) | Tests if none of the parts contain the given [value](none.html#io.gitlab.arturbosch.detekt.api.SplitPattern$none(kotlin.String)/value).`fun none(value: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
| [startWith](start-with.html) | Tests if any part starts with the given [value](start-with.html#io.gitlab.arturbosch.detekt.api.SplitPattern$startWith(kotlin.String)/value)`fun startWith(value: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ title: SplitPattern.mapAll - detekt-api
|
||||
|
||||
# mapAll
|
||||
|
||||
`fun <T> mapAll(transform: (`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`) -> `[`T`](map-all.html#T)`): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`T`](map-all.html#T)`>`
|
||||
`fun <T> mapAll(transform: (`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`) -> T): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<T>`
|
||||
|
||||
Transforms all parts by given [transform](map-all.html#io.gitlab.arturbosch.detekt.api.SplitPattern$mapAll(kotlin.Function1((kotlin.String, io.gitlab.arturbosch.detekt.api.SplitPattern.mapAll.T)))/transform) function.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Stores character start and end positions of an text file.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `TextLocation(start: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, end: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)`<br>Stores character start and end positions of an text file. |
|
||||
| [<init>](-init-.html) | Stores character start and end positions of an text file.`TextLocation(start: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, end: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` |
|
||||
|
||||
### Properties
|
||||
|
||||
|
||||
@@ -13,23 +13,9 @@ but can be also obtained from within a configuration object.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `ThresholdRule(config: `[`Config`](../-config/index.html)`, defaultThreshold: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)`<br>Provides a threshold attribute for this rule, which is specified manually for default values but can be also obtained from within a configuration object. |
|
||||
| [<init>](-init-.html) | Provides a threshold attribute for this rule, which is specified manually for default values but can be also obtained from within a configuration object.`ThresholdRule(config: `[`Config`](../-config/index.html)`, defaultThreshold: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` |
|
||||
|
||||
### Properties
|
||||
|
||||
| [threshold](threshold.html) | `val threshold: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>The used threshold for this rule is loaded from the configuration or used from the constructor value. |
|
||||
|
||||
### Inherited Properties
|
||||
|
||||
| [aliases](../-rule/aliases.html) | `val aliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>`<br>List of rule ids which can optionally be used in suppress annotations to refer to this rule. |
|
||||
| [defaultRuleIdAliases](../-rule/default-rule-id-aliases.html) | `open val defaultRuleIdAliases: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>`<br>The default names which can be used instead of this #ruleId to refer to this rule in suppression's. |
|
||||
| [filters](../-rule/filters.html) | `open val filters: `[`PathFilters`](../../io.gitlab.arturbosch.detekt.api.internal/-path-filters/index.html)`?`<br>Rules are aware of the paths they should run on via configuration properties. |
|
||||
| [issue](../-rule/issue.html) | `abstract val issue: `[`Issue`](../-issue/index.html)<br>A rule is motivated to point out a specific issue in the code base. |
|
||||
| [ruleId](../-rule/rule-id.html) | `val ruleId: `[`RuleId`](../-rule-id.html)<br>An id this rule is identified with. Conventionally the rule id is derived from the issue id as these two classes have a coexistence. |
|
||||
| [ruleSetConfig](../-rule/rule-set-config.html) | `open val ruleSetConfig: `[`Config`](../-config/index.html)<br>Wrapped configuration of the ruleSet this rule is in. Use #valueOrDefault function to retrieve properties specified for the rule implementing this interface instead. Only use this property directly if you need a specific rule set property. |
|
||||
|
||||
### Inherited Functions
|
||||
|
||||
| [report](../-rule/report.html) | `fun report(finding: `[`Finding`](../-finding/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>`fun report(findings: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Finding`](../-finding/index.html)`>): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Simplified version of [Context.report](../-context/report.html) with rule defaults. |
|
||||
| [visitCondition](../-rule/visit-condition.html) | `open fun visitCondition(root: KtFile): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Basic mechanism to decide if a rule should run or not. |
|
||||
| [threshold](threshold.html) | The used threshold for this rule is loaded from the configuration or used from the constructor value.`val threshold: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) |
|
||||
|
||||
|
||||
@@ -8,7 +8,5 @@ title: ThresholdedCodeSmell.compact - detekt-api
|
||||
|
||||
`open fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
|
||||
Overrides [CodeSmell.compact](../-code-smell/compact.html)
|
||||
|
||||
Contract to format implementing object to a string representation.
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ for the existence of this rule violation.
|
||||
|
||||
### Constructors
|
||||
|
||||
| [<init>](-init-.html) | `ThresholdedCodeSmell(issue: `[`Issue`](../-issue/index.html)`, entity: `[`Entity`](../-entity/index.html)`, metric: `[`Metric`](../-metric/index.html)`, message: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, references: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Entity`](../-entity/index.html)`> = emptyList())`<br>Represents a code smell for which a specific metric can be determined which is responsible for the existence of this rule violation. |
|
||||
| [<init>](-init-.html) | Represents a code smell for which a specific metric can be determined which is responsible for the existence of this rule violation.`ThresholdedCodeSmell(issue: `[`Issue`](../-issue/index.html)`, entity: `[`Entity`](../-entity/index.html)`, metric: `[`Metric`](../-metric/index.html)`, message: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, references: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Entity`](../-entity/index.html)`> = emptyList())` |
|
||||
|
||||
### Properties
|
||||
|
||||
@@ -25,22 +25,8 @@ for the existence of this rule violation.
|
||||
| [threshold](threshold.html) | `val threshold: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) |
|
||||
| [value](value.html) | `val value: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) |
|
||||
|
||||
### Inherited Properties
|
||||
|
||||
| [entity](../-code-smell/entity.html) | `open val entity: `[`Entity`](../-entity/index.html) |
|
||||
| [id](../-code-smell/id.html) | `open val id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [issue](../-code-smell/issue.html) | `val issue: `[`Issue`](../-issue/index.html) |
|
||||
| [message](../-code-smell/message.html) | `open val message: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [metrics](../-code-smell/metrics.html) | `open val metrics: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Metric`](../-metric/index.html)`>` |
|
||||
| [references](../-code-smell/references.html) | `open val references: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Entity`](../-entity/index.html)`>` |
|
||||
|
||||
### Functions
|
||||
|
||||
| [compact](compact.html) | `open fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Contract to format implementing object to a string representation. |
|
||||
| [messageOrDescription](message-or-description.html) | `open fun messageOrDescription(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Explanation why this finding was raised. |
|
||||
|
||||
### Inherited Functions
|
||||
|
||||
| [compactWithSignature](../-code-smell/compact-with-signature.html) | `open fun compactWithSignature(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Same as [compact](../-compactable/compact.html) except the content should contain a substring which represents this exact findings via a custom identifier. |
|
||||
| [toString](../-code-smell/to-string.html) | `open fun toString(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [compact](compact.html) | Contract to format implementing object to a string representation.`open fun compact(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [messageOrDescription](message-or-description.html) | Explanation why this finding was raised.`open fun messageOrDescription(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
|
||||
|
||||
@@ -8,7 +8,5 @@ title: ThresholdedCodeSmell.messageOrDescription - detekt-api
|
||||
|
||||
`open fun messageOrDescription(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
|
||||
|
||||
Overrides [CodeSmell.messageOrDescription](../-code-smell/message-or-description.html)
|
||||
|
||||
Explanation why this finding was raised.
|
||||
|
||||
|
||||
@@ -13,23 +13,18 @@ yaml specification.
|
||||
|
||||
### Properties
|
||||
|
||||
| [parent](parent.html) | `val parent: `[`HierarchicalConfig.Parent`](../-hierarchical-config/-parent/index.html)`?`<br>Returns the parent config which encloses this config part. |
|
||||
| [parent](parent.html) | Returns the parent config which encloses this config part.`val parent: Parent?` |
|
||||
| [properties](properties.html) | `val properties: `[`Map`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`>` |
|
||||
|
||||
### Functions
|
||||
|
||||
| [subConfig](sub-config.html) | `fun subConfig(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Config`](../-config/index.html)<br>Tries to retrieve part of the configuration based on given key. |
|
||||
| [subConfig](sub-config.html) | Tries to retrieve part of the configuration based on given key.`fun subConfig(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Config`](../-config/index.html) |
|
||||
| [toString](to-string.html) | `fun toString(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
|
||||
| [valueOrDefault](value-or-default.html) | `fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: `[`T`](value-or-default.html#T)`): `[`T`](value-or-default.html#T)<br>Retrieves a sub configuration or value based on given key. If configuration property cannot be found the specified default value is returned. |
|
||||
| [valueOrNull](value-or-null.html) | `fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`T`](value-or-null.html#T)`?`<br>Retrieves a sub configuration or value based on given key. If the configuration property cannot be found, null is returned. |
|
||||
|
||||
### Inherited Functions
|
||||
|
||||
| [tryParseBasedOnDefault](../-base-config/try-parse-based-on-default.html) | `open fun tryParseBasedOnDefault(result: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, defaultResult: `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`): `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |
|
||||
| [valueOrDefaultInternal](../-base-config/value-or-default-internal.html) | `open fun valueOrDefaultInternal(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, result: `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`?, default: `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`): `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |
|
||||
| [valueOrDefault](value-or-default.html) | Retrieves a sub configuration or value based on given key. If configuration property cannot be found the specified default value is returned.`fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: T): T` |
|
||||
| [valueOrNull](value-or-null.html) | Retrieves a sub configuration or value based on given key. If the configuration property cannot be found, null is returned.`fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): T?` |
|
||||
|
||||
### Companion Object Functions
|
||||
|
||||
| [load](load.html) | `fun load(path: `[`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html)`): `[`Config`](../-config/index.html)<br>Factory method to load a yaml configuration. Given path must exist and end with "yml". |
|
||||
| [loadResource](load-resource.html) | `fun loadResource(url: `[`URL`](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html)`): `[`Config`](../-config/index.html)<br>Factory method to load a yaml configuration from a URL. |
|
||||
| [load](load.html) | Factory method to load a yaml configuration. Given path must exist and end with "yml".`fun load(path: `[`Path`](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html)`): `[`Config`](../-config/index.html) |
|
||||
| [loadResource](load-resource.html) | Factory method to load a yaml configuration from a URL.`fun loadResource(url: `[`URL`](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html)`): `[`Config`](../-config/index.html) |
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@ title: YamlConfig.parent - detekt-api
|
||||
|
||||
# parent
|
||||
|
||||
`val parent: `[`HierarchicalConfig.Parent`](../-hierarchical-config/-parent/index.html)`?`
|
||||
|
||||
Overrides [HierarchicalConfig.parent](../-hierarchical-config/parent.html)
|
||||
`val parent: Parent?`
|
||||
|
||||
Returns the parent config which encloses this config part.
|
||||
|
||||
|
||||
@@ -8,7 +8,5 @@ title: YamlConfig.subConfig - detekt-api
|
||||
|
||||
`fun subConfig(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Config`](../-config/index.html)
|
||||
|
||||
Overrides [Config.subConfig](../-config/sub-config.html)
|
||||
|
||||
Tries to retrieve part of the configuration based on given key.
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@ title: YamlConfig.valueOrDefault - detekt-api
|
||||
|
||||
# valueOrDefault
|
||||
|
||||
`fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: `[`T`](value-or-default.html#T)`): `[`T`](value-or-default.html#T)
|
||||
|
||||
Overrides [Config.valueOrDefault](../-config/value-or-default.html)
|
||||
`fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrDefault(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, default: T): T`
|
||||
|
||||
Retrieves a sub configuration or value based on given key. If configuration property cannot be found
|
||||
the specified default value is returned.
|
||||
|
||||
@@ -6,9 +6,7 @@ title: YamlConfig.valueOrNull - detekt-api
|
||||
|
||||
# valueOrNull
|
||||
|
||||
`fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`T`](value-or-null.html#T)`?`
|
||||
|
||||
Overrides [Config.valueOrNull](../-config/value-or-null.html)
|
||||
`fun <T : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> valueOrNull(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): T?`
|
||||
|
||||
Retrieves a sub configuration or value based on given key.
|
||||
If the configuration property cannot be found, null is returned.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user