reports/output-detekt.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>detekt report</title>
<style>
h2 {
background-color: #666666;
padding: 0.2em;
color: #ffffff;
}
h3 {
background-color:#f8dfdf;
padding:0.5em;
}
.rule {
background-color: #dddddd;
padding: 0.3em;
font-weight: bold;
}
.description {
color:#000000;
padding:0.3em;
}
.location {
color: #690505;
font-family: monospace;
display: block;
}
.message {
font-size: 0.8em;
color: #444444;
display: block;
margin-top: 1pt;
}
.rule-container {
border: 0.1em dashed #dddddd;
padding: 0.1em;
line-height: 1.5em;
margin-bottom: 8px;
margin-top: 8px;
}
pre {
border: 1px solid #e0e0e0;
overflow: scroll;
}
.lineno {
color: #999999;
background-color: #f0f0f0;
}
.error {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AwCFR4T/3uLMgAAADxJREFUCNdNyLERQEAABMCjL4lQwIzcjErpguAL+C9AvgKJDbeD/PRpLdm35Hm+MU+cB+tCKaJW4L4YBy+CAiLJrFs9mgAAAABJRU5ErkJggg==) bottom repeat-x;
}
.exception {
color: #b60808;
display: inline-block;
background-color: #ecdada;
border-color: #b60808;
border-radius: 10px;
border: solid 2px;
padding-left: 16px;
padding-right: 16px;
margin-bottom: 16px;
}
</style>
</head>
<body>
<h1>detekt report</h1>
<h2>Metrics</h2>
<div>
<ul>
<li>727 number of kt files</li>
<li>50 number of packages</li>
<li>869 number of classes</li>
<li>1,510 number of functions</li>
<li>4,588 number of properties</li>
</ul>
</div>
<h2>Complexity Report</h2>
<div>
<ul>
<li>49,325 lines of code (loc)</li>
<li>36,893 source lines of code (sloc)</li>
<li>24,645 logical lines of code (lloc)</li>
<li>4,151 comment lines of code (cloc)</li>
<li>3,529 McCabe complexity (mcc)</li>
<li>377 number of total code smells</li>
<li>11% comment source ratio</li>
<li>143 mcc per 1,000 lloc</li>
<li>15 code smells per 1,000 lloc</li>
</ul>
</div>
<h2>Findings</h2>
<div>Total: 377
<h3>detekt-hint: 377</h3>
<details id="InterfaceSegregationPrinciple" open="open">
<summary class="rule-container"><span class="rule">InterfaceSegregationPrinciple: 14 </span><span class="description">This rule reports classes that violates the Interface Segregation Principle.</span></summary>
<ul>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/test/kotlin/io/gitlab/arturbosch/detekt/cli/out/ReportsSpec.kt:105:5</span><span class="message">render is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 102 </span>
<span class="lineno"> 103 </span>internal class TestOutputReport : OutputReport() {
<span class="lineno"> 104 </span> override val ending: String = "yml"
<span class="lineno"> 105 </span> <span class="error">override fun render(detektion: Detektion): String? {</span>
<span class="lineno"> 106 </span><span class="error"> throw UnsupportedOperationException("not implemented")</span>
<span class="lineno"> 107 </span><span class="error"> }</span>
<span class="lineno"> 108 </span>}
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/ExceptionRaisedInMethodsPositive.kt:7:5</span><span class="message">toString is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 4 </span>
<span class="lineno"> 5 </span>open class ExceptionRaisedInMethods {
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span> <span class="error">// reports 1 - method should not throw an exception</span>
<span class="lineno"> 8 </span><span class="error"> override fun toString(): String {</span>
<span class="lineno"> 9 </span><span class="error"> throw IllegalStateException()</span>
<span class="lineno"> 10 </span><span class="error"> }</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/ExceptionRaisedInMethodsPositive.kt:12:5</span><span class="message">hashCode is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 9 </span> throw IllegalStateException()
<span class="lineno"> 10 </span> }
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span> <span class="error">// reports 1 - method should not throw an exception</span>
<span class="lineno"> 13 </span><span class="error"> override fun hashCode(): Int {</span>
<span class="lineno"> 14 </span><span class="error"> throw IllegalStateException()</span>
<span class="lineno"> 15 </span><span class="error"> }</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/ExceptionRaisedInMethodsPositive.kt:17:5</span><span class="message">equals is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 14 </span> throw IllegalStateException()
<span class="lineno"> 15 </span> }
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span> <span class="error">// reports 1 - method should not throw an exception</span>
<span class="lineno"> 18 </span><span class="error"> override fun equals(other: Any?): Boolean {</span>
<span class="lineno"> 19 </span><span class="error"> throw IllegalStateException()</span>
<span class="lineno"> 20 </span><span class="error"> }</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/ExceptionRaisedInMethodsPositive.kt:32:5</span><span class="message">equals is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 29 </span>
<span class="lineno"> 30 </span>object ExceptionRaisedInMethodsObject {
<span class="lineno"> 31 </span>
<span class="lineno"> 32 </span> <span class="error">// reports 1 - method should not throw an exception</span>
<span class="lineno"> 33 </span><span class="error"> override fun equals(other: Any?): Boolean {</span>
<span class="lineno"> 34 </span><span class="error"> throw IllegalStateException()</span>
<span class="lineno"> 35 </span><span class="error"> }</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/IteratorImplPositive.kt:28:9</span><span class="message">next is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 25 </span> return true
<span class="lineno"> 26 </span> }
<span class="lineno"> 27 </span>
<span class="lineno"> 28 </span> <span class="error">override fun next(): String {</span>
<span class="lineno"> 29 </span><span class="error"> throw IllegalStateException()</span>
<span class="lineno"> 30 </span><span class="error"> }</span>
<span class="lineno"> 31 </span> }
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/ProtectedMemberInFinalClassNegative.kt:12:5</span><span class="message">abstractFunction is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 9 </span> // should not report protected = private visibility
<span class="lineno"> 10 </span> protected override val abstractProp = 0
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span> <span class="error">// should not report protected = private visibility</span>
<span class="lineno"> 13 </span><span class="error"> protected override fun abstractFunction() {</span>
<span class="lineno"> 14 </span><span class="error"> }</span>
<span class="lineno"> 15 </span>}
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/UnusedPrivateMemberNegative.kt:58:9</span><span class="message">invoke is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 55 </span>
<span class="lineno"> 56 </span>internal fun libraryFunction() = run {
<span class="lineno"> 57 </span> val o: Function1<Any, Any> = object : Function1<Any, Any> {
<span class="lineno"> 58 </span> <span class="error">override fun invoke(p1: Any): Any { // unused but overridden param</span>
<span class="lineno"> 59 </span><span class="error"> throw UnsupportedOperationException("not implemented")</span>
<span class="lineno"> 60 </span><span class="error"> }</span>
<span class="lineno"> 61 </span> }
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-sample-extensions/src/test/kotlin/io/gitlab/arturbosch/detekt/sample/extensions/processors/QualifiedNameProcessorTest.kt:47:5</span><span class="message">add is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 44 </span> userData = userData.plus(key, value)
<span class="lineno"> 45 </span> }
<span class="lineno"> 46 </span>
<span class="lineno"> 47 </span> <span class="error">override fun add(notification: Notification) {</span>
<span class="lineno"> 48 </span><span class="error"> throw UnsupportedOperationException("not implemented")</span>
<span class="lineno"> 49 </span><span class="error"> }</span>
<span class="lineno"> 50 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-sample-extensions/src/test/kotlin/io/gitlab/arturbosch/detekt/sample/extensions/processors/QualifiedNameProcessorTest.kt:51:5</span><span class="message">add is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 48 </span> throw UnsupportedOperationException("not implemented")
<span class="lineno"> 49 </span> }
<span class="lineno"> 50 </span>
<span class="lineno"> 51 </span> <span class="error">override fun add(projectMetric: ProjectMetric) {</span>
<span class="lineno"> 52 </span><span class="error"> throw UnsupportedOperationException("not implemented")</span>
<span class="lineno"> 53 </span><span class="error"> }</span>
<span class="lineno"> 54 </span>}
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-test/src/main/kotlin/io/gitlab/arturbosch/detekt/test/FindingsAssertions.kt:20:5</span><span class="message">newAbstractIterableAssert is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 17 </span> AbstractListAssert<FindingsAssert, List<Finding>,
<span class="lineno"> 18 </span> Finding, FindingAssert>(actual, FindingsAssert::class.java) {
<span class="lineno"> 19 </span>
<span class="lineno"> 20 </span> <span class="error">override fun newAbstractIterableAssert(iterable: MutableIterable<Finding>): FindingsAssert {</span>
<span class="lineno"> 21 </span><span class="error"> throw UnsupportedOperationException("not implemented")</span>
<span class="lineno"> 22 </span><span class="error"> }</span>
<span class="lineno"> 23 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-test/src/main/kotlin/io/gitlab/arturbosch/detekt/test/NullOutputStream.kt:6:5</span><span class="message">write is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 3 </span>import java.io.OutputStream
<span class="lineno"> 4 </span>
<span class="lineno"> 5 </span>internal class NullOutputStream : OutputStream() {
<span class="lineno"> 6 </span> <span class="error">override fun write(b: Int) {</span>
<span class="lineno"> 7 </span><span class="error"> // no-op</span>
<span class="lineno"> 8 </span><span class="error"> }</span>
<span class="lineno"> 9 </span>}
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-test/src/main/kotlin/io/gitlab/arturbosch/detekt/test/TestDetektion.kt:27:5</span><span class="message">add is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up `class Detektion` into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 24 </span> userData = userData.minus(key)
<span class="lineno"> 25 </span> }
<span class="lineno"> 26 </span>
<span class="lineno"> 27 </span> <span class="error">override fun add(notification: Notification) = throw UnsupportedOperationException("not implemented")</span>
<span class="lineno"> 28 </span> override fun add(projectMetric: ProjectMetric) = throw UnsupportedOperationException("not implemented")
<span class="lineno"> 29 </span>}
<span class="lineno"> 30 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-test/src/main/kotlin/io/gitlab/arturbosch/detekt/test/TestDetektion.kt:28:5</span><span class="message">add is not implemented an may not be necessary. This is a possible violation of the interface segregation principle. Consider splitting up `class Detektion` into smaller interfaces with a single responsibility.</span>
<pre><code><span class="lineno"> 25 </span> }
<span class="lineno"> 26 </span>
<span class="lineno"> 27 </span> override fun add(notification: Notification) = throw UnsupportedOperationException("not implemented")
<span class="lineno"> 28 </span> <span class="error">override fun add(projectMetric: ProjectMetric) = throw UnsupportedOperationException("not implemented")</span>
<span class="lineno"> 29 </span>}
<span class="lineno"> 30 </span>
</code></pre>
</li>
</ul>
</details>
<details id="LackOfCohesionMethods" open="open">
<summary class="rule-container"><span class="rule">LackOfCohesionMethods: 55 </span><span class="description">This rule reports a file with low LCOM value.</span></summary>
<ul>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/AnnotationExcluder.kt:6:1</span><span class="message">AnnotationExcluder have a too high LCOM value: 0.8333333333333334</span>
<pre><code><span class="lineno"> 3 </span>import org.jetbrains.kotlin.psi.KtAnnotationEntry
<span class="lineno"> 4 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">/**</span>
<span class="lineno"> 7 </span><span class="error"> * Primary use case for an AnnotationExcluder is to decide if a KtElement should be</span>
<span class="lineno"> 8 </span><span class="error"> * excluded from further analysis. This is done by checking if a special annotation</span>
<span class="lineno"> 9 </span><span class="error"> * is present over the element.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/internal/BaseRule.kt:11:1</span><span class="message">BaseRule have a too high LCOM value: 0.8888888888888888</span>
<pre><code><span class="lineno"> 8 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 9 </span>import org.jetbrains.kotlin.resolve.BindingContext
<span class="lineno"> 10 </span>
<span class="lineno"> 11 </span><span class="error">abstract class BaseRule(</span>
<span class="lineno"> 12 </span><span class="error"> protected val context: Context = DefaultContext()</span>
<span class="lineno"> 13 </span><span class="error">) : DetektVisitor(), Context by context {</span>
<span class="lineno"> 14 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/internal/CyclomaticComplexity.kt:21:1</span><span class="message">CyclomaticComplexity have a too high LCOM value: 0.803030303030303</span>
<pre><code><span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.psiUtil.getCallNameExpression
<span class="lineno"> 19 </span>import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
<span class="lineno"> 20 </span>
<span class="lineno"> 21 </span><span class="error">/**</span>
<span class="lineno"> 22 </span><span class="error"> * Counts the cyclomatic complexity of nodes.</span>
<span class="lineno"> 23 </span><span class="error"> */</span>
<span class="lineno"> 24 </span><span class="error">@Suppress("TooManyFunctions")</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/CliArgs.kt:12:1</span><span class="message">CliArgs have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 9 </span> var help: Boolean
<span class="lineno"> 10 </span>}
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span><span class="error">class CliArgs : Args {</span>
<span class="lineno"> 13 </span><span class="error"></span>
<span class="lineno"> 14 </span><span class="error"> @Parameter(</span>
<span class="lineno"> 15 </span><span class="error"> names = ["--input", "-i"],</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/ReportPath.kt:9:1</span><span class="message">ReportPath have a too high LCOM value: 0.8</span>
<pre><code><span class="lineno"> 6 </span>import java.nio.file.Path
<span class="lineno"> 7 </span>import java.nio.file.Paths
<span class="lineno"> 8 </span>
<span class="lineno"> 9 </span><span class="error">data class ReportPath(val kind: String, val path: Path) {</span>
<span class="lineno"> 10 </span><span class="error"></span>
<span class="lineno"> 11 </span><span class="error"> companion object {</span>
<span class="lineno"> 12 </span><span class="error"> private const val NUM_OF_PARTS_UNIX = 2</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/baseline/IndentingXMLStreamWriter.kt:6:1</span><span class="message">IndentingXMLStreamWriter have a too high LCOM value: 0.819047619047619</span>
<pre><code><span class="lineno"> 3 </span>import java.util.Stack
<span class="lineno"> 4 </span>import javax.xml.stream.XMLStreamWriter
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">@Suppress("TooManyFunctions")</span>
<span class="lineno"> 7 </span><span class="error">class IndentingXMLStreamWriter(</span>
<span class="lineno"> 8 </span><span class="error"> writer: XMLStreamWriter,</span>
<span class="lineno"> 9 </span><span class="error"> private val indent: String = " "</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/console/ComplexityReport.kt:6:1</span><span class="message">ComplexityReport have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.ConsoleReport
<span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Detektion
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">class ComplexityReport : ConsoleReport() {</span>
<span class="lineno"> 7 </span><span class="error"></span>
<span class="lineno"> 8 </span><span class="error"> override val priority: Int = 20</span>
<span class="lineno"> 9 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/console/NotificationReport.kt:6:1</span><span class="message">NotificationReport have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.ConsoleReport
<span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Detektion
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">class NotificationReport : ConsoleReport() {</span>
<span class="lineno"> 7 </span><span class="error"></span>
<span class="lineno"> 8 </span><span class="error"> // Print notifications before the build failure report but after all other reports.</span>
<span class="lineno"> 9 </span><span class="error"> // This allows to compute intermediate messages based on detekt results and do not rely on 'println'.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/console/ProjectStatisticsReport.kt:6:1</span><span class="message">ProjectStatisticsReport have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.ConsoleReport
<span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Detektion
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">class ProjectStatisticsReport : ConsoleReport() {</span>
<span class="lineno"> 7 </span><span class="error"></span>
<span class="lineno"> 8 </span><span class="error"> override val priority: Int = 10</span>
<span class="lineno"> 9 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/out/HtmlOutputReport.kt:39:1</span><span class="message">HtmlOutputReport have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 36 </span>private const val PLACEHOLDER_VERSION = "@@@version@@@"
<span class="lineno"> 37 </span>private const val PLACEHOLDER_DATE = "@@@date@@@"
<span class="lineno"> 38 </span>
<span class="lineno"> 39 </span><span class="error">/**</span>
<span class="lineno"> 40 </span><span class="error"> * Generates a HTML report containing rule violations and metrics.</span>
<span class="lineno"> 41 </span><span class="error"> */</span>
<span class="lineno"> 42 </span><span class="error">class HtmlOutputReport : OutputReport() {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/out/TxtOutputReport.kt:6:1</span><span class="message">TxtOutputReport have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.Detektion
<span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.OutputReport
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">class TxtOutputReport : OutputReport() {</span>
<span class="lineno"> 7 </span><span class="error"></span>
<span class="lineno"> 8 </span><span class="error"> override val ending: String = "txt"</span>
<span class="lineno"> 9 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/out/XmlOutputReport.kt:8:1</span><span class="message">XmlOutputReport have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.api.OutputReport
<span class="lineno"> 6 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 7 </span>
<span class="lineno"> 8 </span><span class="error">/**</span>
<span class="lineno"> 9 </span><span class="error"> * Generates an XML report following the structure of a Checkstyle report.</span>
<span class="lineno"> 10 </span><span class="error"> */</span>
<span class="lineno"> 11 </span><span class="error">class XmlOutputReport : OutputReport() {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/test/kotlin/io/gitlab/arturbosch/detekt/cli/out/ReportsSpec.kt:103:1</span><span class="message">TestOutputReport have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 100 </span> }
<span class="lineno"> 101 </span>})
<span class="lineno"> 102 </span>
<span class="lineno"> 103 </span><span class="error">internal class TestOutputReport : OutputReport() {</span>
<span class="lineno"> 104 </span><span class="error"> override val ending: String = "yml"</span>
<span class="lineno"> 105 </span><span class="error"> override fun render(detektion: Detektion): String? {</span>
<span class="lineno"> 106 </span><span class="error"> throw UnsupportedOperationException("not implemented")</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/DetektFacade.kt:20:1</span><span class="message">DetektFacade have a too high LCOM value: 0.8571428571428572</span>
<pre><code><span class="lineno"> 17 </span>import org.jetbrains.kotlin.resolve.BindingContext
<span class="lineno"> 18 </span>import org.jetbrains.kotlin.resolve.lazy.declarations.FileBasedDeclarationProviderFactory
<span class="lineno"> 19 </span>
<span class="lineno"> 20 </span><span class="error">class DetektFacade(</span>
<span class="lineno"> 21 </span><span class="error"> private val detektor: Detektor,</span>
<span class="lineno"> 22 </span><span class="error"> settings: ProcessingSettings,</span>
<span class="lineno"> 23 </span><span class="error"> private val processors: List<FileProcessListener></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/DetektResult.kt:11:1</span><span class="message">DetektResult have a too high LCOM value: 0.8333333333333334</span>
<pre><code><span class="lineno"> 8 </span>import org.jetbrains.kotlin.com.intellij.openapi.util.Key
<span class="lineno"> 9 </span>import org.jetbrains.kotlin.com.intellij.util.keyFMap.KeyFMap
<span class="lineno"> 10 </span>
<span class="lineno"> 11 </span><span class="error">@Suppress("DataClassShouldBeImmutable")</span>
<span class="lineno"> 12 </span><span class="error">data class DetektResult(override val findings: Map<RuleSetId, List<Finding>>) : Detektion {</span>
<span class="lineno"> 13 </span><span class="error"></span>
<span class="lineno"> 14 </span><span class="error"> private val _notifications = ArrayList<Notification>()</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/KtLintMultiRule.kt:45:1</span><span class="message">KtLintMultiRule have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 42 </span>import org.jetbrains.kotlin.com.intellij.psi.impl.source.JavaDummyHolder
<span class="lineno"> 43 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 44 </span>
<span class="lineno"> 45 </span><span class="error">/**</span>
<span class="lineno"> 46 </span><span class="error"> * Runs all KtLint rules.</span>
<span class="lineno"> 47 </span><span class="error"> */</span>
<span class="lineno"> 48 </span><span class="error">class KtLintMultiRule(config: Config = Config.empty) : MultiRule() {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/MaximumLineLength.kt:11:1</span><span class="message">MaximumLineLength have a too high LCOM value: 0.8333333333333334</span>
<pre><code><span class="lineno"> 8 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.formatting.merge
<span class="lineno"> 10 </span>
<span class="lineno"> 11 </span><span class="error">/**</span>
<span class="lineno"> 12 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 13 </span><span class="error"> *</span>
<span class="lineno"> 14 </span><span class="error"> * @configuration maxLineLength - maximum line length (default: `120`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-generator/src/main/kotlin/io/gitlab/arturbosch/detekt/generator/collection/DetektCollector.kt:7:1</span><span class="message">DetektCollector have a too high LCOM value: 0.8</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.generator.printer.rulesetpage.RuleSetPage
<span class="lineno"> 5 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">class DetektCollector : Collector<RuleSetPage> {</span>
<span class="lineno"> 8 </span><span class="error"></span>
<span class="lineno"> 9 </span><span class="error"> private val ruleSetProviderCollector = RuleSetProviderCollector()</span>
<span class="lineno"> 10 </span><span class="error"> private val ruleCollector = RuleCollector()</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/Detekt.kt:50:1</span><span class="message">Detekt have a too high LCOM value: 0.8888888888888888</span>
<pre><code><span class="lineno"> 47 </span>import org.gradle.language.base.plugins.LifecycleBasePlugin
<span class="lineno"> 48 </span>import java.io.File
<span class="lineno"> 49 </span>
<span class="lineno"> 50 </span><span class="error">@CacheableTask</span>
<span class="lineno"> 51 </span><span class="error">open class Detekt : SourceTask(), VerificationTask {</span>
<span class="lineno"> 52 </span><span class="error"></span>
<span class="lineno"> 53 </span><span class="error"> @get:Classpath</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/DetektPlugin.kt:18:1</span><span class="message">DetektPlugin have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
<span class="lineno"> 16 </span>import java.io.File
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">class DetektPlugin : Plugin<Project> {</span>
<span class="lineno"> 19 </span><span class="error"></span>
<span class="lineno"> 20 </span><span class="error"> override fun apply(project: Project) {</span>
<span class="lineno"> 21 </span><span class="error"> project.pluginManager.apply(ReportingBasePlugin::class.java)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/extensions/DetektExtension.kt:10:1</span><span class="message">DetektExtension have a too high LCOM value: 0.9545454545454546</span>
<pre><code><span class="lineno"> 7 </span>import org.gradle.api.plugins.quality.CodeQualityExtension
<span class="lineno"> 8 </span>import java.io.File
<span class="lineno"> 9 </span>
<span class="lineno"> 10 </span><span class="error">open class DetektExtension(project: Project) : CodeQualityExtension() {</span>
<span class="lineno"> 11 </span><span class="error"></span>
<span class="lineno"> 12 </span><span class="error"> var ignoreFailures: Boolean</span>
<span class="lineno"> 13 </span><span class="error"> @JvmName("ignoreFailures_")</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/test/kotlin/io/gitlab/arturbosch/detekt/DslGradleRunner.kt:9:1</span><span class="message">DslGradleRunner have a too high LCOM value: 0.8214285714285714</span>
<pre><code><span class="lineno"> 6 </span>import java.io.File
<span class="lineno"> 7 </span>import java.util.UUID
<span class="lineno"> 8 </span>
<span class="lineno"> 9 </span><span class="error">class DslGradleRunner @Suppress("LongParameterList") constructor(</span>
<span class="lineno"> 10 </span><span class="error"> val projectLayout: ProjectLayout,</span>
<span class="lineno"> 11 </span><span class="error"> val buildFileName: String,</span>
<span class="lineno"> 12 </span><span class="error"> val mainBuildFileContent: String,</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/test/kotlin/io/gitlab/arturbosch/detekt/DslTestBuilder.kt:3:1</span><span class="message">DslTestBuilder have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 1 </span>package io.gitlab.arturbosch.detekt
<span class="lineno"> 2 </span>
<span class="lineno"> 3 </span><span class="error">abstract class DslTestBuilder {</span>
<span class="lineno"> 4 </span><span class="error"></span>
<span class="lineno"> 5 </span><span class="error"> abstract val gradleBuildConfig: String</span>
<span class="lineno"> 6 </span><span class="error"> abstract val gradleBuildName: String</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/LongParameterList.kt:25:1</span><span class="message">LongParameterList have a too high LCOM value: 0.9</span>
<pre><code><span class="lineno"> 22 </span>import org.jetbrains.kotlin.psi.KtSecondaryConstructor
<span class="lineno"> 23 </span>import org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject
<span class="lineno"> 24 </span>
<span class="lineno"> 25 </span><span class="error">/**</span>
<span class="lineno"> 26 </span><span class="error"> * Reports functions and constructors which have more parameters than a certain threshold.</span>
<span class="lineno"> 27 </span><span class="error"> *</span>
<span class="lineno"> 28 </span><span class="error"> * @configuration threshold - number of parameters required to trigger the rule (default: `6`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/MethodOverloading.kt:22:1</span><span class="message">MethodOverloading have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 19 </span>import org.jetbrains.kotlin.psi.psiUtil.getChildrenOfType
<span class="lineno"> 20 </span>import org.jetbrains.kotlin.psi.psiUtil.isExtensionDeclaration
<span class="lineno"> 21 </span>
<span class="lineno"> 22 </span><span class="error">/**</span>
<span class="lineno"> 23 </span><span class="error"> * This rule reports methods which are overloaded often.</span>
<span class="lineno"> 24 </span><span class="error"> * Method overloading tightly couples these methods together which might make the code harder to understand.</span>
<span class="lineno"> 25 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/StringLiteralDuplication.kt:19:1</span><span class="message">StringLiteralDuplication have a too high LCOM value: 0.9722222222222222</span>
<pre><code><span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.KtStringTemplateExpression
<span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.psiUtil.plainContent
<span class="lineno"> 18 </span>
<span class="lineno"> 19 </span><span class="error">/**</span>
<span class="lineno"> 20 </span><span class="error"> * This rule detects and reports duplicated String literals. Repeatedly typing out the same String literal across the</span>
<span class="lineno"> 21 </span><span class="error"> * codebase makes it harder to change and maintain.</span>
<span class="lineno"> 22 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/TooManyFunctions.kt:20:1</span><span class="message">TooManyFunctions have a too high LCOM value: 0.8375</span>
<pre><code><span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.KtObjectDeclaration
<span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.psiUtil.isPrivate
<span class="lineno"> 19 </span>
<span class="lineno"> 20 </span><span class="error">/**</span>
<span class="lineno"> 21 </span><span class="error"> * This rule reports files, classes, interfaces, objects and enums which contain too many functions.</span>
<span class="lineno"> 22 </span><span class="error"> * Each element can be configured with different thresholds.</span>
<span class="lineno"> 23 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/documentation/AbsentOrWrongFileLicense.kt:12:1</span><span class="message">AbsentOrWrongFileLicense have a too high LCOM value: 0.875</span>
<pre><code><span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span><span class="error">/**</span>
<span class="lineno"> 13 </span><span class="error"> * This rule will report every Kotlin source file which doesn't have required license header.</span>
<span class="lineno"> 14 </span><span class="error"> *</span>
<span class="lineno"> 15 </span><span class="error"> * @configuration licenseTemplateFile - path to file with license header template resolved relatively to config file</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/documentation/UndocumentedPublicClass.kt:17:1</span><span class="message">UndocumentedPublicClass have a too high LCOM value: 0.8333333333333334</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtEnumEntry
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtObjectDeclaration
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * This rule reports public classes, objects and interfaces which do not have the required documentation.</span>
<span class="lineno"> 19 </span><span class="error"> * Enable this rule if the codebase should have documentation on every public class, interface and object.</span>
<span class="lineno"> 20 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyBlocks.kt:21:1</span><span class="message">EmptyBlocks have a too high LCOM value: 0.9327731092436975</span>
<pre><code><span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.KtWhenExpression
<span class="lineno"> 19 </span>import org.jetbrains.kotlin.psi.KtWhileExpression
<span class="lineno"> 20 </span>
<span class="lineno"> 21 </span><span class="error">/**</span>
<span class="lineno"> 22 </span><span class="error"> *</span>
<span class="lineno"> 23 </span><span class="error"> * <noncompliant></span>
<span class="lineno"> 24 </span><span class="error"> * // unnecessary empty blocks should be removed</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyRule.kt:14:1</span><span class="message">EmptyRule have a too high LCOM value: 0.8333333333333334</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtBlockExpression
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtExpression
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Rule to detect empty blocks of code.</span>
<span class="lineno"> 16 </span><span class="error"> */</span>
<span class="lineno"> 17 </span><span class="error">abstract class EmptyRule(</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/DataClassShouldBeImmutable.kt:13:1</span><span class="message">DataClassShouldBeImmutable have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 10 </span>import org.jetbrains.kotlin.com.intellij.psi.PsiElement
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtClass
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * This rule reports mutable properties inside data classes.</span>
<span class="lineno"> 15 </span><span class="error"> *</span>
<span class="lineno"> 16 </span><span class="error"> * Data classes should mainly be used to store immutable data. This rule assumes that they should not contain any</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/MaxLineLength.kt:15:1</span><span class="message">MaxLineLength have a too high LCOM value: 0.8</span>
<pre><code><span class="lineno"> 12 </span>
<span class="lineno"> 13 </span>data class KtFileContent(val file: KtFile, val content: Sequence<String>)
<span class="lineno"> 14 </span>
<span class="lineno"> 15 </span><span class="error">/**</span>
<span class="lineno"> 16 </span><span class="error"> * This rule reports lines of code which exceed a defined maximum line length.</span>
<span class="lineno"> 17 </span><span class="error"> *</span>
<span class="lineno"> 18 </span><span class="error"> * Long lines might be hard to read on smaller screens or printouts. Additionally having a maximum line length</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/RedundantVisibilityModifierRule.kt:19:1</span><span class="message">RedundantVisibilityModifierRule have a too high LCOM value: 0.8333333333333334</span>
<pre><code><span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 18 </span>
<span class="lineno"> 19 </span><span class="error">/**</span>
<span class="lineno"> 20 </span><span class="error"> * This rule checks for redundant visibility modifiers.</span>
<span class="lineno"> 21 </span><span class="error"> *</span>
<span class="lineno"> 22 </span><span class="error"> * <noncompliant></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/SpacingBetweenPackageAndImports.kt:20:1</span><span class="message">SpacingBetweenPackageAndImports have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.psiUtil.anyDescendantOfType
<span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.psiUtil.siblings
<span class="lineno"> 19 </span>
<span class="lineno"> 20 </span><span class="error">/**</span>
<span class="lineno"> 21 </span><span class="error"> * This rule verifies spacing between package and import statements as well as between import statements and class</span>
<span class="lineno"> 22 </span><span class="error"> * declarations.</span>
<span class="lineno"> 23 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnnecessaryAnnotationUseSiteTarget.kt:16:1</span><span class="message">UnnecessaryAnnotationUseSiteTarget have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtPrimaryConstructor
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * This rule inspects the use of the Annotation use-site Target. In case that the use-site Target is not needed it can</span>
<span class="lineno"> 18 </span><span class="error"> * be removed. For more information check the kotlin documentation:</span>
<span class="lineno"> 19 </span><span class="error"> * https://kotlinlang.org/docs/reference/annotations.html#annotation-use-site-targets</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/MaxLineLength.kt:3:1</span><span class="message">MaxLineLength have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 1 </span>package cases
<span class="lineno"> 2 </span>
<span class="lineno"> 3 </span><span class="error">@Suppress("unused")</span>
<span class="lineno"> 4 </span><span class="error">class MaxLineLength {</span>
<span class="lineno"> 5 </span><span class="error"> companion object {</span>
<span class="lineno"> 6 </span><span class="error"> val LOREM_IPSUM = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/MaxLineLengthSuppressed.kt:3:1</span><span class="message">MaxLineLengthSuppressed have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 1 </span>package cases
<span class="lineno"> 2 </span>
<span class="lineno"> 3 </span><span class="error">@Suppress("unused")</span>
<span class="lineno"> 4 </span><span class="error">class MaxLineLengthSuppressed {</span>
<span class="lineno"> 5 </span><span class="error"> companion object {</span>
<span class="lineno"> 6 </span><span class="error"> @Suppress("MaxLineLength")</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/MaxLineLengthWithLongComments.kt:3:1</span><span class="message">MaxLineLengthWithLongComments have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 1 </span>package cases
<span class="lineno"> 2 </span>
<span class="lineno"> 3 </span><span class="error">@Suppress("unused")</span>
<span class="lineno"> 4 </span><span class="error">class MaxLineLengthWithLongComments {</span>
<span class="lineno"> 5 </span><span class="error"> // Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</span>
<span class="lineno"> 6 </span><span class="error"> /* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. */</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/NoTabsNegative.kt:3:1</span><span class="message">NoTabsNegative have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 1 </span>package cases
<span class="lineno"> 2 </span>
<span class="lineno"> 3 </span><span class="error">class NoTabsNegative {</span>
<span class="lineno"> 4 </span><span class="error"></span>
<span class="lineno"> 5 </span><span class="error"> fun methodOk() {</span>
<span class="lineno"> 6 </span><span class="error"> println("A message")</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/NoTabsPositive.kt:3:1</span><span class="message">NoTabsPositive have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 1 </span>package cases
<span class="lineno"> 2 </span>
<span class="lineno"> 3 </span><span class="error">class NoTabsPositive {</span>
<span class="lineno"> 4 </span><span class="error"> fun methodOk() { // reports 3</span>
<span class="lineno"> 5 </span><span class="error"> println("A message")</span>
<span class="lineno"> 6 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/ProtectedMemberInFinalClassNegative.kt:5:1</span><span class="message">NoProtectedMembersInFinalClass have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 2 </span>
<span class="lineno"> 3 </span>package cases
<span class="lineno"> 4 </span>
<span class="lineno"> 5 </span><span class="error">class NoProtectedMembersInFinalClass : BaseClass() {</span>
<span class="lineno"> 6 </span><span class="error"></span>
<span class="lineno"> 7 </span><span class="error"> private val i = 0</span>
<span class="lineno"> 8 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/ProtectedMemberInFinalClassNegative.kt:17:1</span><span class="message">BaseClass have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 14 </span> }
<span class="lineno"> 15 </span>}
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">abstract class BaseClass {</span>
<span class="lineno"> 18 </span><span class="error"></span>
<span class="lineno"> 19 </span><span class="error"> protected abstract val abstractProp: Int</span>
<span class="lineno"> 20 </span><span class="error"> protected abstract fun abstractFunction()</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/ProtectedMemberInFinalClassPositive.kt:5:1</span><span class="message">ProtectedMemberInFinalClassPositive have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 2 </span>
<span class="lineno"> 3 </span>package cases
<span class="lineno"> 4 </span>
<span class="lineno"> 5 </span><span class="error">class ProtectedMemberInFinalClassPositive {</span>
<span class="lineno"> 6 </span><span class="error"></span>
<span class="lineno"> 7 </span><span class="error"> protected var i1 = 0 // reports 1</span>
<span class="lineno"> 8 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/UnusedPrivateMemberNegative.kt:15:1</span><span class="message">C have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 12 </span> const val TEXT = "text"
<span class="lineno"> 13 </span>}
<span class="lineno"> 14 </span>
<span class="lineno"> 15 </span><span class="error">class C {</span>
<span class="lineno"> 16 </span><span class="error"> val myNumber = 5</span>
<span class="lineno"> 17 </span><span class="error"></span>
<span class="lineno"> 18 </span><span class="error"> fun publicFunction(usedParam: String) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/UtilityClassesNegative.kt:19:1</span><span class="message">UtilityClassWithSecondaryConstructorOk have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 16 </span> }
<span class="lineno"> 17 </span>}
<span class="lineno"> 18 </span>
<span class="lineno"> 19 </span><span class="error">class UtilityClassWithSecondaryConstructorOk {</span>
<span class="lineno"> 20 </span><span class="error"></span>
<span class="lineno"> 21 </span><span class="error"> private constructor()</span>
<span class="lineno"> 22 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/UtilityClassesNegative.kt:28:1</span><span class="message">NoUtilityClassBecauseOfInterface have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 25 </span> }
<span class="lineno"> 26 </span>}
<span class="lineno"> 27 </span>
<span class="lineno"> 28 </span><span class="error">class NoUtilityClassBecauseOfInterface : InterfaceWithCompanionObject {</span>
<span class="lineno"> 29 </span><span class="error"></span>
<span class="lineno"> 30 </span><span class="error"> constructor()</span>
<span class="lineno"> 31 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/UtilityClassesNegative.kt:38:1</span><span class="message">NoUtilityClassBecauseOfInheritance have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 35 </span>}
<span class="lineno"> 36 </span>
<span class="lineno"> 37 </span>open class UtilityClassesNegativeParent(val i: Int)
<span class="lineno"> 38 </span><span class="error">class NoUtilityClassBecauseOfInheritance : UtilityClassesNegativeParent {</span>
<span class="lineno"> 39 </span><span class="error"></span>
<span class="lineno"> 40 </span><span class="error"> constructor(i: Int) : super(i)</span>
<span class="lineno"> 41 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/UtilityClassesNegative.kt:47:1</span><span class="message">NoUtilityClasses have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 44 </span> }
<span class="lineno"> 45 </span>}
<span class="lineno"> 46 </span>
<span class="lineno"> 47 </span><span class="error">class NoUtilityClasses {</span>
<span class="lineno"> 48 </span><span class="error"></span>
<span class="lineno"> 49 </span><span class="error"> private val i = 0</span>
<span class="lineno"> 50 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/UtilityClassesNegative.kt:58:5</span><span class="message">ClassWithInstanceFunc have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 55 </span> constructor()
<span class="lineno"> 56 </span> }
<span class="lineno"> 57 </span>
<span class="lineno"> 58 </span> <span class="error">class ClassWithInstanceFunc {</span>
<span class="lineno"> 59 </span><span class="error"></span>
<span class="lineno"> 60 </span><span class="error"> fun f() {}</span>
<span class="lineno"> 61 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/UtilityClassesNegative.kt:81:5</span><span class="message">ClassWithSecondaryConstructorParameter have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 78 </span> }
<span class="lineno"> 79 </span> }
<span class="lineno"> 80 </span>
<span class="lineno"> 81 </span> <span class="error">class ClassWithSecondaryConstructorParameter {</span>
<span class="lineno"> 82 </span><span class="error"></span>
<span class="lineno"> 83 </span><span class="error"> constructor(i: Int)</span>
<span class="lineno"> 84 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/UtilityClassesPositive.kt:26:1</span><span class="message">UtilityClassWithSecondaryConstructor have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 23 </span> }
<span class="lineno"> 24 </span>}
<span class="lineno"> 25 </span>
<span class="lineno"> 26 </span><span class="error">class UtilityClassWithSecondaryConstructor { // violation</span>
<span class="lineno"> 27 </span><span class="error"></span>
<span class="lineno"> 28 </span><span class="error"> constructor()</span>
<span class="lineno"> 29 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/resources/cases/UtilityClassesPositive.kt:40:1</span><span class="message">OpenUtilityClass have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 37 </span> companion object
<span class="lineno"> 38 </span>}
<span class="lineno"> 39 </span>
<span class="lineno"> 40 </span><span class="error">open class OpenUtilityClass { // violation - utility class should be final</span>
<span class="lineno"> 41 </span><span class="error"></span>
<span class="lineno"> 42 </span><span class="error"> internal constructor()</span>
<span class="lineno"> 43 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-sample-extensions/src/main/kotlin/io/gitlab/arturbosch/detekt/sample/extensions/reports/QualifiedNamesOutputReport.kt:6:1</span><span class="message">QualifiedNamesOutputReport have a too high LCOM value: 1.0</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.Detektion
<span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.OutputReport
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">class QualifiedNamesOutputReport : OutputReport() {</span>
<span class="lineno"> 7 </span><span class="error"></span>
<span class="lineno"> 8 </span><span class="error"> override val ending: String = "txt"</span>
<span class="lineno"> 9 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-test/src/main/kotlin/io/gitlab/arturbosch/detekt/test/TestDetektion.kt:10:1</span><span class="message">TestDetektion have a too high LCOM value: 0.85</span>
<pre><code><span class="lineno"> 7 </span>import org.jetbrains.kotlin.com.intellij.openapi.util.Key
<span class="lineno"> 8 </span>import org.jetbrains.kotlin.com.intellij.util.keyFMap.KeyFMap
<span class="lineno"> 9 </span>
<span class="lineno"> 10 </span><span class="error">open class TestDetektion(vararg findings: Finding) : Detektion {</span>
<span class="lineno"> 11 </span><span class="error"></span>
<span class="lineno"> 12 </span><span class="error"> override val metrics: Collection<ProjectMetric> = listOf()</span>
<span class="lineno"> 13 </span><span class="error"> override val findings: Map<String, List<Finding>> = findings.groupBy { it.id }</span>
</code></pre>
</li>
</ul>
</details>
<details id="OpenClosedPrinciple" open="open">
<summary class="rule-container"><span class="rule">OpenClosedPrinciple: 17 </span><span class="description">This rule reports use of switching on enums and classes, which may be a sign of violation the open closed principle.</span></summary>
<ul>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/internal/BaseConfig.kt:38:90</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `String`, `Double`, `Boolean`, `Int`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 35 </span> private fun keySequence(key: String): String =
<span class="lineno"> 36 </span> if (parentPath == null) key else "$parentPath $CONFIG_SEPARATOR $key"
<span class="lineno"> 37 </span>
<span class="lineno"> 38 </span> protected open fun tryParseBasedOnDefault(result: String, defaultResult: Any): Any = <span class="error">when (defaultResult) {</span>
<span class="lineno"> 39 </span><span class="error"> is Int -> result.toInt()</span>
<span class="lineno"> 40 </span><span class="error"> is Boolean -></span>
<span class="lineno"> 41 </span><span class="error"> if (result in ALLOWED_BOOL_VALUES) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/internal/Signatures.kt:44:12</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `KtFile`, `KtClassOrObject`, `KtNamedFunction`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 41 </span> this.getNonStrictParentOfType<KtClassOrObject>()?.nameAsSafeName?.asString() ?: ""
<span class="lineno"> 42 </span>
<span class="lineno"> 43 </span>private fun PsiElement.searchSignature(): String {
<span class="lineno"> 44 </span> return <span class="error">when (this) {</span>
<span class="lineno"> 45 </span><span class="error"> is KtNamedFunction -> buildFunctionSignature(this)</span>
<span class="lineno"> 46 </span><span class="error"> is KtClassOrObject -> buildClassSignature(this)</span>
<span class="lineno"> 47 </span><span class="error"> is KtFile -> fileSignature()</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/internal/ValidatableConfiguration.kt:86:5</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `ValidatableConfiguration`, `YamlConfig`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 83 </span> }
<span class="lineno"> 84 </span> }
<span class="lineno"> 85 </span>
<span class="lineno"> 86 </span> <span class="error">when (config) {</span>
<span class="lineno"> 87 </span><span class="error"> is YamlConfig -> testKeys(config.properties, baseline.properties, null)</span>
<span class="lineno"> 88 </span><span class="error"> is ValidatableConfiguration -> notifications.addAll(config.validate(baseline, excludePatterns))</span>
<span class="lineno"> 89 </span><span class="error"> else -> error("Unsupported config type for validation: '${config::class}'.")</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/OutputFacade.kt:27:13</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `OutputReport`, `ConsoleReport`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 24 </span> reports.forEach { report ->
<span class="lineno"> 25 </span> report.init(config)
<span class="lineno"> 26 </span> report.init(settings)
<span class="lineno"> 27 </span> <span class="error">when (report) {</span>
<span class="lineno"> 28 </span><span class="error"> is ConsoleReport -> handleConsoleReport(report, result)</span>
<span class="lineno"> 29 </span><span class="error"> is OutputReport -> handleOutputReport(report, result)</span>
<span class="lineno"> 30 </span><span class="error"> }</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/out/XmlOutputReport.kt:43:17</span><span class="message">Switching on enum values is a common sign of violation the Open-Closed Principle. Consider introducing an abstraction (interface) for `Severity`, with new implementations of the interface for every value.</span>
<pre><code><span class="lineno"> 40 </span> }
<span class="lineno"> 41 </span>
<span class="lineno"> 42 </span> private val Finding.severityLabel: String
<span class="lineno"> 43 </span> get() = <span class="error">when (issue.severity) {</span>
<span class="lineno"> 44 </span><span class="error"> Severity.CodeSmell,</span>
<span class="lineno"> 45 </span><span class="error"> Severity.Style,</span>
<span class="lineno"> 46 </span><span class="error"> Severity.Warning,</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/Detektor.kt:86:54</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `MultiRule`, `Rule`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 83 </span> .filter { it.shouldAnalyzeFile(file, config) }
<span class="lineno"> 84 </span> .associate { it.id to it.rules }
<span class="lineno"> 85 </span>
<span class="lineno"> 86 </span> fun isCorrectable(rule: BaseRule): Boolean = <span class="error">when (rule) {</span>
<span class="lineno"> 87 </span><span class="error"> is Rule -> rule.autoCorrect</span>
<span class="lineno"> 88 </span><span class="error"> is MultiRule -> rule.rules.any { it.autoCorrect }</span>
<span class="lineno"> 89 </span><span class="error"> else -> error("No other rule type expected.")</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/HasPlatformType.kt:64:9</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `KtProperty`, `KtFunction`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 61 </span>
<span class="lineno"> 62 </span> @Suppress("ReturnCount", "ComplexMethod")
<span class="lineno"> 63 </span> private fun KtCallableDeclaration.hasImplicitPlatformType(): Boolean {
<span class="lineno"> 64 </span> <span class="error">when (this) {</span>
<span class="lineno"> 65 </span><span class="error"> is KtFunction -> if (isLocal || hasDeclaredReturnType()) return false</span>
<span class="lineno"> 66 </span><span class="error"> is KtProperty -> if (isLocal || typeReference != null) return false</span>
<span class="lineno"> 67 </span><span class="error"> else -> return false</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/coroutines/RedundantSuspendModifier.kt:93:16</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `KtProperty`, `KtForExpression`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 90 </span> private fun KtExpression.hasSuspendCalls(): Boolean {
<span class="lineno"> 91 </span> if (!isValidCandidateExpression()) return false
<span class="lineno"> 92 </span>
<span class="lineno"> 93 </span> return <span class="error">when (this) {</span>
<span class="lineno"> 94 </span><span class="error"> is KtForExpression -> {</span>
<span class="lineno"> 95 </span><span class="error"> val iteratorResolvedCall = bindingContext[LOOP_RANGE_ITERATOR_RESOLVED_CALL, loopRange]</span>
<span class="lineno"> 96 </span><span class="error"> val loopRangeHasNextResolvedCall = bindingContext[LOOP_RANGE_HAS_NEXT_RESOLVED_CALL, loopRange]</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/InstanceOfCheckForException.kt:63:29</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `KtBinaryExpressionWithTypeRHS`, `KtIsExpression`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 60 </span> }
<span class="lineno"> 61 </span>
<span class="lineno"> 62 </span> private fun KtExpression.isCheckForSubTypeOf(catchParameter: KtParameter): Boolean {
<span class="lineno"> 63 </span> val (left, right) = <span class="error">when (this) {</span>
<span class="lineno"> 64 </span><span class="error"> is KtIsExpression -> leftHandSide to typeReference</span>
<span class="lineno"> 65 </span><span class="error"> is KtBinaryExpressionWithTypeRHS -> if (KtPsiUtil.isUnsafeCast(this)) left to right else null</span>
<span class="lineno"> 66 </span><span class="error"> else -> null</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/NamingRules.kt:62:13</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `KtParameter`, `KtClassOrObject`, `KtEnumEntry`, `KtNamedFunction`, `KtProperty`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 59 </span> return
<span class="lineno"> 60 </span> }
<span class="lineno"> 61 </span> declaration.nameIdentifier?.parent?.javaClass?.let {
<span class="lineno"> 62 </span> <span class="error">when (declaration) {</span>
<span class="lineno"> 63 </span><span class="error"> is KtProperty -> handleProperty(declaration)</span>
<span class="lineno"> 64 </span><span class="error"> is KtNamedFunction -> handleFunction(declaration)</span>
<span class="lineno"> 65 </span><span class="error"> is KtEnumEntry -> enumEntryNamingRule.runIfActive { visitEnumEntry(declaration) }</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/NamingRules.kt:96:9</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `KtNamedFunction`, `KtConstructor<*>`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 93 </span> }
<span class="lineno"> 94 </span>
<span class="lineno"> 95 </span> private fun handleParameter(declaration: KtParameter) {
<span class="lineno"> 96 </span> <span class="error">when (declaration.ownerFunction) {</span>
<span class="lineno"> 97 </span><span class="error"> is KtConstructor<*> -> constructorParameterNamingRule.runIfActive { visitParameter(declaration) }</span>
<span class="lineno"> 98 </span><span class="error"> is KtNamedFunction -> functionParameterNamingRule.runIfActive { visitParameter(declaration) }</span>
<span class="lineno"> 99 </span><span class="error"> }</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ExplicitCollectionElementAccessMethod.kt:64:22</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `KtDotQualifiedExpression`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 61 </span>
<span class="lineno"> 62 </span> private fun isMapMethod(expression: KtCallExpression): Boolean {
<span class="lineno"> 63 </span> val dotExpression = expression.prevSibling
<span class="lineno"> 64 </span> val caller = <span class="error">when (dotExpression?.parent) {</span>
<span class="lineno"> 65 </span><span class="error"> is KtDotQualifiedExpression -> dotExpression.prevSibling</span>
<span class="lineno"> 66 </span><span class="error"> else -> return false</span>
<span class="lineno"> 67 </span><span class="error"> }</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/MagicNumber.kt:175:29</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `KtPrefixExpression`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 172 </span> * The information we need is in the enclosing [KtValueArgument]. When the number being evaluated is
<span class="lineno"> 173 </span> * negative, there will be an [KtPrefixExpression] in between the receiver and the [KtValueArgument].
<span class="lineno"> 174 </span> */
<span class="lineno"> 175 </span> val valueArgument = <span class="error">when (parent) {</span>
<span class="lineno"> 176 </span><span class="error"> is KtPrefixExpression -> parent.parent</span>
<span class="lineno"> 177 </span><span class="error"> else -> parent</span>
<span class="lineno"> 178 </span><span class="error"> }</span> as? KtValueArgument
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/RedundantExplicitType.kt:63:9</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `KtCallExpression`, `KtNameReferenceExpression`, `KtStringTemplateExpression`, `KtConstantExpression`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 60 </span> (bindingContext[BindingContext.DECLARATION_TO_DESCRIPTOR, property] as? VariableDescriptor)?.type ?: return
<span class="lineno"> 61 </span> if (type is AbbreviatedType) return
<span class="lineno"> 62 </span>
<span class="lineno"> 63 </span> <span class="error">when (val initializer = property.initializer) {</span>
<span class="lineno"> 64 </span><span class="error"> is KtConstantExpression -> if (!initializer.typeIsSameAs(type)) return</span>
<span class="lineno"> 65 </span><span class="error"> is KtStringTemplateExpression -> if (!KotlinBuiltIns.isString(type)) return</span>
<span class="lineno"> 66 </span><span class="error"> is KtNameReferenceExpression -> if (typeReference.text != initializer.getReferencedName()) return</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedPrivateMember.kt:140:20</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `KtNameReferenceExpression`, `KtOperationReferenceExpression`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 137 </span> */
<span class="lineno"> 138 </span> override fun visitReferenceExpression(expression: KtReferenceExpression) {
<span class="lineno"> 139 </span> super.visitReferenceExpression(expression)
<span class="lineno"> 140 </span> val name = <span class="error">when (expression) {</span>
<span class="lineno"> 141 </span><span class="error"> is KtOperationReferenceExpression -> expression.getReferencedName()</span>
<span class="lineno"> 142 </span><span class="error"> is KtNameReferenceExpression -> expression.getReferencedName()</span>
<span class="lineno"> 143 </span><span class="error"> else -> null</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseRequire.kt:52:16</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `KtNamedFunction`, `KtBlockExpression`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 49 </span> }
<span class="lineno"> 50 </span>
<span class="lineno"> 51 </span> private fun KtThrowExpression.isOnlyExpressionInBlock(): Boolean {
<span class="lineno"> 52 </span> return <span class="error">when (val p = parent) {</span>
<span class="lineno"> 53 </span><span class="error"> is KtBlockExpression -> p.statements.size == 1</span>
<span class="lineno"> 54 </span><span class="error"> is KtNamedFunction -> true</span>
<span class="lineno"> 55 </span><span class="error"> else -> false</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-test/src/main/kotlin/io/gitlab/arturbosch/detekt/test/TestConfig.kt:29:84</span><span class="message">Type checking is a sign of violating the Open-Closed Principle. Consider introducing an abstraction (interface) for `Set<*>`, `List<*>`, with new implementations of the interface for every class.</span>
<pre><code><span class="lineno"> 26 </span> if (key == "active") (values["active"] ?: true) as T?
<span class="lineno"> 27 </span> else values[key] as? T
<span class="lineno"> 28 </span>
<span class="lineno"> 29 </span> override fun tryParseBasedOnDefault(result: String, defaultResult: Any): Any = <span class="error">when (defaultResult) {</span>
<span class="lineno"> 30 </span><span class="error"> is List<*> -> parseList(result)</span>
<span class="lineno"> 31 </span><span class="error"> is Set<*> -> parseList(result).toSet()</span>
<span class="lineno"> 32 </span><span class="error"> else -> super.tryParseBasedOnDefault(result, defaultResult)</span>
</code></pre>
</li>
</ul>
</details>
<details id="UseCompositionInsteadOfInheritance" open="open">
<summary class="rule-container"><span class="rule">UseCompositionInsteadOfInheritance: 291 </span><span class="description">This rule reports a file using inheritance.</span></summary>
<ul>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/CodeSmell.kt:39:1</span><span class="message">The class `CorrectableCodeSmell` is using inheritance, consider using composition instead.
Does `CorrectableCodeSmell` want to expose the complete interface (`messageOrDescription, toString, compactWithSignature, compact`) of `CodeSmell` such that `CorrectableCodeSmell` can be used where `CodeSmell` is expected? Indicates __inheritance__.
Does `CorrectableCodeSmell` want only some/part of the behavior exposed by `CodeSmell`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 36 </span> override fun messageOrDescription(): String = if (message.isEmpty()) issue.description else message
<span class="lineno"> 37 </span>}
<span class="lineno"> 38 </span>
<span class="lineno"> 39 </span><span class="error">/**</span>
<span class="lineno"> 40 </span><span class="error"> * Represents a code smell for that can be auto corrected.</span>
<span class="lineno"> 41 </span><span class="error"> *</span>
<span class="lineno"> 42 </span><span class="error"> * @see CodeSmell</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/CodeSmell.kt:70:1</span><span class="message">The class `ThresholdedCodeSmell` is using inheritance, consider using composition instead.
Does `ThresholdedCodeSmell` want to expose the complete interface (`messageOrDescription, toString, compactWithSignature, compact`) of `CodeSmell` such that `ThresholdedCodeSmell` can be used where `CodeSmell` is expected? Indicates __inheritance__.
Does `ThresholdedCodeSmell` want only some/part of the behavior exposed by `CodeSmell`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 67 </span> }
<span class="lineno"> 68 </span>}
<span class="lineno"> 69 </span>
<span class="lineno"> 70 </span><span class="error">/**</span>
<span class="lineno"> 71 </span><span class="error"> * Represents a code smell for which a specific metric can be determined which is responsible</span>
<span class="lineno"> 72 </span><span class="error"> * for the existence of this rule violation.</span>
<span class="lineno"> 73 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/MultiRule.kt:6:1</span><span class="message">The class `MultiRule` is using inheritance, consider using composition instead.
Does `MultiRule` want to expose the complete interface (`visitCondition, visit, visitFile`) of `BaseRule` such that `MultiRule` can be used where `BaseRule` is expected? Indicates __inheritance__.
Does `MultiRule` want only some/part of the behavior exposed by `BaseRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.internal.BaseRule
<span class="lineno"> 4 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">/**</span>
<span class="lineno"> 7 </span><span class="error"> * Composite rule which delegates work to child rules.</span>
<span class="lineno"> 8 </span><span class="error"> * Can be used to combine different rules which do similar work like</span>
<span class="lineno"> 9 </span><span class="error"> * scanning the source code line by line to increase performance.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/Rule.kt:11:1</span><span class="message">The class `Rule` is using inheritance, consider using composition instead.
Does `Rule` want to expose the complete interface (`visitCondition, visit, visitFile`) of `BaseRule` such that `Rule` can be used where `BaseRule` is expected? Indicates __inheritance__.
Does `Rule` want only some/part of the behavior exposed by `BaseRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 8 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 9 </span>import java.nio.file.Paths
<span class="lineno"> 10 </span>
<span class="lineno"> 11 </span><span class="error">/**</span>
<span class="lineno"> 12 </span><span class="error"> * A rule defines how one specific code structure should look like. If code is found</span>
<span class="lineno"> 13 </span><span class="error"> * which does not meet this structure, it is considered as harmful regarding maintainability</span>
<span class="lineno"> 14 </span><span class="error"> * or readability.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/ThresholdRule.kt:3:1</span><span class="message">The class `ThresholdRule` is using inheritance, consider using composition instead.
Does `ThresholdRule` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ThresholdRule` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ThresholdRule` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 1 </span>package io.gitlab.arturbosch.detekt.api
<span class="lineno"> 2 </span>
<span class="lineno"> 3 </span><span class="error">/**</span>
<span class="lineno"> 4 </span><span class="error"> * Provides a threshold attribute for this rule, which is specified manually for default values</span>
<span class="lineno"> 5 </span><span class="error"> * but can be also obtained from within a configuration object.</span>
<span class="lineno"> 6 </span><span class="error"> */</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/internal/BaseRule.kt:11:1</span><span class="message">The class `BaseRule` is using inheritance, consider using composition instead.
Does `BaseRule` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `BaseRule` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `BaseRule` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 8 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 9 </span>import org.jetbrains.kotlin.resolve.BindingContext
<span class="lineno"> 10 </span>
<span class="lineno"> 11 </span><span class="error">abstract class BaseRule(</span>
<span class="lineno"> 12 </span><span class="error"> protected val context: Context = DefaultContext()</span>
<span class="lineno"> 13 </span><span class="error">) : DetektVisitor(), Context by context {</span>
<span class="lineno"> 14 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/internal/CommaSeparatedPattern.kt:5:1</span><span class="message">The class `CommaSeparatedPattern` is using inheritance, consider using composition instead.
Does `CommaSeparatedPattern` want to expose the complete interface (`mapAll, startWith, matches, none, any, equals, contains`) of `SplitPattern` such that `CommaSeparatedPattern` can be used where `SplitPattern` is expected? Indicates __inheritance__.
Does `CommaSeparatedPattern` want only some/part of the behavior exposed by `SplitPattern`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 2 </span>
<span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.SplitPattern
<span class="lineno"> 4 </span>
<span class="lineno"> 5 </span><span class="error">class CommaSeparatedPattern(</span>
<span class="lineno"> 6 </span><span class="error"> text: String,</span>
<span class="lineno"> 7 </span><span class="error"> delimiters: String = ","</span>
<span class="lineno"> 8 </span><span class="error">) : SplitPattern(text, delimiters, false) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/internal/CyclomaticComplexity.kt:21:1</span><span class="message">The class `CyclomaticComplexity` is using inheritance, consider using composition instead.
Does `CyclomaticComplexity` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `CyclomaticComplexity` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `CyclomaticComplexity` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.psiUtil.getCallNameExpression
<span class="lineno"> 19 </span>import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
<span class="lineno"> 20 </span>
<span class="lineno"> 21 </span><span class="error">/**</span>
<span class="lineno"> 22 </span><span class="error"> * Counts the cyclomatic complexity of nodes.</span>
<span class="lineno"> 23 </span><span class="error"> */</span>
<span class="lineno"> 24 </span><span class="error">@Suppress("TooManyFunctions")</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/internal/YamlConfig.kt:14:1</span><span class="message">The class `YamlConfig` is using inheritance, consider using composition instead.
Does `YamlConfig` want to expose the complete interface (`empty public interface`) of `BaseConfig` such that `YamlConfig` can be used where `BaseConfig` is expected? Indicates __inheritance__.
Does `YamlConfig` want only some/part of the behavior exposed by `BaseConfig`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import java.net.URL
<span class="lineno"> 12 </span>import java.nio.file.Path
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Config implementation using the yaml format. SubConfigurations can return sub maps according to the</span>
<span class="lineno"> 16 </span><span class="error"> * yaml specification.</span>
<span class="lineno"> 17 </span><span class="error"> */</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/test/kotlin/io/gitlab/arturbosch/detekt/api/MultiRuleSpec.kt:65:1</span><span class="message">The class `TestMultiRule` is using inheritance, consider using composition instead.
Does `TestMultiRule` want to expose the complete interface (`runIfActive, postVisit, preVisit, visitCondition`) of `MultiRule` such that `TestMultiRule` can be used where `MultiRule` is expected? Indicates __inheritance__.
Does `TestMultiRule` want only some/part of the behavior exposed by `MultiRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 62 </span> override fun instance(config: Config): RuleSet = RuleSet(ruleSetId, listOf(TestMultiRule(config)))
<span class="lineno"> 63 </span>}
<span class="lineno"> 64 </span>
<span class="lineno"> 65 </span><span class="error">private class TestMultiRule(config: Config) : MultiRule() {</span>
<span class="lineno"> 66 </span><span class="error"></span>
<span class="lineno"> 67 </span><span class="error"> private val one = TestRuleOne(config)</span>
<span class="lineno"> 68 </span><span class="error"> private val two = TestRuleTwo(config)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/test/kotlin/io/gitlab/arturbosch/detekt/api/MultiRuleSpec.kt:77:1</span><span class="message">The class `AbstractRule` is using inheritance, consider using composition instead.
Does `AbstractRule` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `AbstractRule` can be used where `Rule` is expected? Indicates __inheritance__.
Does `AbstractRule` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 74 </span> }
<span class="lineno"> 75 </span>}
<span class="lineno"> 76 </span>
<span class="lineno"> 77 </span><span class="error">private abstract class AbstractRule(config: Config) : Rule(config) {</span>
<span class="lineno"> 78 </span><span class="error"> override val issue: Issue = Issue(javaClass.simpleName, Severity.Minor, "", Debt.TWENTY_MINS)</span>
<span class="lineno"> 79 </span><span class="error"> override fun visitKtFile(file: KtFile) = report(CodeSmell(issue, Entity.from(file), message = ""))</span>
<span class="lineno"> 80 </span><span class="error">}</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/test/kotlin/io/gitlab/arturbosch/detekt/api/MultiRuleSpec.kt:82:1</span><span class="message">The class `TestRuleOne` is using inheritance, consider using composition instead.
Does `TestRuleOne` want to expose the complete interface (`visitKtFile`) of `AbstractRule` such that `TestRuleOne` can be used where `AbstractRule` is expected? Indicates __inheritance__.
Does `TestRuleOne` want only some/part of the behavior exposed by `AbstractRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 79 </span> override fun visitKtFile(file: KtFile) = report(CodeSmell(issue, Entity.from(file), message = ""))
<span class="lineno"> 80 </span>}
<span class="lineno"> 81 </span>
<span class="lineno"> 82 </span><span class="error">private class TestRuleOne(config: Config) : AbstractRule(config)</span>
<span class="lineno"> 83 </span>private class TestRuleTwo(config: Config) : AbstractRule(config)
<span class="lineno"> 84 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/test/kotlin/io/gitlab/arturbosch/detekt/api/MultiRuleSpec.kt:83:1</span><span class="message">The class `TestRuleTwo` is using inheritance, consider using composition instead.
Does `TestRuleTwo` want to expose the complete interface (`visitKtFile`) of `AbstractRule` such that `TestRuleTwo` can be used where `AbstractRule` is expected? Indicates __inheritance__.
Does `TestRuleTwo` want only some/part of the behavior exposed by `AbstractRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 80 </span>}
<span class="lineno"> 81 </span>
<span class="lineno"> 82 </span>private class TestRuleOne(config: Config) : AbstractRule(config)
<span class="lineno"> 83 </span><span class="error">private class TestRuleTwo(config: Config) : AbstractRule(config)</span>
<span class="lineno"> 84 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/test/kotlin/io/gitlab/arturbosch/detekt/api/RuleSetSpec.kt:55:1</span><span class="message">The class `Test` is using inheritance, consider using composition instead.
Does `Test` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `Test` can be used where `Rule` is expected? Indicates __inheritance__.
Does `Test` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 52 </span> }
<span class="lineno"> 53 </span>})
<span class="lineno"> 54 </span>
<span class="lineno"> 55 </span><span class="error">private class Test : Rule() {</span>
<span class="lineno"> 56 </span><span class="error"> override val issue: Issue = Issue("Test", Severity.Style, "", Debt.FIVE_MINS)</span>
<span class="lineno"> 57 </span><span class="error"> override fun visit(root: KtFile) {</span>
<span class="lineno"> 58 </span><span class="error"> report(CodeSmell(issue, Entity.from(root), ""))</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/test/kotlin/io/gitlab/arturbosch/detekt/api/SuppressionSpec.kt:239:13</span><span class="message">The class `ThisMultiRule` is using inheritance, consider using composition instead.
Does `ThisMultiRule` want to expose the complete interface (`runIfActive, postVisit, preVisit, visitCondition`) of `MultiRule` such that `ThisMultiRule` can be used where `MultiRule` is expected? Indicates __inheritance__.
Does `ThisMultiRule` want only some/part of the behavior exposed by `MultiRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 236 </span> }
<span class="lineno"> 237 </span>
<span class="lineno"> 238 </span> context("MultiRule") {
<span class="lineno"> 239 </span> <span class="error">class ThisMultiRule : MultiRule() {</span>
<span class="lineno"> 240 </span><span class="error"> override val rules: List<Rule> = listOf(TestLPL(config))</span>
<span class="lineno"> 241 </span><span class="error"> }</span>
<span class="lineno"> 242 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/test/kotlin/io/gitlab/arturbosch/detekt/api/SuppressionSpec.kt:258:1</span><span class="message">The class `TestRule` is using inheritance, consider using composition instead.
Does `TestRule` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `TestRule` can be used where `Rule` is expected? Indicates __inheritance__.
Does `TestRule` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 255 </span> }
<span class="lineno"> 256 </span>})
<span class="lineno"> 257 </span>
<span class="lineno"> 258 </span><span class="error">class TestRule(config: Config = Config.empty) : Rule(config) {</span>
<span class="lineno"> 259 </span><span class="error"> override val issue = Issue("Test", Severity.CodeSmell, "", Debt.TWENTY_MINS)</span>
<span class="lineno"> 260 </span><span class="error"> var expected: String? = "Test"</span>
<span class="lineno"> 261 </span><span class="error"> override fun visitClassOrObject(classOrObject: KtClassOrObject) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/test/kotlin/io/gitlab/arturbosch/detekt/api/SuppressionSpec.kt:266:1</span><span class="message">The class `TestLM` is using inheritance, consider using composition instead.
Does `TestLM` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `TestLM` can be used where `Rule` is expected? Indicates __inheritance__.
Does `TestLM` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 263 </span> }
<span class="lineno"> 264 </span>}
<span class="lineno"> 265 </span>
<span class="lineno"> 266 </span><span class="error">class TestLM : Rule() {</span>
<span class="lineno"> 267 </span><span class="error"> override val issue = Issue("LongMethod", Severity.CodeSmell, "", Debt.TWENTY_MINS)</span>
<span class="lineno"> 268 </span><span class="error"> override fun visitNamedFunction(function: KtNamedFunction) {</span>
<span class="lineno"> 269 </span><span class="error"> @Suppress("UnsafeCallOnNullableType")</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-api/src/test/kotlin/io/gitlab/arturbosch/detekt/api/SuppressionSpec.kt:277:1</span><span class="message">The class `TestLPL` is using inheritance, consider using composition instead.
Does `TestLPL` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `TestLPL` can be used where `Rule` is expected? Indicates __inheritance__.
Does `TestLPL` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 274 </span> }
<span class="lineno"> 275 </span>}
<span class="lineno"> 276 </span>
<span class="lineno"> 277 </span><span class="error">class TestLPL(config: Config = Config.empty) : Rule(config) {</span>
<span class="lineno"> 278 </span><span class="error"> override val issue = Issue("LongParameterList", Severity.CodeSmell, "", Debt.TWENTY_MINS)</span>
<span class="lineno"> 279 </span><span class="error"> override fun visitNamedFunction(function: KtNamedFunction) {</span>
<span class="lineno"> 280 </span><span class="error"> val size = function.valueParameters.size</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/baseline/IndentingXMLStreamWriter.kt:6:1</span><span class="message">The class `IndentingXMLStreamWriter` is using inheritance, consider using composition instead.
Does `IndentingXMLStreamWriter` want to expose the complete interface (`empty public interface`) of `DelegatingXMLStreamWriter` such that `IndentingXMLStreamWriter` can be used where `DelegatingXMLStreamWriter` is expected? Indicates __inheritance__.
Does `IndentingXMLStreamWriter` want only some/part of the behavior exposed by `DelegatingXMLStreamWriter`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import java.util.Stack
<span class="lineno"> 4 </span>import javax.xml.stream.XMLStreamWriter
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">@Suppress("TooManyFunctions")</span>
<span class="lineno"> 7 </span><span class="error">class IndentingXMLStreamWriter(</span>
<span class="lineno"> 8 </span><span class="error"> writer: XMLStreamWriter,</span>
<span class="lineno"> 9 </span><span class="error"> private val indent: String = " "</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/console/ComplexityReport.kt:6:1</span><span class="message">The class `ComplexityReport` is using inheritance, consider using composition instead.
Does `ComplexityReport` want to expose the complete interface (`render, print`) of `ConsoleReport` such that `ComplexityReport` can be used where `ConsoleReport` is expected? Indicates __inheritance__.
Does `ComplexityReport` want only some/part of the behavior exposed by `ConsoleReport`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.ConsoleReport
<span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Detektion
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">class ComplexityReport : ConsoleReport() {</span>
<span class="lineno"> 7 </span><span class="error"></span>
<span class="lineno"> 8 </span><span class="error"> override val priority: Int = 20</span>
<span class="lineno"> 9 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/console/FileBasedFindingsReport.kt:9:1</span><span class="message">The class `FileBasedFindingsReport` is using inheritance, consider using composition instead.
Does `FileBasedFindingsReport` want to expose the complete interface (`render, print`) of `ConsoleReport` such that `FileBasedFindingsReport` can be used where `ConsoleReport` is expected? Indicates __inheritance__.
Does `FileBasedFindingsReport` want only some/part of the behavior exposed by `ConsoleReport`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 6 </span>import io.gitlab.arturbosch.detekt.api.SingleAssign
<span class="lineno"> 7 </span>import io.gitlab.arturbosch.detekt.cli.filterEmptyIssues
<span class="lineno"> 8 </span>
<span class="lineno"> 9 </span><span class="error">class FileBasedFindingsReport : ConsoleReport() {</span>
<span class="lineno"> 10 </span><span class="error"></span>
<span class="lineno"> 11 </span><span class="error"> private var config: Config by SingleAssign()</span>
<span class="lineno"> 12 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/console/FindingsReport.kt:9:1</span><span class="message">The class `FindingsReport` is using inheritance, consider using composition instead.
Does `FindingsReport` want to expose the complete interface (`render, print`) of `ConsoleReport` such that `FindingsReport` can be used where `ConsoleReport` is expected? Indicates __inheritance__.
Does `FindingsReport` want only some/part of the behavior exposed by `ConsoleReport`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 6 </span>import io.gitlab.arturbosch.detekt.api.SingleAssign
<span class="lineno"> 7 </span>import io.gitlab.arturbosch.detekt.cli.filterEmptyIssues
<span class="lineno"> 8 </span>
<span class="lineno"> 9 </span><span class="error">class FindingsReport : ConsoleReport() {</span>
<span class="lineno"> 10 </span><span class="error"></span>
<span class="lineno"> 11 </span><span class="error"> private var config: Config by SingleAssign()</span>
<span class="lineno"> 12 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/console/NotificationReport.kt:6:1</span><span class="message">The class `NotificationReport` is using inheritance, consider using composition instead.
Does `NotificationReport` want to expose the complete interface (`render, print`) of `ConsoleReport` such that `NotificationReport` can be used where `ConsoleReport` is expected? Indicates __inheritance__.
Does `NotificationReport` want only some/part of the behavior exposed by `ConsoleReport`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.ConsoleReport
<span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Detektion
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">class NotificationReport : ConsoleReport() {</span>
<span class="lineno"> 7 </span><span class="error"></span>
<span class="lineno"> 8 </span><span class="error"> // Print notifications before the build failure report but after all other reports.</span>
<span class="lineno"> 9 </span><span class="error"> // This allows to compute intermediate messages based on detekt results and do not rely on 'println'.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/console/ProjectStatisticsReport.kt:6:1</span><span class="message">The class `ProjectStatisticsReport` is using inheritance, consider using composition instead.
Does `ProjectStatisticsReport` want to expose the complete interface (`render, print`) of `ConsoleReport` such that `ProjectStatisticsReport` can be used where `ConsoleReport` is expected? Indicates __inheritance__.
Does `ProjectStatisticsReport` want only some/part of the behavior exposed by `ConsoleReport`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.ConsoleReport
<span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Detektion
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">class ProjectStatisticsReport : ConsoleReport() {</span>
<span class="lineno"> 7 </span><span class="error"></span>
<span class="lineno"> 8 </span><span class="error"> override val priority: Int = 10</span>
<span class="lineno"> 9 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/out/HtmlOutputReport.kt:39:1</span><span class="message">The class `HtmlOutputReport` is using inheritance, consider using composition instead.
Does `HtmlOutputReport` want to expose the complete interface (`render, write`) of `OutputReport` such that `HtmlOutputReport` can be used where `OutputReport` is expected? Indicates __inheritance__.
Does `HtmlOutputReport` want only some/part of the behavior exposed by `OutputReport`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 36 </span>private const val PLACEHOLDER_VERSION = "@@@version@@@"
<span class="lineno"> 37 </span>private const val PLACEHOLDER_DATE = "@@@date@@@"
<span class="lineno"> 38 </span>
<span class="lineno"> 39 </span><span class="error">/**</span>
<span class="lineno"> 40 </span><span class="error"> * Generates a HTML report containing rule violations and metrics.</span>
<span class="lineno"> 41 </span><span class="error"> */</span>
<span class="lineno"> 42 </span><span class="error">class HtmlOutputReport : OutputReport() {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/out/TxtOutputReport.kt:6:1</span><span class="message">The class `TxtOutputReport` is using inheritance, consider using composition instead.
Does `TxtOutputReport` want to expose the complete interface (`render, write`) of `OutputReport` such that `TxtOutputReport` can be used where `OutputReport` is expected? Indicates __inheritance__.
Does `TxtOutputReport` want only some/part of the behavior exposed by `OutputReport`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.Detektion
<span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.OutputReport
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">class TxtOutputReport : OutputReport() {</span>
<span class="lineno"> 7 </span><span class="error"></span>
<span class="lineno"> 8 </span><span class="error"> override val ending: String = "txt"</span>
<span class="lineno"> 9 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/out/XmlOutputReport.kt:8:1</span><span class="message">The class `XmlOutputReport` is using inheritance, consider using composition instead.
Does `XmlOutputReport` want to expose the complete interface (`render, write`) of `OutputReport` such that `XmlOutputReport` can be used where `OutputReport` is expected? Indicates __inheritance__.
Does `XmlOutputReport` want only some/part of the behavior exposed by `OutputReport`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.api.OutputReport
<span class="lineno"> 6 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 7 </span>
<span class="lineno"> 8 </span><span class="error">/**</span>
<span class="lineno"> 9 </span><span class="error"> * Generates an XML report following the structure of a Checkstyle report.</span>
<span class="lineno"> 10 </span><span class="error"> */</span>
<span class="lineno"> 11 </span><span class="error">class XmlOutputReport : OutputReport() {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/runners/ElementPrinter.kt:11:1</span><span class="message">The class `ElementPrinter` is using inheritance, consider using composition instead.
Does `ElementPrinter` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `ElementPrinter` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `ElementPrinter` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 8 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 9 </span>import org.jetbrains.kotlin.psi.KtStatementExpression
<span class="lineno"> 10 </span>
<span class="lineno"> 11 </span><span class="error">class ElementPrinter : DetektVisitor() {</span>
<span class="lineno"> 12 </span><span class="error"></span>
<span class="lineno"> 13 </span><span class="error"> companion object {</span>
<span class="lineno"> 14 </span><span class="error"> fun dump(file: KtFile): String = ElementPrinter().run {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/test/kotlin/io/gitlab/arturbosch/detekt/cli/out/ReportsSpec.kt:103:1</span><span class="message">The class `TestOutputReport` is using inheritance, consider using composition instead.
Does `TestOutputReport` want to expose the complete interface (`render, write`) of `OutputReport` such that `TestOutputReport` can be used where `OutputReport` is expected? Indicates __inheritance__.
Does `TestOutputReport` want only some/part of the behavior exposed by `OutputReport`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 100 </span> }
<span class="lineno"> 101 </span>})
<span class="lineno"> 102 </span>
<span class="lineno"> 103 </span><span class="error">internal class TestOutputReport : OutputReport() {</span>
<span class="lineno"> 104 </span><span class="error"> override val ending: String = "yml"</span>
<span class="lineno"> 105 </span><span class="error"> override fun render(detektion: Detektion): String? {</span>
<span class="lineno"> 106 </span><span class="error"> throw UnsupportedOperationException("not implemented")</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-cli/src/test/kotlin/io/gitlab/arturbosch/detekt/cli/runners/TestRules.kt:19:1</span><span class="message">The class `TestRule` is using inheritance, consider using composition instead.
Does `TestRule` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `TestRule` can be used where `Rule` is expected? Indicates __inheritance__.
Does `TestRule` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 16 </span> override fun instance(config: Config): RuleSet = RuleSet(ruleSetId, listOf(TestRule()))
<span class="lineno"> 17 </span>}
<span class="lineno"> 18 </span>
<span class="lineno"> 19 </span><span class="error">class TestRule : Rule() {</span>
<span class="lineno"> 20 </span><span class="error"> override val issue = Issue("test", Severity.Minor, "", Debt.FIVE_MINS)</span>
<span class="lineno"> 21 </span><span class="error"> override fun visitClass(klass: KtClass) {</span>
<span class="lineno"> 22 </span><span class="error"> if (klass.name == "Poko") {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/AbstractProjectMetricProcessor.kt:7:1</span><span class="message">The class `AbstractProjectMetricProcessor` is using inheritance, consider using composition instead.
Does `AbstractProjectMetricProcessor` want to expose the complete interface (`onFinish, onProcess`) of `AbstractProcessor` such that `AbstractProjectMetricProcessor` can be used where `AbstractProcessor` is expected? Indicates __inheritance__.
Does `AbstractProjectMetricProcessor` want only some/part of the behavior exposed by `AbstractProcessor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.ProjectMetric
<span class="lineno"> 5 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">abstract class AbstractProjectMetricProcessor : AbstractProcessor() {</span>
<span class="lineno"> 8 </span><span class="error"></span>
<span class="lineno"> 9 </span><span class="error"> val type: String get() = key.toString()</span>
<span class="lineno"> 10 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/ClassCountProcessor.kt:9:1</span><span class="message">The class `ClassCountProcessor` is using inheritance, consider using composition instead.
Does `ClassCountProcessor` want to expose the complete interface (`onFinish`) of `AbstractProjectMetricProcessor` such that `ClassCountProcessor` can be used where `AbstractProjectMetricProcessor` is expected? Indicates __inheritance__.
Does `ClassCountProcessor` want only some/part of the behavior exposed by `AbstractProjectMetricProcessor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 6 </span>import org.jetbrains.kotlin.psi.KtClass
<span class="lineno"> 7 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 8 </span>
<span class="lineno"> 9 </span><span class="error">class ClassCountProcessor : AbstractProjectMetricProcessor() {</span>
<span class="lineno"> 10 </span><span class="error"></span>
<span class="lineno"> 11 </span><span class="error"> override val visitor = ClassCountVisitor()</span>
<span class="lineno"> 12 </span><span class="error"> override val key = numberOfClassesKey</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/ClassCountProcessor.kt:17:1</span><span class="message">The class `ClassCountVisitor` is using inheritance, consider using composition instead.
Does `ClassCountVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `ClassCountVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `ClassCountVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>
<span class="lineno"> 15 </span>val numberOfClassesKey = Key<Int>("number of classes")
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">class ClassCountVisitor : DetektVisitor() {</span>
<span class="lineno"> 18 </span><span class="error"></span>
<span class="lineno"> 19 </span><span class="error"> override fun visitKtFile(file: KtFile) {</span>
<span class="lineno"> 20 </span><span class="error"> super.visitKtFile(file)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/FunctionCountProcessor.kt:9:1</span><span class="message">The class `FunctionCountProcessor` is using inheritance, consider using composition instead.
Does `FunctionCountProcessor` want to expose the complete interface (`onFinish`) of `AbstractProjectMetricProcessor` such that `FunctionCountProcessor` can be used where `AbstractProjectMetricProcessor` is expected? Indicates __inheritance__.
Does `FunctionCountProcessor` want only some/part of the behavior exposed by `AbstractProjectMetricProcessor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 6 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 7 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 8 </span>
<span class="lineno"> 9 </span><span class="error">class FunctionCountProcessor : AbstractProjectMetricProcessor() {</span>
<span class="lineno"> 10 </span><span class="error"></span>
<span class="lineno"> 11 </span><span class="error"> override val visitor = FunctionCountVisitor()</span>
<span class="lineno"> 12 </span><span class="error"> override val key = numberOfFunctionsKey</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/FunctionCountProcessor.kt:17:1</span><span class="message">The class `FunctionCountVisitor` is using inheritance, consider using composition instead.
Does `FunctionCountVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `FunctionCountVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `FunctionCountVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>
<span class="lineno"> 15 </span>val numberOfFunctionsKey = Key<Int>("number of functions")
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">class FunctionCountVisitor : DetektVisitor() {</span>
<span class="lineno"> 18 </span><span class="error"></span>
<span class="lineno"> 19 </span><span class="error"> override fun visitKtFile(file: KtFile) {</span>
<span class="lineno"> 20 </span><span class="error"> super.visitKtFile(file)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/KtFileCountProcessor.kt:7:1</span><span class="message">The class `KtFileCountProcessor` is using inheritance, consider using composition instead.
Does `KtFileCountProcessor` want to expose the complete interface (`onFinish`) of `AbstractProjectMetricProcessor` such that `KtFileCountProcessor` can be used where `AbstractProjectMetricProcessor` is expected? Indicates __inheritance__.
Does `KtFileCountProcessor` want only some/part of the behavior exposed by `AbstractProjectMetricProcessor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import org.jetbrains.kotlin.com.intellij.openapi.util.Key
<span class="lineno"> 5 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">class KtFileCountProcessor : AbstractProjectMetricProcessor() {</span>
<span class="lineno"> 8 </span><span class="error"></span>
<span class="lineno"> 9 </span><span class="error"> override val visitor = KtFileCountVisitor()</span>
<span class="lineno"> 10 </span><span class="error"> override val key = numberOfFilesKey</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/KtFileCountProcessor.kt:15:1</span><span class="message">The class `KtFileCountVisitor` is using inheritance, consider using composition instead.
Does `KtFileCountVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `KtFileCountVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `KtFileCountVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 12 </span>
<span class="lineno"> 13 </span>val numberOfFilesKey = Key<Int>("number of kt files")
<span class="lineno"> 14 </span>
<span class="lineno"> 15 </span><span class="error">class KtFileCountVisitor : DetektVisitor() {</span>
<span class="lineno"> 16 </span><span class="error"> override fun visitKtFile(file: KtFile) {</span>
<span class="lineno"> 17 </span><span class="error"> file.putUserData(numberOfFilesKey, 1)</span>
<span class="lineno"> 18 </span><span class="error"> }</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/PackageCountProcessor.kt:30:1</span><span class="message">The class `PackageCountVisitor` is using inheritance, consider using composition instead.
Does `PackageCountVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `PackageCountVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `PackageCountVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 27 </span>
<span class="lineno"> 28 </span>val numberOfPackagesKey = Key<String>("number of packages")
<span class="lineno"> 29 </span>
<span class="lineno"> 30 </span><span class="error">class PackageCountVisitor : DetektVisitor() {</span>
<span class="lineno"> 31 </span><span class="error"></span>
<span class="lineno"> 32 </span><span class="error"> override fun visitKtFile(file: KtFile) {</span>
<span class="lineno"> 33 </span><span class="error"> val packageName = file.packageFqNameByTree.toString()</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/ProjectCLOCProcessor.kt:9:1</span><span class="message">The class `ProjectCLOCProcessor` is using inheritance, consider using composition instead.
Does `ProjectCLOCProcessor` want to expose the complete interface (`onFinish, onProcess`) of `AbstractProcessor` such that `ProjectCLOCProcessor` can be used where `AbstractProcessor` is expected? Indicates __inheritance__.
Does `ProjectCLOCProcessor` want only some/part of the behavior exposed by `AbstractProcessor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 6 </span>import org.jetbrains.kotlin.psi.KtDeclaration
<span class="lineno"> 7 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 8 </span>
<span class="lineno"> 9 </span><span class="error">class ProjectCLOCProcessor : AbstractProcessor() {</span>
<span class="lineno"> 10 </span><span class="error"></span>
<span class="lineno"> 11 </span><span class="error"> override val key = commentLinesKey</span>
<span class="lineno"> 12 </span><span class="error"> override val visitor = CLOCVisitor()</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/ProjectCLOCProcessor.kt:17:1</span><span class="message">The class `CLOCVisitor` is using inheritance, consider using composition instead.
Does `CLOCVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `CLOCVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `CLOCVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>
<span class="lineno"> 15 </span>val commentLinesKey = Key<Int>("cloc")
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">class CLOCVisitor : DetektVisitor() {</span>
<span class="lineno"> 18 </span><span class="error"></span>
<span class="lineno"> 19 </span><span class="error"> override fun visitKtFile(file: KtFile) {</span>
<span class="lineno"> 20 </span><span class="error"> with(CLOCCountVisitor()) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/ProjectCLOCProcessor.kt:27:1</span><span class="message">The class `CLOCCountVisitor` is using inheritance, consider using composition instead.
Does `CLOCCountVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `CLOCCountVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `CLOCCountVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 24 </span> }
<span class="lineno"> 25 </span>}
<span class="lineno"> 26 </span>
<span class="lineno"> 27 </span><span class="error">internal class CLOCCountVisitor : DetektVisitor() {</span>
<span class="lineno"> 28 </span><span class="error"></span>
<span class="lineno"> 29 </span><span class="error"> internal var count = 0</span>
<span class="lineno"> 30 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/ProjectComplexityProcessor.kt:8:1</span><span class="message">The class `ProjectComplexityProcessor` is using inheritance, consider using composition instead.
Does `ProjectComplexityProcessor` want to expose the complete interface (`onFinish, onProcess`) of `AbstractProcessor` such that `ProjectComplexityProcessor` can be used where `AbstractProcessor` is expected? Indicates __inheritance__.
Does `ProjectComplexityProcessor` want only some/part of the behavior exposed by `AbstractProcessor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 5 </span>import org.jetbrains.kotlin.com.intellij.openapi.util.Key
<span class="lineno"> 6 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 7 </span>
<span class="lineno"> 8 </span><span class="error">class ProjectComplexityProcessor : AbstractProcessor() {</span>
<span class="lineno"> 9 </span><span class="error"></span>
<span class="lineno"> 10 </span><span class="error"> override val visitor = ComplexityVisitor()</span>
<span class="lineno"> 11 </span><span class="error"> override val key = complexityKey</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/ProjectComplexityProcessor.kt:16:1</span><span class="message">The class `ComplexityVisitor` is using inheritance, consider using composition instead.
Does `ComplexityVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `ComplexityVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `ComplexityVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>
<span class="lineno"> 14 </span>val complexityKey = Key<Int>("complexity")
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">class ComplexityVisitor : DetektVisitor() {</span>
<span class="lineno"> 17 </span><span class="error"></span>
<span class="lineno"> 18 </span><span class="error"> override fun visitKtFile(file: KtFile) {</span>
<span class="lineno"> 19 </span><span class="error"> val complexity = CyclomaticComplexity.calculate(file) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/ProjectLLOCProcessor.kt:8:1</span><span class="message">The class `ProjectLLOCProcessor` is using inheritance, consider using composition instead.
Does `ProjectLLOCProcessor` want to expose the complete interface (`onFinish, onProcess`) of `AbstractProcessor` such that `ProjectLLOCProcessor` can be used where `AbstractProcessor` is expected? Indicates __inheritance__.
Does `ProjectLLOCProcessor` want only some/part of the behavior exposed by `AbstractProcessor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 5 </span>import org.jetbrains.kotlin.com.intellij.openapi.util.Key
<span class="lineno"> 6 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 7 </span>
<span class="lineno"> 8 </span><span class="error">class ProjectLLOCProcessor : AbstractProcessor() {</span>
<span class="lineno"> 9 </span><span class="error"></span>
<span class="lineno"> 10 </span><span class="error"> override val visitor = LLOCVisitor()</span>
<span class="lineno"> 11 </span><span class="error"> override val key = logicalLinesKey</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/ProjectLLOCProcessor.kt:16:1</span><span class="message">The class `LLOCVisitor` is using inheritance, consider using composition instead.
Does `LLOCVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `LLOCVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `LLOCVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>
<span class="lineno"> 14 </span>val logicalLinesKey = Key<Int>("lloc")
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">class LLOCVisitor : DetektVisitor() {</span>
<span class="lineno"> 17 </span><span class="error"></span>
<span class="lineno"> 18 </span><span class="error"> override fun visitKtFile(file: KtFile) {</span>
<span class="lineno"> 19 </span><span class="error"> val lines = file.text.split("\n")</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/ProjectLOCProcessor.kt:7:1</span><span class="message">The class `ProjectLOCProcessor` is using inheritance, consider using composition instead.
Does `ProjectLOCProcessor` want to expose the complete interface (`onFinish, onProcess`) of `AbstractProcessor` such that `ProjectLOCProcessor` can be used where `AbstractProcessor` is expected? Indicates __inheritance__.
Does `ProjectLOCProcessor` want only some/part of the behavior exposed by `AbstractProcessor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import org.jetbrains.kotlin.com.intellij.openapi.util.Key
<span class="lineno"> 5 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">class ProjectLOCProcessor : AbstractProcessor() {</span>
<span class="lineno"> 8 </span><span class="error"></span>
<span class="lineno"> 9 </span><span class="error"> override val visitor: DetektVisitor = LOCVisitor()</span>
<span class="lineno"> 10 </span><span class="error"> override val key = linesKey</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/ProjectLOCProcessor.kt:13:1</span><span class="message">The class `LOCVisitor` is using inheritance, consider using composition instead.
Does `LOCVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `LOCVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `LOCVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span> override val key = linesKey
<span class="lineno"> 11 </span>}
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">class LOCVisitor : DetektVisitor() {</span>
<span class="lineno"> 14 </span><span class="error"></span>
<span class="lineno"> 15 </span><span class="error"> override fun visitKtFile(file: KtFile) {</span>
<span class="lineno"> 16 </span><span class="error"> val lines = file.text.count { it == '\n' } + 1</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/ProjectSLOCProcessor.kt:7:1</span><span class="message">The class `ProjectSLOCProcessor` is using inheritance, consider using composition instead.
Does `ProjectSLOCProcessor` want to expose the complete interface (`onFinish, onProcess`) of `AbstractProcessor` such that `ProjectSLOCProcessor` can be used where `AbstractProcessor` is expected? Indicates __inheritance__.
Does `ProjectSLOCProcessor` want only some/part of the behavior exposed by `AbstractProcessor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import org.jetbrains.kotlin.com.intellij.openapi.util.Key
<span class="lineno"> 5 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">class ProjectSLOCProcessor : AbstractProcessor() {</span>
<span class="lineno"> 8 </span><span class="error"></span>
<span class="lineno"> 9 </span><span class="error"> override val visitor: DetektVisitor = SLOCVisitor()</span>
<span class="lineno"> 10 </span><span class="error"> override val key: Key<Int> = sourceLinesKey</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/ProjectSLOCProcessor.kt:13:1</span><span class="message">The class `SLOCVisitor` is using inheritance, consider using composition instead.
Does `SLOCVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `SLOCVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `SLOCVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span> override val key: Key<Int> = sourceLinesKey
<span class="lineno"> 11 </span>}
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">class SLOCVisitor : DetektVisitor() {</span>
<span class="lineno"> 14 </span><span class="error"></span>
<span class="lineno"> 15 </span><span class="error"> override fun visitKtFile(file: KtFile) {</span>
<span class="lineno"> 16 </span><span class="error"> val lines = file.text.split('\n')</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/PropertyCountProcessor.kt:9:1</span><span class="message">The class `PropertyCountProcessor` is using inheritance, consider using composition instead.
Does `PropertyCountProcessor` want to expose the complete interface (`onFinish`) of `AbstractProjectMetricProcessor` such that `PropertyCountProcessor` can be used where `AbstractProjectMetricProcessor` is expected? Indicates __inheritance__.
Does `PropertyCountProcessor` want only some/part of the behavior exposed by `AbstractProjectMetricProcessor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 6 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 7 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 8 </span>
<span class="lineno"> 9 </span><span class="error">class PropertyCountProcessor : AbstractProjectMetricProcessor() {</span>
<span class="lineno"> 10 </span><span class="error"></span>
<span class="lineno"> 11 </span><span class="error"> override val visitor = PropertyCountVisitor()</span>
<span class="lineno"> 12 </span><span class="error"> override val key = numberOfFieldsKey</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/processors/PropertyCountProcessor.kt:17:1</span><span class="message">The class `PropertyCountVisitor` is using inheritance, consider using composition instead.
Does `PropertyCountVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `PropertyCountVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `PropertyCountVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>
<span class="lineno"> 15 </span>val numberOfFieldsKey = Key<Int>("number of properties")
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">class PropertyCountVisitor : DetektVisitor() {</span>
<span class="lineno"> 18 </span><span class="error"></span>
<span class="lineno"> 19 </span><span class="error"> override fun visitKtFile(file: KtFile) {</span>
<span class="lineno"> 20 </span><span class="error"> super.visitKtFile(file)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/test/kotlin/io/gitlab/arturbosch/detekt/core/CorrectableRulesFirstSpec.kt:25:13</span><span class="message">The class `First` is using inheritance, consider using composition instead.
Does `First` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `First` can be used where `Rule` is expected? Indicates __inheritance__.
Does `First` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 22 </span> it("runs rule with id 'NonCorrectable' last") {
<span class="lineno"> 23 </span> var actualLastRuleId = ""
<span class="lineno"> 24 </span>
<span class="lineno"> 25 </span> <span class="error">class First(config: Config) : Rule(config) {</span>
<span class="lineno"> 26 </span><span class="error"> override val issue: Issue = justAnIssue.copy(id = "NonCorrectable")</span>
<span class="lineno"> 27 </span><span class="error"> override fun visitClass(klass: KtClass) {</span>
<span class="lineno"> 28 </span><span class="error"> actualLastRuleId = issue.id</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/test/kotlin/io/gitlab/arturbosch/detekt/core/CorrectableRulesFirstSpec.kt:32:13</span><span class="message">The class `Last` is using inheritance, consider using composition instead.
Does `Last` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `Last` can be used where `Rule` is expected? Indicates __inheritance__.
Does `Last` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 29 </span> }
<span class="lineno"> 30 </span> }
<span class="lineno"> 31 </span>
<span class="lineno"> 32 </span> <span class="error">class Last(config: Config) : Rule(config) {</span>
<span class="lineno"> 33 </span><span class="error"> override val issue: Issue = justAnIssue.copy(id = "Correctable")</span>
<span class="lineno"> 34 </span><span class="error"> override fun visitClass(klass: KtClass) {</span>
<span class="lineno"> 35 </span><span class="error"> actualLastRuleId = issue.id</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-core/src/test/kotlin/io/gitlab/arturbosch/detekt/core/KT.kt:31:1</span><span class="message">The class `FindName` is using inheritance, consider using composition instead.
Does `FindName` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `FindName` can be used where `Rule` is expected? Indicates __inheritance__.
Does `FindName` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 28 </span> }
<span class="lineno"> 29 </span>}
<span class="lineno"> 30 </span>
<span class="lineno"> 31 </span><span class="error">class FindName : Rule() {</span>
<span class="lineno"> 32 </span><span class="error"> override val issue: Issue = Issue(javaClass.simpleName, Severity.Minor, "", Debt.TWENTY_MINS)</span>
<span class="lineno"> 33 </span><span class="error"> override fun visitClassOrObject(classOrObject: KtClassOrObject) {</span>
<span class="lineno"> 34 </span><span class="error"> report(CodeSmell(issue, Entity.atName(classOrObject), message = ""))</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/FormattingRule.kt:24:1</span><span class="message">The class `FormattingRule` is using inheritance, consider using composition instead.
Does `FormattingRule` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `FormattingRule` can be used where `Rule` is expected? Indicates __inheritance__.
Does `FormattingRule` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 21 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 22 </span>import org.jetbrains.kotlin.psi.psiUtil.endOffset
<span class="lineno"> 23 </span>
<span class="lineno"> 24 </span><span class="error">/**</span>
<span class="lineno"> 25 </span><span class="error"> * Rule to detect formatting violations.</span>
<span class="lineno"> 26 </span><span class="error"> */</span>
<span class="lineno"> 27 </span><span class="error">abstract class FormattingRule(config: Config) : Rule(config) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/KtLintMultiRule.kt:45:1</span><span class="message">The class `KtLintMultiRule` is using inheritance, consider using composition instead.
Does `KtLintMultiRule` want to expose the complete interface (`runIfActive, postVisit, preVisit, visitCondition`) of `MultiRule` such that `KtLintMultiRule` can be used where `MultiRule` is expected? Indicates __inheritance__.
Does `KtLintMultiRule` want only some/part of the behavior exposed by `MultiRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 42 </span>import org.jetbrains.kotlin.com.intellij.psi.impl.source.JavaDummyHolder
<span class="lineno"> 43 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 44 </span>
<span class="lineno"> 45 </span><span class="error">/**</span>
<span class="lineno"> 46 </span><span class="error"> * Runs all KtLint rules.</span>
<span class="lineno"> 47 </span><span class="error"> */</span>
<span class="lineno"> 48 </span><span class="error">class KtLintMultiRule(config: Config = Config.empty) : MultiRule() {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/AnnotationOnSeparateLine.kt:7:1</span><span class="message">The class `AnnotationOnSeparateLine` is using inheritance, consider using composition instead.
Does `AnnotationOnSeparateLine` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `AnnotationOnSeparateLine` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `AnnotationOnSeparateLine` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @autoCorrect since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/ChainWrapping.kt:7:1</span><span class="message">The class `ChainWrapping` is using inheritance, consider using composition instead.
Does `ChainWrapping` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `ChainWrapping` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `ChainWrapping` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/CommentSpacing.kt:7:1</span><span class="message">The class `CommentSpacing` is using inheritance, consider using composition instead.
Does `CommentSpacing` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `CommentSpacing` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `CommentSpacing` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/EnumEntryNameCase.kt:7:1</span><span class="message">The class `EnumEntryNameCase` is using inheritance, consider using composition instead.
Does `EnumEntryNameCase` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `EnumEntryNameCase` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `EnumEntryNameCase` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @autoCorrect since v1.4.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/Filename.kt:7:1</span><span class="message">The class `Filename` is using inheritance, consider using composition instead.
Does `Filename` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `Filename` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `Filename` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/FinalNewline.kt:9:1</span><span class="message">The class `FinalNewline` is using inheritance, consider using composition instead.
Does `FinalNewline` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `FinalNewline` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `FinalNewline` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 6 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 7 </span>import io.gitlab.arturbosch.detekt.formatting.merge
<span class="lineno"> 8 </span>
<span class="lineno"> 9 </span><span class="error">/**</span>
<span class="lineno"> 10 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 11 </span><span class="error"> *</span>
<span class="lineno"> 12 </span><span class="error"> * @configuration insertFinalNewLine - report absence or presence of a newline (default: `true`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/ImportOrdering.kt:7:1</span><span class="message">The class `ImportOrdering` is using inheritance, consider using composition instead.
Does `ImportOrdering` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `ImportOrdering` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `ImportOrdering` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @autoCorrect since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/Indentation.kt:11:1</span><span class="message">The class `Indentation` is using inheritance, consider using composition instead.
Does `Indentation` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `Indentation` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `Indentation` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 8 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.formatting.merge
<span class="lineno"> 10 </span>
<span class="lineno"> 11 </span><span class="error">/**</span>
<span class="lineno"> 12 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-indentation">ktlint-website</a> for documentation.</span>
<span class="lineno"> 13 </span><span class="error"> *</span>
<span class="lineno"> 14 </span><span class="error"> * @configuration indentSize - indentation size (default: `4`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/MaximumLineLength.kt:11:1</span><span class="message">The class `MaximumLineLength` is using inheritance, consider using composition instead.
Does `MaximumLineLength` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `MaximumLineLength` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `MaximumLineLength` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 8 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.formatting.merge
<span class="lineno"> 10 </span>
<span class="lineno"> 11 </span><span class="error">/**</span>
<span class="lineno"> 12 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 13 </span><span class="error"> *</span>
<span class="lineno"> 14 </span><span class="error"> * @configuration maxLineLength - maximum line length (default: `120`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/ModifierOrdering.kt:7:1</span><span class="message">The class `ModifierOrdering` is using inheritance, consider using composition instead.
Does `ModifierOrdering` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `ModifierOrdering` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `ModifierOrdering` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-modifier-order">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/MultiLineIfElse.kt:7:1</span><span class="message">The class `MultiLineIfElse` is using inheritance, consider using composition instead.
Does `MultiLineIfElse` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `MultiLineIfElse` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `MultiLineIfElse` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-modifier-order">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/NoBlankLineBeforeRbrace.kt:7:1</span><span class="message">The class `NoBlankLineBeforeRbrace` is using inheritance, consider using composition instead.
Does `NoBlankLineBeforeRbrace` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `NoBlankLineBeforeRbrace` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `NoBlankLineBeforeRbrace` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/NoConsecutiveBlankLines.kt:7:1</span><span class="message">The class `NoConsecutiveBlankLines` is using inheritance, consider using composition instead.
Does `NoConsecutiveBlankLines` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `NoConsecutiveBlankLines` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `NoConsecutiveBlankLines` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-blank">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/NoEmptyClassBody.kt:7:1</span><span class="message">The class `NoEmptyClassBody` is using inheritance, consider using composition instead.
Does `NoEmptyClassBody` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `NoEmptyClassBody` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `NoEmptyClassBody` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-empty-class-body">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/NoEmptyFirstLineInMethodBlock.kt:7:1</span><span class="message">The class `NoEmptyFirstLineInMethodBlock` is using inheritance, consider using composition instead.
Does `NoEmptyFirstLineInMethodBlock` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `NoEmptyFirstLineInMethodBlock` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `NoEmptyFirstLineInMethodBlock` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @autoCorrect since v1.4.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/NoLineBreakAfterElse.kt:7:1</span><span class="message">The class `NoLineBreakAfterElse` is using inheritance, consider using composition instead.
Does `NoLineBreakAfterElse` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `NoLineBreakAfterElse` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `NoLineBreakAfterElse` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/NoLineBreakBeforeAssignment.kt:7:1</span><span class="message">The class `NoLineBreakBeforeAssignment` is using inheritance, consider using composition instead.
Does `NoLineBreakBeforeAssignment` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `NoLineBreakBeforeAssignment` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `NoLineBreakBeforeAssignment` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/NoMultipleSpaces.kt:7:1</span><span class="message">The class `NoMultipleSpaces` is using inheritance, consider using composition instead.
Does `NoMultipleSpaces` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `NoMultipleSpaces` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `NoMultipleSpaces` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/NoSemicolons.kt:7:1</span><span class="message">The class `NoSemicolons` is using inheritance, consider using composition instead.
Does `NoSemicolons` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `NoSemicolons` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `NoSemicolons` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-semi">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/NoTrailingSpaces.kt:7:1</span><span class="message">The class `NoTrailingSpaces` is using inheritance, consider using composition instead.
Does `NoTrailingSpaces` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `NoTrailingSpaces` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `NoTrailingSpaces` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-trailing-whitespaces">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/NoUnitReturn.kt:7:1</span><span class="message">The class `NoUnitReturn` is using inheritance, consider using composition instead.
Does `NoUnitReturn` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `NoUnitReturn` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `NoUnitReturn` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-unit-return">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/NoUnusedImports.kt:7:1</span><span class="message">The class `NoUnusedImports` is using inheritance, consider using composition instead.
Does `NoUnusedImports` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `NoUnusedImports` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `NoUnusedImports` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/NoWildcardImports.kt:7:1</span><span class="message">The class `NoWildcardImports` is using inheritance, consider using composition instead.
Does `NoWildcardImports` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `NoWildcardImports` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `NoWildcardImports` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-import">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/PackageName.kt:7:1</span><span class="message">The class `PackageName` is using inheritance, consider using composition instead.
Does `PackageName` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `PackageName` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `PackageName` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/ParameterListWrapping.kt:10:1</span><span class="message">The class `ParameterListWrapping` is using inheritance, consider using composition instead.
Does `ParameterListWrapping` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `ParameterListWrapping` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `ParameterListWrapping` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 7 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 8 </span>import io.gitlab.arturbosch.detekt.formatting.merge
<span class="lineno"> 9 </span>
<span class="lineno"> 10 </span><span class="error">/**</span>
<span class="lineno"> 11 </span><span class="error"> * See <a href="https://ktlint.github.io">ktlint-website</a> for documentation.</span>
<span class="lineno"> 12 </span><span class="error"> *</span>
<span class="lineno"> 13 </span><span class="error"> * @configuration indentSize - indentation size (default: `4`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/SpacingAroundColon.kt:7:1</span><span class="message">The class `SpacingAroundColon` is using inheritance, consider using composition instead.
Does `SpacingAroundColon` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `SpacingAroundColon` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `SpacingAroundColon` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-spacing">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/SpacingAroundComma.kt:7:1</span><span class="message">The class `SpacingAroundComma` is using inheritance, consider using composition instead.
Does `SpacingAroundComma` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `SpacingAroundComma` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `SpacingAroundComma` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-spacing">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/SpacingAroundCurly.kt:7:1</span><span class="message">The class `SpacingAroundCurly` is using inheritance, consider using composition instead.
Does `SpacingAroundCurly` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `SpacingAroundCurly` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `SpacingAroundCurly` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-spacing">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/SpacingAroundDot.kt:7:1</span><span class="message">The class `SpacingAroundDot` is using inheritance, consider using composition instead.
Does `SpacingAroundDot` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `SpacingAroundDot` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `SpacingAroundDot` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-spacing">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/SpacingAroundKeyword.kt:7:1</span><span class="message">The class `SpacingAroundKeyword` is using inheritance, consider using composition instead.
Does `SpacingAroundKeyword` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `SpacingAroundKeyword` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `SpacingAroundKeyword` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-spacing">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/SpacingAroundOperators.kt:7:1</span><span class="message">The class `SpacingAroundOperators` is using inheritance, consider using composition instead.
Does `SpacingAroundOperators` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `SpacingAroundOperators` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `SpacingAroundOperators` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-spacing">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/SpacingAroundParens.kt:7:1</span><span class="message">The class `SpacingAroundParens` is using inheritance, consider using composition instead.
Does `SpacingAroundParens` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `SpacingAroundParens` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `SpacingAroundParens` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-spacing">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/SpacingAroundRangeOperator.kt:7:1</span><span class="message">The class `SpacingAroundRangeOperator` is using inheritance, consider using composition instead.
Does `SpacingAroundRangeOperator` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `SpacingAroundRangeOperator` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `SpacingAroundRangeOperator` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-spacing">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/StringTemplate.kt:7:1</span><span class="message">The class `StringTemplate` is using inheritance, consider using composition instead.
Does `StringTemplate` want to expose the complete interface (`apply, editorConfigUpdater, visit`) of `FormattingRule` such that `StringTemplate` can be used where `FormattingRule` is expected? Indicates __inheritance__.
Does `StringTemplate` want only some/part of the behavior exposed by `FormattingRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.formatting.FormattingRule
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">/**</span>
<span class="lineno"> 8 </span><span class="error"> * See <a href="https://ktlint.github.io/#rule-string-template">ktlint-website</a> for documentation.</span>
<span class="lineno"> 9 </span><span class="error"> *</span>
<span class="lineno"> 10 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-generator/src/main/kotlin/io/gitlab/arturbosch/detekt/generator/collection/MultiRuleCollector.kt:39:1</span><span class="message">The class `MultiRuleVisitor` is using inheritance, consider using composition instead.
Does `MultiRuleVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `MultiRuleVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `MultiRuleVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 36 </span> }
<span class="lineno"> 37 </span>}
<span class="lineno"> 38 </span>
<span class="lineno"> 39 </span><span class="error">class MultiRuleVisitor : DetektVisitor() {</span>
<span class="lineno"> 40 </span><span class="error"> val containsMultiRule</span>
<span class="lineno"> 41 </span><span class="error"> get() = classesMap.any { it.value }</span>
<span class="lineno"> 42 </span><span class="error"> private var classesMap = mutableMapOf<String, Boolean>()</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-generator/src/main/kotlin/io/gitlab/arturbosch/detekt/generator/collection/MultiRuleCollector.kt:104:1</span><span class="message">The class `RuleListVisitor` is using inheritance, consider using composition instead.
Does `RuleListVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `RuleListVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `RuleListVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 101 </span> }
<span class="lineno"> 102 </span>}
<span class="lineno"> 103 </span>
<span class="lineno"> 104 </span><span class="error">class RuleListVisitor : DetektVisitor() {</span>
<span class="lineno"> 105 </span><span class="error"> var ruleNames: MutableSet<String> = mutableSetOf()</span>
<span class="lineno"> 106 </span><span class="error"> private set</span>
<span class="lineno"> 107 </span><span class="error"> var ruleProperties: MutableSet<String> = mutableSetOf()</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-generator/src/main/kotlin/io/gitlab/arturbosch/detekt/generator/collection/RuleSetProviderCollector.kt:43:1</span><span class="message">The class `RuleSetProviderVisitor` is using inheritance, consider using composition instead.
Does `RuleSetProviderVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `RuleSetProviderVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `RuleSetProviderVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 40 </span>private val SUPPORTED_PROVIDERS =
<span class="lineno"> 41 </span> setOf(RuleSetProvider::class.simpleName, DefaultRuleSetProvider::class.simpleName)
<span class="lineno"> 42 </span>
<span class="lineno"> 43 </span><span class="error">class RuleSetProviderVisitor : DetektVisitor() {</span>
<span class="lineno"> 44 </span><span class="error"> var containsRuleSetProvider = false</span>
<span class="lineno"> 45 </span><span class="error"> private var name: String = ""</span>
<span class="lineno"> 46 </span><span class="error"> private var description: String = ""</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-generator/src/main/kotlin/io/gitlab/arturbosch/detekt/generator/collection/RuleVisitor.kt:21:1</span><span class="message">The class `RuleVisitor` is using inheritance, consider using composition instead.
Does `RuleVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `RuleVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `RuleVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.psiUtil.getSuperNames
<span class="lineno"> 19 </span>import java.lang.reflect.Modifier
<span class="lineno"> 20 </span>
<span class="lineno"> 21 </span><span class="error">internal class RuleVisitor : DetektVisitor() {</span>
<span class="lineno"> 22 </span><span class="error"></span>
<span class="lineno"> 23 </span><span class="error"> val containsRule</span>
<span class="lineno"> 24 </span><span class="error"> get() = classesMap.any { it.value }</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-generator/src/main/kotlin/io/gitlab/arturbosch/detekt/generator/out/AbstractWriter.kt:18:1</span><span class="message">The class `MarkdownWriter` is using inheritance, consider using composition instead.
Does `MarkdownWriter` want to expose the complete interface (`write`) of `AbstractWriter` such that `MarkdownWriter` can be used where `AbstractWriter` is expected? Indicates __inheritance__.
Does `MarkdownWriter` want only some/part of the behavior exposed by `AbstractWriter`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span> }
<span class="lineno"> 16 </span>}
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">internal class MarkdownWriter : AbstractWriter() {</span>
<span class="lineno"> 19 </span><span class="error"></span>
<span class="lineno"> 20 </span><span class="error"> override val ending = "md"</span>
<span class="lineno"> 21 </span><span class="error">}</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-generator/src/main/kotlin/io/gitlab/arturbosch/detekt/generator/out/AbstractWriter.kt:23:1</span><span class="message">The class `YamlWriter` is using inheritance, consider using composition instead.
Does `YamlWriter` want to expose the complete interface (`write`) of `AbstractWriter` such that `YamlWriter` can be used where `AbstractWriter` is expected? Indicates __inheritance__.
Does `YamlWriter` want only some/part of the behavior exposed by `AbstractWriter`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 20 </span> override val ending = "md"
<span class="lineno"> 21 </span>}
<span class="lineno"> 22 </span>
<span class="lineno"> 23 </span><span class="error">internal class YamlWriter : AbstractWriter() {</span>
<span class="lineno"> 24 </span><span class="error"></span>
<span class="lineno"> 25 </span><span class="error"> override val ending = "yml"</span>
<span class="lineno"> 26 </span><span class="error">}</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-generator/src/main/kotlin/io/gitlab/arturbosch/detekt/generator/out/Markdown.kt:15:1</span><span class="message">The class `MarkdownContent` is using inheritance, consider using composition instead.
Does `MarkdownContent` want to expose the complete interface (`append`) of `Markdown` such that `MarkdownContent` can be used where `Markdown` is expected? Indicates __inheritance__.
Does `MarkdownContent` want only some/part of the behavior exposed by `Markdown`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 12 </span> }
<span class="lineno"> 13 </span>}
<span class="lineno"> 14 </span>
<span class="lineno"> 15 </span><span class="error">data class MarkdownContent(override var content: String = "") : Markdown()</span>
<span class="lineno"> 16 </span>data class MarkdownList(override var content: String = "") : Markdown()
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span>inline fun markdown(content: MarkdownContent.() -> Unit): String {
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-generator/src/main/kotlin/io/gitlab/arturbosch/detekt/generator/out/Markdown.kt:16:1</span><span class="message">The class `MarkdownList` is using inheritance, consider using composition instead.
Does `MarkdownList` want to expose the complete interface (`append`) of `Markdown` such that `MarkdownList` can be used where `Markdown` is expected? Indicates __inheritance__.
Does `MarkdownList` want only some/part of the behavior exposed by `Markdown`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>}
<span class="lineno"> 14 </span>
<span class="lineno"> 15 </span>data class MarkdownContent(override var content: String = "") : Markdown()
<span class="lineno"> 16 </span><span class="error">data class MarkdownList(override var content: String = "") : Markdown()</span>
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span>inline fun markdown(content: MarkdownContent.() -> Unit): String {
<span class="lineno"> 19 </span> return MarkdownContent().let { markdown ->
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-generator/src/main/kotlin/io/gitlab/arturbosch/detekt/generator/out/Yaml.kt:25:1</span><span class="message">The class `YamlNode` is using inheritance, consider using composition instead.
Does `YamlNode` want to expose the complete interface (`emptyLine, append`) of `YML` such that `YamlNode` can be used where `YML` is expected? Indicates __inheritance__.
Does `YamlNode` want only some/part of the behavior exposed by `YML`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 22 </span> }
<span class="lineno"> 23 </span>}
<span class="lineno"> 24 </span>
<span class="lineno"> 25 </span><span class="error">data class YamlNode(override val indent: Int = 0, override var content: String = "") : YML()</span>
<span class="lineno"> 26 </span>
<span class="lineno"> 27 </span>infix fun Int.times(function: () -> Unit) {
<span class="lineno"> 28 </span> var i = this
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:35:1</span><span class="message">The class `InputArgument` is using inheritance, consider using composition instead.
Does `InputArgument` want to expose the complete interface (`toArgument`) of `CliArgument` such that `InputArgument` can be used where `CliArgument` is expected? Indicates __inheritance__.
Does `InputArgument` want only some/part of the behavior exposed by `CliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 32 </span> override fun toArgument() = listOf(GENERATE_CONFIG_PARAMETER)
<span class="lineno"> 33 </span>}
<span class="lineno"> 34 </span>
<span class="lineno"> 35 </span><span class="error">internal data class InputArgument(val fileCollection: FileCollection) : CliArgument() {</span>
<span class="lineno"> 36 </span><span class="error"> override fun toArgument() = listOf(INPUT_PARAMETER, fileCollection.joinToString(",") { it.absolutePath })</span>
<span class="lineno"> 37 </span><span class="error">}</span>
<span class="lineno"> 38 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:39:1</span><span class="message">The class `ClasspathArgument` is using inheritance, consider using composition instead.
Does `ClasspathArgument` want to expose the complete interface (`toArgument`) of `CliArgument` such that `ClasspathArgument` can be used where `CliArgument` is expected? Indicates __inheritance__.
Does `ClasspathArgument` want only some/part of the behavior exposed by `CliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 36 </span> override fun toArgument() = listOf(INPUT_PARAMETER, fileCollection.joinToString(",") { it.absolutePath })
<span class="lineno"> 37 </span>}
<span class="lineno"> 38 </span>
<span class="lineno"> 39 </span><span class="error">internal data class ClasspathArgument(val fileCollection: FileCollection) : CliArgument() {</span>
<span class="lineno"> 40 </span><span class="error"> override fun toArgument() = if (!fileCollection.isEmpty) listOf(</span>
<span class="lineno"> 41 </span><span class="error"> CLASSPATH_PARAMETER,</span>
<span class="lineno"> 42 </span><span class="error"> fileCollection.joinToString(";") { it.absolutePath }) else emptyList()</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:45:1</span><span class="message">The class `LanguageVersionArgument` is using inheritance, consider using composition instead.
Does `LanguageVersionArgument` want to expose the complete interface (`toArgument`) of `CliArgument` such that `LanguageVersionArgument` can be used where `CliArgument` is expected? Indicates __inheritance__.
Does `LanguageVersionArgument` want only some/part of the behavior exposed by `CliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 42 </span> fileCollection.joinToString(";") { it.absolutePath }) else emptyList()
<span class="lineno"> 43 </span>}
<span class="lineno"> 44 </span>
<span class="lineno"> 45 </span><span class="error">internal data class LanguageVersionArgument(val languageVersion: String?) : CliArgument() {</span>
<span class="lineno"> 46 </span><span class="error"> override fun toArgument() = languageVersion?.let { listOf(LANGUAGE_VERSION_PARAMETER, it) } ?: emptyList()</span>
<span class="lineno"> 47 </span><span class="error">}</span>
<span class="lineno"> 48 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:49:1</span><span class="message">The class `JvmTargetArgument` is using inheritance, consider using composition instead.
Does `JvmTargetArgument` want to expose the complete interface (`toArgument`) of `CliArgument` such that `JvmTargetArgument` can be used where `CliArgument` is expected? Indicates __inheritance__.
Does `JvmTargetArgument` want only some/part of the behavior exposed by `CliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 46 </span> override fun toArgument() = languageVersion?.let { listOf(LANGUAGE_VERSION_PARAMETER, it) } ?: emptyList()
<span class="lineno"> 47 </span>}
<span class="lineno"> 48 </span>
<span class="lineno"> 49 </span><span class="error">internal data class JvmTargetArgument(val jvmTarget: String?) : CliArgument() {</span>
<span class="lineno"> 50 </span><span class="error"> override fun toArgument() = jvmTarget?.let { listOf(JVM_TARGET_PARAMETER, it) } ?: emptyList()</span>
<span class="lineno"> 51 </span><span class="error">}</span>
<span class="lineno"> 52 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:53:1</span><span class="message">The class `BaselineArgument` is using inheritance, consider using composition instead.
Does `BaselineArgument` want to expose the complete interface (`toArgument`) of `CliArgument` such that `BaselineArgument` can be used where `CliArgument` is expected? Indicates __inheritance__.
Does `BaselineArgument` want only some/part of the behavior exposed by `CliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 50 </span> override fun toArgument() = jvmTarget?.let { listOf(JVM_TARGET_PARAMETER, it) } ?: emptyList()
<span class="lineno"> 51 </span>}
<span class="lineno"> 52 </span>
<span class="lineno"> 53 </span><span class="error">internal data class BaselineArgument(val baseline: RegularFile?) : CliArgument() {</span>
<span class="lineno"> 54 </span><span class="error"> override fun toArgument() = baseline?.let { listOf(BASELINE_PARAMETER, it.asFile.absolutePath) } ?: emptyList()</span>
<span class="lineno"> 55 </span><span class="error">}</span>
<span class="lineno"> 56 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:57:1</span><span class="message">The class `DefaultReportArgument` is using inheritance, consider using composition instead.
Does `DefaultReportArgument` want to expose the complete interface (`toArgument`) of `CliArgument` such that `DefaultReportArgument` can be used where `CliArgument` is expected? Indicates __inheritance__.
Does `DefaultReportArgument` want only some/part of the behavior exposed by `CliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 54 </span> override fun toArgument() = baseline?.let { listOf(BASELINE_PARAMETER, it.asFile.absolutePath) } ?: emptyList()
<span class="lineno"> 55 </span>}
<span class="lineno"> 56 </span>
<span class="lineno"> 57 </span><span class="error">internal data class DefaultReportArgument(val type: DetektReportType, val file: RegularFile?) : CliArgument() {</span>
<span class="lineno"> 58 </span><span class="error"> override fun toArgument() =</span>
<span class="lineno"> 59 </span><span class="error"> file?.let { listOf(REPORT_PARAMETER, "${type.reportId}:${it.asFile.absoluteFile}") } ?: emptyList()</span>
<span class="lineno"> 60 </span><span class="error">}</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:62:1</span><span class="message">The class `CustomReportArgument` is using inheritance, consider using composition instead.
Does `CustomReportArgument` want to expose the complete interface (`toArgument`) of `CliArgument` such that `CustomReportArgument` can be used where `CliArgument` is expected? Indicates __inheritance__.
Does `CustomReportArgument` want only some/part of the behavior exposed by `CliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 59 </span> file?.let { listOf(REPORT_PARAMETER, "${type.reportId}:${it.asFile.absoluteFile}") } ?: emptyList()
<span class="lineno"> 60 </span>}
<span class="lineno"> 61 </span>
<span class="lineno"> 62 </span><span class="error">internal data class CustomReportArgument(val reportId: String, val file: RegularFile) : CliArgument() {</span>
<span class="lineno"> 63 </span><span class="error"> override fun toArgument() = listOf(REPORT_PARAMETER, "$reportId:${file.asFile.absolutePath}")</span>
<span class="lineno"> 64 </span><span class="error">}</span>
<span class="lineno"> 65 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:66:1</span><span class="message">The class `ConfigArgument` is using inheritance, consider using composition instead.
Does `ConfigArgument` want to expose the complete interface (`toArgument`) of `CliArgument` such that `ConfigArgument` can be used where `CliArgument` is expected? Indicates __inheritance__.
Does `ConfigArgument` want only some/part of the behavior exposed by `CliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 63 </span> override fun toArgument() = listOf(REPORT_PARAMETER, "$reportId:${file.asFile.absolutePath}")
<span class="lineno"> 64 </span>}
<span class="lineno"> 65 </span>
<span class="lineno"> 66 </span><span class="error">internal data class ConfigArgument(val config: FileCollection) : CliArgument() {</span>
<span class="lineno"> 67 </span><span class="error"> override fun toArgument() = if (config.isEmpty) {</span>
<span class="lineno"> 68 </span><span class="error"> emptyList()</span>
<span class="lineno"> 69 </span><span class="error"> } else {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:74:1</span><span class="message">The class `BoolCliArgument` is using inheritance, consider using composition instead.
Does `BoolCliArgument` want to expose the complete interface (`toArgument`) of `CliArgument` such that `BoolCliArgument` can be used where `CliArgument` is expected? Indicates __inheritance__.
Does `BoolCliArgument` want only some/part of the behavior exposed by `CliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 71 </span> }
<span class="lineno"> 72 </span>}
<span class="lineno"> 73 </span>
<span class="lineno"> 74 </span><span class="error">internal sealed class BoolCliArgument(open val value: Boolean, val configSwitch: String) : CliArgument() {</span>
<span class="lineno"> 75 </span><span class="error"> override fun toArgument() = if (value) listOf(configSwitch) else emptyList()</span>
<span class="lineno"> 76 </span><span class="error">}</span>
<span class="lineno"> 77 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:78:1</span><span class="message">The class `DebugArgument` is using inheritance, consider using composition instead.
Does `DebugArgument` want to expose the complete interface (`toArgument`) of `BoolCliArgument` such that `DebugArgument` can be used where `BoolCliArgument` is expected? Indicates __inheritance__.
Does `DebugArgument` want only some/part of the behavior exposed by `BoolCliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 75 </span> override fun toArgument() = if (value) listOf(configSwitch) else emptyList()
<span class="lineno"> 76 </span>}
<span class="lineno"> 77 </span>
<span class="lineno"> 78 </span><span class="error">internal data class DebugArgument(override val value: Boolean) : BoolCliArgument(value, DEBUG_PARAMETER)</span>
<span class="lineno"> 79 </span>
<span class="lineno"> 80 </span>internal data class ParallelArgument(override val value: Boolean) : BoolCliArgument(value, PARALLEL_PARAMETER)
<span class="lineno"> 81 </span>internal data class DisableDefaultRuleSetArgument(override val value: Boolean) :
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:80:1</span><span class="message">The class `ParallelArgument` is using inheritance, consider using composition instead.
Does `ParallelArgument` want to expose the complete interface (`toArgument`) of `BoolCliArgument` such that `ParallelArgument` can be used where `BoolCliArgument` is expected? Indicates __inheritance__.
Does `ParallelArgument` want only some/part of the behavior exposed by `BoolCliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 77 </span>
<span class="lineno"> 78 </span>internal data class DebugArgument(override val value: Boolean) : BoolCliArgument(value, DEBUG_PARAMETER)
<span class="lineno"> 79 </span>
<span class="lineno"> 80 </span><span class="error">internal data class ParallelArgument(override val value: Boolean) : BoolCliArgument(value, PARALLEL_PARAMETER)</span>
<span class="lineno"> 81 </span>internal data class DisableDefaultRuleSetArgument(override val value: Boolean) :
<span class="lineno"> 82 </span> BoolCliArgument(value, DISABLE_DEFAULT_RULESETS_PARAMETER)
<span class="lineno"> 83 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:81:1</span><span class="message">The class `DisableDefaultRuleSetArgument` is using inheritance, consider using composition instead.
Does `DisableDefaultRuleSetArgument` want to expose the complete interface (`toArgument`) of `BoolCliArgument` such that `DisableDefaultRuleSetArgument` can be used where `BoolCliArgument` is expected? Indicates __inheritance__.
Does `DisableDefaultRuleSetArgument` want only some/part of the behavior exposed by `BoolCliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 78 </span>internal data class DebugArgument(override val value: Boolean) : BoolCliArgument(value, DEBUG_PARAMETER)
<span class="lineno"> 79 </span>
<span class="lineno"> 80 </span>internal data class ParallelArgument(override val value: Boolean) : BoolCliArgument(value, PARALLEL_PARAMETER)
<span class="lineno"> 81 </span><span class="error">internal data class DisableDefaultRuleSetArgument(override val value: Boolean) :</span>
<span class="lineno"> 82 </span><span class="error"> BoolCliArgument(value, DISABLE_DEFAULT_RULESETS_PARAMETER)</span>
<span class="lineno"> 83 </span>
<span class="lineno"> 84 </span>internal data class BuildUponDefaultConfigArgument(override val value: Boolean) :
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:84:1</span><span class="message">The class `BuildUponDefaultConfigArgument` is using inheritance, consider using composition instead.
Does `BuildUponDefaultConfigArgument` want to expose the complete interface (`toArgument`) of `BoolCliArgument` such that `BuildUponDefaultConfigArgument` can be used where `BoolCliArgument` is expected? Indicates __inheritance__.
Does `BuildUponDefaultConfigArgument` want only some/part of the behavior exposed by `BoolCliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 81 </span>internal data class DisableDefaultRuleSetArgument(override val value: Boolean) :
<span class="lineno"> 82 </span> BoolCliArgument(value, DISABLE_DEFAULT_RULESETS_PARAMETER)
<span class="lineno"> 83 </span>
<span class="lineno"> 84 </span><span class="error">internal data class BuildUponDefaultConfigArgument(override val value: Boolean) :</span>
<span class="lineno"> 85 </span><span class="error"> BoolCliArgument(value, BUILD_UPON_DEFAULT_CONFIG_PARAMETER)</span>
<span class="lineno"> 86 </span>
<span class="lineno"> 87 </span>internal data class FailFastArgument(override val value: Boolean) : BoolCliArgument(value, FAIL_FAST_PARAMETER)
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:87:1</span><span class="message">The class `FailFastArgument` is using inheritance, consider using composition instead.
Does `FailFastArgument` want to expose the complete interface (`toArgument`) of `BoolCliArgument` such that `FailFastArgument` can be used where `BoolCliArgument` is expected? Indicates __inheritance__.
Does `FailFastArgument` want only some/part of the behavior exposed by `BoolCliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 84 </span>internal data class BuildUponDefaultConfigArgument(override val value: Boolean) :
<span class="lineno"> 85 </span> BoolCliArgument(value, BUILD_UPON_DEFAULT_CONFIG_PARAMETER)
<span class="lineno"> 86 </span>
<span class="lineno"> 87 </span><span class="error">internal data class FailFastArgument(override val value: Boolean) : BoolCliArgument(value, FAIL_FAST_PARAMETER)</span>
<span class="lineno"> 88 </span>
<span class="lineno"> 89 </span>internal data class AutoCorrectArgument(override val value: Boolean) : BoolCliArgument(value, AUTO_CORRECT_PARAMETER)
<span class="lineno"> 90 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/invoke/CliArgument.kt:89:1</span><span class="message">The class `AutoCorrectArgument` is using inheritance, consider using composition instead.
Does `AutoCorrectArgument` want to expose the complete interface (`toArgument`) of `BoolCliArgument` such that `AutoCorrectArgument` can be used where `BoolCliArgument` is expected? Indicates __inheritance__.
Does `AutoCorrectArgument` want only some/part of the behavior exposed by `BoolCliArgument`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 86 </span>
<span class="lineno"> 87 </span>internal data class FailFastArgument(override val value: Boolean) : BoolCliArgument(value, FAIL_FAST_PARAMETER)
<span class="lineno"> 88 </span>
<span class="lineno"> 89 </span><span class="error">internal data class AutoCorrectArgument(override val value: Boolean) : BoolCliArgument(value, AUTO_CORRECT_PARAMETER)</span>
<span class="lineno"> 90 </span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/test/kotlin/io/gitlab/arturbosch/detekt/DslTestBuilder.kt:66:5</span><span class="message">The class `GroovyBuilder` is using inheritance, consider using composition instead.
Does `GroovyBuilder` want to expose the complete interface (`build, dryRun, withGradleVersion, withConfigFile, withBaseline, withProjectLayout, withDetektConfig`) of `DslTestBuilder` such that `GroovyBuilder` can be used where `DslTestBuilder` is expected? Indicates __inheritance__.
Does `GroovyBuilder` want only some/part of the behavior exposed by `DslTestBuilder`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 63 </span> return runner
<span class="lineno"> 64 </span> }
<span class="lineno"> 65 </span>
<span class="lineno"> 66 </span> <span class="error">private class GroovyBuilder : DslTestBuilder() {</span>
<span class="lineno"> 67 </span><span class="error"> override val gradleBuildName: String = "build.gradle"</span>
<span class="lineno"> 68 </span><span class="error"> override val gradlePluginsSection = GROOVY_PLUGINS_SECTION</span>
<span class="lineno"> 69 </span><span class="error"> override val gradleApplyPlugins = GROOVY_APPLY_PLUGINS</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-gradle-plugin/src/test/kotlin/io/gitlab/arturbosch/detekt/DslTestBuilder.kt:81:5</span><span class="message">The class `KotlinBuilder` is using inheritance, consider using composition instead.
Does `KotlinBuilder` want to expose the complete interface (`build, dryRun, withGradleVersion, withConfigFile, withBaseline, withProjectLayout, withDetektConfig`) of `DslTestBuilder` such that `KotlinBuilder` can be used where `DslTestBuilder` is expected? Indicates __inheritance__.
Does `KotlinBuilder` want only some/part of the behavior exposed by `DslTestBuilder`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 78 </span> """.trimMargin()
<span class="lineno"> 79 </span> }
<span class="lineno"> 80 </span>
<span class="lineno"> 81 </span> <span class="error">private class KotlinBuilder : DslTestBuilder() {</span>
<span class="lineno"> 82 </span><span class="error"> override val gradleBuildName: String = "build.gradle.kts"</span>
<span class="lineno"> 83 </span><span class="error"> override val gradlePluginsSection = KOTLIN_PLUGINS_SECTION</span>
<span class="lineno"> 84 </span><span class="error"> override val gradleApplyPlugins = KOTLIN_APPLY_PLUGINS</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/Deprecation.kt:14:1</span><span class="message">The class `Deprecation` is using inheritance, consider using composition instead.
Does `Deprecation` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `Deprecation` can be used where `Rule` is expected? Indicates __inheritance__.
Does `Deprecation` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.diagnostics.Errors
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.resolve.BindingContext
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Deprecated elements are expected to be removed in future. Alternatives should be found if possible.</span>
<span class="lineno"> 16 </span><span class="error"> */</span>
<span class="lineno"> 17 </span><span class="error">class Deprecation(config: Config) : Rule(config) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/DuplicateCaseInWhenExpression.kt:12:1</span><span class="message">The class `DuplicateCaseInWhenExpression` is using inheritance, consider using composition instead.
Does `DuplicateCaseInWhenExpression` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `DuplicateCaseInWhenExpression` can be used where `Rule` is expected? Indicates __inheritance__.
Does `DuplicateCaseInWhenExpression` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtWhenExpression
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span><span class="error">/**</span>
<span class="lineno"> 13 </span><span class="error"> * Flags duplicate case statements in when expressions.</span>
<span class="lineno"> 14 </span><span class="error"> *</span>
<span class="lineno"> 15 </span><span class="error"> * If a when expression contains the same case statement multiple times they should be merged. Otherwise it might be</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/EqualsAlwaysReturnsTrueOrFalse.kt:20:1</span><span class="message">The class `EqualsAlwaysReturnsTrueOrFalse` is using inheritance, consider using composition instead.
Does `EqualsAlwaysReturnsTrueOrFalse` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `EqualsAlwaysReturnsTrueOrFalse` can be used where `Rule` is expected? Indicates __inheritance__.
Does `EqualsAlwaysReturnsTrueOrFalse` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.KtReturnExpression
<span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.psiUtil.collectDescendantsOfType
<span class="lineno"> 19 </span>
<span class="lineno"> 20 </span><span class="error">/**</span>
<span class="lineno"> 21 </span><span class="error"> * Reports equals() methods which will always return true or false.</span>
<span class="lineno"> 22 </span><span class="error"> *</span>
<span class="lineno"> 23 </span><span class="error"> * Equals methods should always report if some other object is equal to the current object.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/EqualsWithHashCodeExist.kt:18:1</span><span class="message">The class `EqualsWithHashCodeExist` is using inheritance, consider using composition instead.
Does `EqualsWithHashCodeExist` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `EqualsWithHashCodeExist` can be used where `Rule` is expected? Indicates __inheritance__.
Does `EqualsWithHashCodeExist` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 16 </span>import java.util.ArrayDeque
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * When a class overrides the equals() method it should also override the hashCode() method.</span>
<span class="lineno"> 20 </span><span class="error"> *</span>
<span class="lineno"> 21 </span><span class="error"> * All hash-based collections depend on objects meeting the equals-contract. Two equal objects must produce the</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/ExplicitGarbageCollectionCall.kt:15:1</span><span class="message">The class `ExplicitGarbageCollectionCall` is using inheritance, consider using composition instead.
Does `ExplicitGarbageCollectionCall` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ExplicitGarbageCollectionCall` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ExplicitGarbageCollectionCall` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.psiUtil.getCallNameExpression
<span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.psiUtil.getReceiverExpression
<span class="lineno"> 14 </span>
<span class="lineno"> 15 </span><span class="error">/**</span>
<span class="lineno"> 16 </span><span class="error"> * Reports all calls to explicitly trigger the Garbage Collector.</span>
<span class="lineno"> 17 </span><span class="error"> * Code should work independently of the garbage collector and should not require the GC to be triggered in certain</span>
<span class="lineno"> 18 </span><span class="error"> * points in time.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/HasPlatformType.kt:19:1</span><span class="message">The class `HasPlatformType` is using inheritance, consider using composition instead.
Does `HasPlatformType` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `HasPlatformType` can be used where `Rule` is expected? Indicates __inheritance__.
Does `HasPlatformType` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 16 </span>import org.jetbrains.kotlin.resolve.BindingContext
<span class="lineno"> 17 </span>import org.jetbrains.kotlin.types.isFlexible
<span class="lineno"> 18 </span>
<span class="lineno"> 19 </span><span class="error">/**</span>
<span class="lineno"> 20 </span><span class="error"> * Platform types must be declared explicitly in public APIs to prevent unexpected errors.</span>
<span class="lineno"> 21 </span><span class="error"> *</span>
<span class="lineno"> 22 </span><span class="error"> * Based on code from Kotlin project:</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/ImplicitDefaultLocale.kt:19:1</span><span class="message">The class `ImplicitDefaultLocale` is using inheritance, consider using composition instead.
Does `ImplicitDefaultLocale` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ImplicitDefaultLocale` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ImplicitDefaultLocale` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 16 </span>import org.jetbrains.kotlin.resolve.calls.callUtil.getCalleeExpressionIfAny
<span class="lineno"> 17 </span>import org.jetbrains.kotlin.resolve.calls.callUtil.getType
<span class="lineno"> 18 </span>
<span class="lineno"> 19 </span><span class="error">/**</span>
<span class="lineno"> 20 </span><span class="error"> * Prefer passing [java.util.Locale] explicitly than using implicit default value when formatting</span>
<span class="lineno"> 21 </span><span class="error"> * strings or performing a case conversion.</span>
<span class="lineno"> 22 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/InvalidRange.kt:14:1</span><span class="message">The class `InvalidRange` is using inheritance, consider using composition instead.
Does `InvalidRange` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `InvalidRange` can be used where `Rule` is expected? Indicates __inheritance__.
Does `InvalidRange` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.com.intellij.psi.PsiElement
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtBinaryExpression
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Reports ranges which are empty.</span>
<span class="lineno"> 16 </span><span class="error"> * This might be a bug if it is used for instance as a loop condition. This loop will never be triggered then.</span>
<span class="lineno"> 17 </span><span class="error"> * This might be due to invalid ranges like (10..9) which will cause the loop to never be entered.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/IteratorHasNextCallsNextMethod.kt:17:1</span><span class="message">The class `IteratorHasNextCallsNextMethod` is using inheritance, consider using composition instead.
Does `IteratorHasNextCallsNextMethod` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `IteratorHasNextCallsNextMethod` can be used where `Rule` is expected? Indicates __inheritance__.
Does `IteratorHasNextCallsNextMethod` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.psiUtil.findFunctionByName
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.psiUtil.getSuperNames
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * Verifies implementations of the Iterator interface.</span>
<span class="lineno"> 19 </span><span class="error"> * The hasNext() method of an Iterator implementation should not have any side effects.</span>
<span class="lineno"> 20 </span><span class="error"> * This rule reports implementations that call the next() method of the Iterator inside the hasNext() method.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/IteratorNotThrowingNoSuchElementException.kt:18:1</span><span class="message">The class `IteratorNotThrowingNoSuchElementException` is using inheritance, consider using composition instead.
Does `IteratorNotThrowingNoSuchElementException` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `IteratorNotThrowingNoSuchElementException` can be used where `Rule` is expected? Indicates __inheritance__.
Does `IteratorNotThrowingNoSuchElementException` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.psiUtil.findFunctionByName
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.psiUtil.getSuperNames
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * Reports implementations of the `Iterator` interface which do not throw a NoSuchElementException in the</span>
<span class="lineno"> 20 </span><span class="error"> * implementation of the next() method. When there are no more elements to return an Iterator should throw a</span>
<span class="lineno"> 21 </span><span class="error"> * NoSuchElementException.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/LateinitUsage.kt:18:1</span><span class="message">The class `LateinitUsage` is using inheritance, consider using composition instead.
Does `LateinitUsage` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `LateinitUsage` can be used where `Rule` is expected? Indicates __inheritance__.
Does `LateinitUsage` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.psiUtil.containingClass
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * Turn on this rule to flag usages of the lateinit modifier.</span>
<span class="lineno"> 20 </span><span class="error"> *</span>
<span class="lineno"> 21 </span><span class="error"> * Using lateinit for property initialization can be error prone and the actual initialization is not</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/MapGetWithNotNullAssertionOperator.kt:16:1</span><span class="message">The class `MapGetWithNotNullAssertionOperator` is using inheritance, consider using composition instead.
Does `MapGetWithNotNullAssertionOperator` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `MapGetWithNotNullAssertionOperator` can be used where `Rule` is expected? Indicates __inheritance__.
Does `MapGetWithNotNullAssertionOperator` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * Reports calls of the map access methods `map[]` or `map.get()` with a not-null assertion operator `!!`.</span>
<span class="lineno"> 18 </span><span class="error"> * This may result in a NullPointerException.</span>
<span class="lineno"> 19 </span><span class="error"> * Preferred access methods are `map[]` without `!!`, `map.getValue()`, `map.getOrDefault()` or `map.getOrElse()`.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/MissingWhenCase.kt:16:1</span><span class="message">The class `MissingWhenCase` is using inheritance, consider using composition instead.
Does `MissingWhenCase` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `MissingWhenCase` can be used where `Rule` is expected? Indicates __inheritance__.
Does `MissingWhenCase` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.resolve.bindingContextUtil.isUsedAsExpression
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.resolve.calls.callUtil.getType
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * Turn on this rule to flag `when` expressions that do not check that all cases are covered when the subject is an enum</span>
<span class="lineno"> 18 </span><span class="error"> * or sealed class and the `when` expression is used as a statement.</span>
<span class="lineno"> 19 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/RedundantElseInWhen.kt:21:1</span><span class="message">The class `RedundantElseInWhen` is using inheritance, consider using composition instead.
Does `RedundantElseInWhen` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `RedundantElseInWhen` can be used where `Rule` is expected? Indicates __inheritance__.
Does `RedundantElseInWhen` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 18 </span>import org.jetbrains.kotlin.resolve.descriptorUtil.module
<span class="lineno"> 19 </span>import org.jetbrains.kotlin.resolve.source.getPsi
<span class="lineno"> 20 </span>
<span class="lineno"> 21 </span><span class="error">/**</span>
<span class="lineno"> 22 </span><span class="error"> * Turn on this rule to flag `when` expressions that contain a redundant `else` case. This occurs when it can be</span>
<span class="lineno"> 23 </span><span class="error"> * verified that all cases are already covered when checking cases on an enum or sealed class.</span>
<span class="lineno"> 24 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/UnconditionalJumpStatementInLoop.kt:19:1</span><span class="message">The class `UnconditionalJumpStatementInLoop` is using inheritance, consider using composition instead.
Does `UnconditionalJumpStatementInLoop` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnconditionalJumpStatementInLoop` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnconditionalJumpStatementInLoop` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.KtLoopExpression
<span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.KtReturnExpression
<span class="lineno"> 18 </span>
<span class="lineno"> 19 </span><span class="error">/**</span>
<span class="lineno"> 20 </span><span class="error"> * Reports loops which contain jump statements that jump regardless of any conditions.</span>
<span class="lineno"> 21 </span><span class="error"> * This implies that the loop is only executed once and thus could be rewritten without a</span>
<span class="lineno"> 22 </span><span class="error"> * loop altogether.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/UnnecessaryNotNullOperator.kt:14:1</span><span class="message">The class `UnnecessaryNotNullOperator` is using inheritance, consider using composition instead.
Does `UnnecessaryNotNullOperator` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnnecessaryNotNullOperator` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnnecessaryNotNullOperator` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtUnaryExpression
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.resolve.BindingContext
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Reports unnecessary not-null operator usage (!!) that can be removed by the user.</span>
<span class="lineno"> 16 </span><span class="error"> *</span>
<span class="lineno"> 17 </span><span class="error"> * <noncompliant></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/UnnecessarySafeCall.kt:17:1</span><span class="message">The class `UnnecessarySafeCall` is using inheritance, consider using composition instead.
Does `UnnecessarySafeCall` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnnecessarySafeCall` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnnecessarySafeCall` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.psiUtil.getChildOfType
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.resolve.BindingContext
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * Reports unnecessary safe call operators (`.?`) that can be removed by the user.</span>
<span class="lineno"> 19 </span><span class="error"> *</span>
<span class="lineno"> 20 </span><span class="error"> * <noncompliant></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/UnreachableCode.kt:17:1</span><span class="message">The class `UnreachableCode` is using inheritance, consider using composition instead.
Does `UnreachableCode` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnreachableCode` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnreachableCode` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtReturnExpression
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtThrowExpression
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * Reports unreachable code.</span>
<span class="lineno"> 19 </span><span class="error"> * Code can be unreachable because it is behind return, throw, continue or break expressions.</span>
<span class="lineno"> 20 </span><span class="error"> * This unreachable code should be removed as it serves no purpose.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/UnsafeCallOnNullableType.kt:17:1</span><span class="message">The class `UnsafeCallOnNullableType` is using inheritance, consider using composition instead.
Does `UnsafeCallOnNullableType` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnsafeCallOnNullableType` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnsafeCallOnNullableType` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.types.typeUtil.TypeNullability
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.types.typeUtil.nullability
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * Reports unsafe calls on nullable types. These calls will throw a NullPointerException in case</span>
<span class="lineno"> 19 </span><span class="error"> * the nullable value is null. Kotlin provides many ways to work with nullable types to increase</span>
<span class="lineno"> 20 </span><span class="error"> * null safety. Guard the code appropriately to prevent NullPointerExceptions.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/UnsafeCast.kt:14:1</span><span class="message">The class `UnsafeCast` is using inheritance, consider using composition instead.
Does `UnsafeCast` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnsafeCast` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnsafeCast` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtBinaryExpressionWithTypeRHS
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.resolve.BindingContext
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Reports casts that will never succeed.</span>
<span class="lineno"> 16 </span><span class="error"> *</span>
<span class="lineno"> 17 </span><span class="error"> * <noncompliant></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/UselessPostfixExpression.kt:24:1</span><span class="message">The class `UselessPostfixExpression` is using inheritance, consider using composition instead.
Does `UselessPostfixExpression` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UselessPostfixExpression` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UselessPostfixExpression` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 21 </span>import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
<span class="lineno"> 22 </span>import org.jetbrains.kotlin.psi.psiUtil.isPropertyParameter
<span class="lineno"> 23 </span>
<span class="lineno"> 24 </span><span class="error">/**</span>
<span class="lineno"> 25 </span><span class="error"> * This rule reports postfix expressions (++, --) which are unused and thus unnecessary.</span>
<span class="lineno"> 26 </span><span class="error"> * This leads to confusion as a reader of the code might think the value will be incremented/decremented.</span>
<span class="lineno"> 27 </span><span class="error"> * However the value is replaced with the original value which might lead to bugs.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/WrongEqualsTypeParameter.kt:14:1</span><span class="message">The class `WrongEqualsTypeParameter` is using inheritance, consider using composition instead.
Does `WrongEqualsTypeParameter` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `WrongEqualsTypeParameter` can be used where `Rule` is expected? Indicates __inheritance__.
Does `WrongEqualsTypeParameter` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtClass
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Reports equals() methods which take in a wrongly typed parameter.</span>
<span class="lineno"> 16 </span><span class="error"> * Correct implementations of the equals() method should only take in a parameter of type Any?</span>
<span class="lineno"> 17 </span><span class="error"> * See: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/equals.html</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/ComplexCondition.kt:18:1</span><span class="message">The class `ComplexCondition` is using inheritance, consider using composition instead.
Does `ComplexCondition` want to expose the complete interface (`empty public interface`) of `ThresholdRule` such that `ComplexCondition` can be used where `ThresholdRule` is expected? Indicates __inheritance__.
Does `ComplexCondition` want only some/part of the behavior exposed by `ThresholdRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtWhileExpression
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.psiUtil.collectDescendantsOfType
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * Complex conditions make it hard to understand which cases lead to the condition being true or false. To improve</span>
<span class="lineno"> 20 </span><span class="error"> * readability and understanding of complex conditions consider extracting them into well-named functions or variables</span>
<span class="lineno"> 21 </span><span class="error"> * and call those instead.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/ComplexInterface.kt:21:1</span><span class="message">The class `ComplexInterface` is using inheritance, consider using composition instead.
Does `ComplexInterface` want to expose the complete interface (`empty public interface`) of `ThresholdRule` such that `ComplexInterface` can be used where `ThresholdRule` is expected? Indicates __inheritance__.
Does `ComplexInterface` want only some/part of the behavior exposed by `ThresholdRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.KtTypeParameterListOwner
<span class="lineno"> 19 </span>import org.jetbrains.kotlin.psi.psiUtil.isPrivate
<span class="lineno"> 20 </span>
<span class="lineno"> 21 </span><span class="error">/**</span>
<span class="lineno"> 22 </span><span class="error"> * Complex interfaces which contain too many functions and/or properties indicate that this interface is handling too</span>
<span class="lineno"> 23 </span><span class="error"> * many things at once. Interfaces should follow the single-responsibility principle to also encourage implementations</span>
<span class="lineno"> 24 </span><span class="error"> * of this interface to not handle too many things at once.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/ComplexMethod.kt:20:1</span><span class="message">The class `ComplexMethod` is using inheritance, consider using composition instead.
Does `ComplexMethod` want to expose the complete interface (`empty public interface`) of `ThresholdRule` such that `ComplexMethod` can be used where `ThresholdRule` is expected? Indicates __inheritance__.
Does `ComplexMethod` want only some/part of the behavior exposed by `ThresholdRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.KtReturnExpression
<span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.KtWhenExpression
<span class="lineno"> 19 </span>
<span class="lineno"> 20 </span><span class="error">/**</span>
<span class="lineno"> 21 </span><span class="error"> * Complex methods are hard to understand and read. It might not be obvious what side-effects a complex method has.</span>
<span class="lineno"> 22 </span><span class="error"> * Prefer splitting up complex methods into smaller methods that are in turn easier to understand.</span>
<span class="lineno"> 23 </span><span class="error"> * Smaller methods can also be named much clearer which leads to improved readability of the code.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/LabeledExpression.kt:20:1</span><span class="message">The class `LabeledExpression` is using inheritance, consider using composition instead.
Does `LabeledExpression` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `LabeledExpression` can be used where `Rule` is expected? Indicates __inheritance__.
Does `LabeledExpression` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
<span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.psiUtil.isExtensionDeclaration
<span class="lineno"> 19 </span>
<span class="lineno"> 20 </span><span class="error">/**</span>
<span class="lineno"> 21 </span><span class="error"> * This rule reports labeled expressions. Expressions with labels generally increase complexity and worsen the</span>
<span class="lineno"> 22 </span><span class="error"> * maintainability of the code. Refactor the violating code to not use labels instead.</span>
<span class="lineno"> 23 </span><span class="error"> * Labeled expressions referencing an outer class with a label from an inner class are allowed, because there is no</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/LargeClass.kt:18:1</span><span class="message">The class `LargeClass` is using inheritance, consider using composition instead.
Does `LargeClass` want to expose the complete interface (`empty public interface`) of `ThresholdRule` such that `LargeClass` can be used where `ThresholdRule` is expected? Indicates __inheritance__.
Does `LargeClass` want only some/part of the behavior exposed by `ThresholdRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.utils.addToStdlib.flattenTo
<span class="lineno"> 16 </span>import java.util.IdentityHashMap
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * This rule reports large classes. Classes should generally have one responsibility. Large classes can indicate that</span>
<span class="lineno"> 20 </span><span class="error"> * the class does instead handle multiple responsibilities. Instead of doing many things at once prefer to</span>
<span class="lineno"> 21 </span><span class="error"> * split up large classes into smaller classes. These smaller classes are then easier to understand and handle less</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/LongMethod.kt:18:1</span><span class="message">The class `LongMethod` is using inheritance, consider using composition instead.
Does `LongMethod` want to expose the complete interface (`empty public interface`) of `ThresholdRule` such that `LongMethod` can be used where `ThresholdRule` is expected? Indicates __inheritance__.
Does `LongMethod` want only some/part of the behavior exposed by `ThresholdRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.utils.addToStdlib.flattenTo
<span class="lineno"> 16 </span>import java.util.IdentityHashMap
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * Methods should have one responsibility. Long methods can indicate that a method handles too many cases at once.</span>
<span class="lineno"> 20 </span><span class="error"> * Prefer smaller methods with clear names that describe their functionality clearly.</span>
<span class="lineno"> 21 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/LongParameterList.kt:25:1</span><span class="message">The class `LongParameterList` is using inheritance, consider using composition instead.
Does `LongParameterList` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `LongParameterList` can be used where `Rule` is expected? Indicates __inheritance__.
Does `LongParameterList` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 22 </span>import org.jetbrains.kotlin.psi.KtSecondaryConstructor
<span class="lineno"> 23 </span>import org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject
<span class="lineno"> 24 </span>
<span class="lineno"> 25 </span><span class="error">/**</span>
<span class="lineno"> 26 </span><span class="error"> * Reports functions and constructors which have more parameters than a certain threshold.</span>
<span class="lineno"> 27 </span><span class="error"> *</span>
<span class="lineno"> 28 </span><span class="error"> * @configuration threshold - number of parameters required to trigger the rule (default: `6`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/MethodOverloading.kt:22:1</span><span class="message">The class `MethodOverloading` is using inheritance, consider using composition instead.
Does `MethodOverloading` want to expose the complete interface (`empty public interface`) of `ThresholdRule` such that `MethodOverloading` can be used where `ThresholdRule` is expected? Indicates __inheritance__.
Does `MethodOverloading` want only some/part of the behavior exposed by `ThresholdRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 19 </span>import org.jetbrains.kotlin.psi.psiUtil.getChildrenOfType
<span class="lineno"> 20 </span>import org.jetbrains.kotlin.psi.psiUtil.isExtensionDeclaration
<span class="lineno"> 21 </span>
<span class="lineno"> 22 </span><span class="error">/**</span>
<span class="lineno"> 23 </span><span class="error"> * This rule reports methods which are overloaded often.</span>
<span class="lineno"> 24 </span><span class="error"> * Method overloading tightly couples these methods together which might make the code harder to understand.</span>
<span class="lineno"> 25 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/MethodOverloading.kt:55:5</span><span class="message">The class `OverloadedMethodVisitor` is using inheritance, consider using composition instead.
Does `OverloadedMethodVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `OverloadedMethodVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `OverloadedMethodVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 52 </span> super.visitClassOrObject(classOrObject)
<span class="lineno"> 53 </span> }
<span class="lineno"> 54 </span>
<span class="lineno"> 55 </span> <span class="error">internal inner class OverloadedMethodVisitor : DetektVisitor() {</span>
<span class="lineno"> 56 </span><span class="error"></span>
<span class="lineno"> 57 </span><span class="error"> private var methods = HashMap<String, Int>()</span>
<span class="lineno"> 58 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/NestedBlockDepth.kt:22:1</span><span class="message">The class `NestedBlockDepth` is using inheritance, consider using composition instead.
Does `NestedBlockDepth` want to expose the complete interface (`empty public interface`) of `ThresholdRule` such that `NestedBlockDepth` can be used where `ThresholdRule` is expected? Indicates __inheritance__.
Does `NestedBlockDepth` want only some/part of the behavior exposed by `ThresholdRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 19 </span>import org.jetbrains.kotlin.psi.KtTryExpression
<span class="lineno"> 20 </span>import org.jetbrains.kotlin.psi.KtWhenExpression
<span class="lineno"> 21 </span>
<span class="lineno"> 22 </span><span class="error">/**</span>
<span class="lineno"> 23 </span><span class="error"> * This rule reports excessive nesting depth in functions. Excessively nested code becomes harder to read and increases</span>
<span class="lineno"> 24 </span><span class="error"> * its hidden complexity. It might become harder to understand edge-cases of the function.</span>
<span class="lineno"> 25 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/NestedBlockDepth.kt:55:5</span><span class="message">The class `FunctionDepthVisitor` is using inheritance, consider using composition instead.
Does `FunctionDepthVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `FunctionDepthVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `FunctionDepthVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 52 </span> }
<span class="lineno"> 53 </span> }
<span class="lineno"> 54 </span>
<span class="lineno"> 55 </span> <span class="error">private class FunctionDepthVisitor(val threshold: Int) : DetektVisitor() {</span>
<span class="lineno"> 56 </span><span class="error"></span>
<span class="lineno"> 57 </span><span class="error"> internal var depth = 0</span>
<span class="lineno"> 58 </span><span class="error"> internal var maxDepth = 0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/StringLiteralDuplication.kt:19:1</span><span class="message">The class `StringLiteralDuplication` is using inheritance, consider using composition instead.
Does `StringLiteralDuplication` want to expose the complete interface (`empty public interface`) of `ThresholdRule` such that `StringLiteralDuplication` can be used where `ThresholdRule` is expected? Indicates __inheritance__.
Does `StringLiteralDuplication` want only some/part of the behavior exposed by `ThresholdRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.KtStringTemplateExpression
<span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.psiUtil.plainContent
<span class="lineno"> 18 </span>
<span class="lineno"> 19 </span><span class="error">/**</span>
<span class="lineno"> 20 </span><span class="error"> * This rule detects and reports duplicated String literals. Repeatedly typing out the same String literal across the</span>
<span class="lineno"> 21 </span><span class="error"> * codebase makes it harder to change and maintain.</span>
<span class="lineno"> 22 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/StringLiteralDuplication.kt:81:5</span><span class="message">The class `StringLiteralVisitor` is using inheritance, consider using composition instead.
Does `StringLiteralVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `StringLiteralVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `StringLiteralVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 78 </span> }
<span class="lineno"> 79 </span> }
<span class="lineno"> 80 </span>
<span class="lineno"> 81 </span> <span class="error">internal inner class StringLiteralVisitor : DetektVisitor() {</span>
<span class="lineno"> 82 </span><span class="error"></span>
<span class="lineno"> 83 </span><span class="error"> private var literals = HashMap<String, Int>()</span>
<span class="lineno"> 84 </span><span class="error"> private var literalReferences = HashMap<String, MutableList<KtStringTemplateExpression>>()</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/TooManyFunctions.kt:20:1</span><span class="message">The class `TooManyFunctions` is using inheritance, consider using composition instead.
Does `TooManyFunctions` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `TooManyFunctions` can be used where `Rule` is expected? Indicates __inheritance__.
Does `TooManyFunctions` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.KtObjectDeclaration
<span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.psiUtil.isPrivate
<span class="lineno"> 19 </span>
<span class="lineno"> 20 </span><span class="error">/**</span>
<span class="lineno"> 21 </span><span class="error"> * This rule reports files, classes, interfaces, objects and enums which contain too many functions.</span>
<span class="lineno"> 22 </span><span class="error"> * Each element can be configured with different thresholds.</span>
<span class="lineno"> 23 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/coroutines/GlobalCoroutineUsage.kt:13:1</span><span class="message">The class `GlobalCoroutineUsage` is using inheritance, consider using composition instead.
Does `GlobalCoroutineUsage` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `GlobalCoroutineUsage` can be used where `Rule` is expected? Indicates __inheritance__.
Does `GlobalCoroutineUsage` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtDotQualifiedExpression
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.resolve.calls.callUtil.getCalleeExpressionIfAny
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * Report usages of `GlobalScope.launch` and `GlobalScope.async`. It is highly discouraged by the Kotlin documentation:</span>
<span class="lineno"> 15 </span><span class="error"> *</span>
<span class="lineno"> 16 </span><span class="error"> * > Global scope is used to launch top-level coroutines which are operating on the whole application lifetime and are</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/coroutines/RedundantSuspendModifier.kt:33:1</span><span class="message">The class `RedundantSuspendModifier` is using inheritance, consider using composition instead.
Does `RedundantSuspendModifier` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `RedundantSuspendModifier` can be used where `Rule` is expected? Indicates __inheritance__.
Does `RedundantSuspendModifier` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 30 </span>import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
<span class="lineno"> 31 </span>import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
<span class="lineno"> 32 </span>
<span class="lineno"> 33 </span><span class="error">/**</span>
<span class="lineno"> 34 </span><span class="error"> * `suspend` modifier should only be used where needed, otherwise the function can only be used from other suspending</span>
<span class="lineno"> 35 </span><span class="error"> * functions. This needlessly restricts use of the function and should be avoided by removing the `suspend` modifier</span>
<span class="lineno"> 36 </span><span class="error"> * where it's not needed.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/documentation/AbsentOrWrongFileLicense.kt:12:1</span><span class="message">The class `AbsentOrWrongFileLicense` is using inheritance, consider using composition instead.
Does `AbsentOrWrongFileLicense` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `AbsentOrWrongFileLicense` can be used where `Rule` is expected? Indicates __inheritance__.
Does `AbsentOrWrongFileLicense` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span><span class="error">/**</span>
<span class="lineno"> 13 </span><span class="error"> * This rule will report every Kotlin source file which doesn't have required license header.</span>
<span class="lineno"> 14 </span><span class="error"> *</span>
<span class="lineno"> 15 </span><span class="error"> * @configuration licenseTemplateFile - path to file with license header template resolved relatively to config file</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/documentation/CommentOverPrivateFunction.kt:12:1</span><span class="message">The class `CommentOverPrivateFunction` is using inheritance, consider using composition instead.
Does `CommentOverPrivateFunction` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `CommentOverPrivateFunction` can be used where `Rule` is expected? Indicates __inheritance__.
Does `CommentOverPrivateFunction` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span><span class="error">/**</span>
<span class="lineno"> 13 </span><span class="error"> * This rule reports comments and documentation that has been added to private functions. These comments get reported</span>
<span class="lineno"> 14 </span><span class="error"> * because they probably explain the functionality of the private function. However private functions should be small</span>
<span class="lineno"> 15 </span><span class="error"> * enough and have an understandable name so that they are self-explanatory and do not need this comment in the first</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/documentation/CommentOverPrivateProperty.kt:12:1</span><span class="message">The class `CommentOverPrivateProperty` is using inheritance, consider using composition instead.
Does `CommentOverPrivateProperty` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `CommentOverPrivateProperty` can be used where `Rule` is expected? Indicates __inheritance__.
Does `CommentOverPrivateProperty` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span><span class="error">/**</span>
<span class="lineno"> 13 </span><span class="error"> * This rule reports comments and documentation above private properties. This can indicate that the property has a</span>
<span class="lineno"> 14 </span><span class="error"> * confusing name or is not in a small enough context to be understood.</span>
<span class="lineno"> 15 </span><span class="error"> * Private properties should be named in a self-explanatory way and readers of the code should be able to understand</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/documentation/EndOfSentenceFormat.kt:14:1</span><span class="message">The class `KDocStyle` is using inheritance, consider using composition instead.
Does `KDocStyle` want to expose the complete interface (`runIfActive, postVisit, preVisit, visitCondition`) of `MultiRule` such that `KDocStyle` can be used where `MultiRule` is expected? Indicates __inheritance__.
Does `KDocStyle` want only some/part of the behavior exposed by `MultiRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import io.gitlab.arturbosch.detekt.rules.lastArgumentMatchesUrl
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtDeclaration
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">class KDocStyle(config: Config = Config.empty) : MultiRule() {</span>
<span class="lineno"> 15 </span><span class="error"></span>
<span class="lineno"> 16 </span><span class="error"> private val endOfSentenceFormat = EndOfSentenceFormat(config)</span>
<span class="lineno"> 17 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/documentation/EndOfSentenceFormat.kt:28:1</span><span class="message">The class `EndOfSentenceFormat` is using inheritance, consider using composition instead.
Does `EndOfSentenceFormat` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `EndOfSentenceFormat` can be used where `Rule` is expected? Indicates __inheritance__.
Does `EndOfSentenceFormat` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 25 </span> }
<span class="lineno"> 26 </span>}
<span class="lineno"> 27 </span>
<span class="lineno"> 28 </span><span class="error">/**</span>
<span class="lineno"> 29 </span><span class="error"> * This rule validates the end of the first sentence of a KDoc comment.</span>
<span class="lineno"> 30 </span><span class="error"> * It should end with proper punctuation or with a correct URL.</span>
<span class="lineno"> 31 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/documentation/UndocumentedPublicClass.kt:17:1</span><span class="message">The class `UndocumentedPublicClass` is using inheritance, consider using composition instead.
Does `UndocumentedPublicClass` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UndocumentedPublicClass` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UndocumentedPublicClass` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtEnumEntry
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtObjectDeclaration
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * This rule reports public classes, objects and interfaces which do not have the required documentation.</span>
<span class="lineno"> 19 </span><span class="error"> * Enable this rule if the codebase should have documentation on every public class, interface and object.</span>
<span class="lineno"> 20 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/documentation/UndocumentedPublicFunction.kt:15:1</span><span class="message">The class `UndocumentedPublicFunction` is using inheritance, consider using composition instead.
Does `UndocumentedPublicFunction` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UndocumentedPublicFunction` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UndocumentedPublicFunction` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.psiUtil.containingClass
<span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.psiUtil.isPublic
<span class="lineno"> 14 </span>
<span class="lineno"> 15 </span><span class="error">/**</span>
<span class="lineno"> 16 </span><span class="error"> * This rule will report any public function which does not have the required documentation.</span>
<span class="lineno"> 17 </span><span class="error"> * If the codebase should have documentation on all public functions enable this rule to enforce this.</span>
<span class="lineno"> 18 </span><span class="error"> * Overridden functions are excluded by this rule.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/documentation/UndocumentedPublicProperty.kt:20:1</span><span class="message">The class `UndocumentedPublicProperty` is using inheritance, consider using composition instead.
Does `UndocumentedPublicProperty` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UndocumentedPublicProperty` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UndocumentedPublicProperty` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject
<span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.psiUtil.isPublic
<span class="lineno"> 19 </span>
<span class="lineno"> 20 </span><span class="error">/**</span>
<span class="lineno"> 21 </span><span class="error"> * This rule will report any public property which does not have the required documentation.</span>
<span class="lineno"> 22 </span><span class="error"> * This also includes public properties defined in a primary constructor.</span>
<span class="lineno"> 23 </span><span class="error"> * If the codebase should have documentation on all public properties enable this rule to enforce this.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyBlocks.kt:21:1</span><span class="message">The class `EmptyBlocks` is using inheritance, consider using composition instead.
Does `EmptyBlocks` want to expose the complete interface (`runIfActive, postVisit, preVisit, visitCondition`) of `MultiRule` such that `EmptyBlocks` can be used where `MultiRule` is expected? Indicates __inheritance__.
Does `EmptyBlocks` want only some/part of the behavior exposed by `MultiRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.KtWhenExpression
<span class="lineno"> 19 </span>import org.jetbrains.kotlin.psi.KtWhileExpression
<span class="lineno"> 20 </span>
<span class="lineno"> 21 </span><span class="error">/**</span>
<span class="lineno"> 22 </span><span class="error"> *</span>
<span class="lineno"> 23 </span><span class="error"> * <noncompliant></span>
<span class="lineno"> 24 </span><span class="error"> * // unnecessary empty blocks should be removed</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyCatchBlock.kt:9:1</span><span class="message">The class `EmptyCatchBlock` is using inheritance, consider using composition instead.
Does `EmptyCatchBlock` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyCatchBlock` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyCatchBlock` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 6 </span>import io.gitlab.arturbosch.detekt.rules.isAllowedExceptionName
<span class="lineno"> 7 </span>import org.jetbrains.kotlin.psi.KtCatchClause
<span class="lineno"> 8 </span>
<span class="lineno"> 9 </span><span class="error">/**</span>
<span class="lineno"> 10 </span><span class="error"> * Reports empty `catch` blocks. Empty catch blocks indicate that an exception is ignored and not handled.</span>
<span class="lineno"> 11 </span><span class="error"> * In case exceptions are ignored intentionally, this should be made explicit</span>
<span class="lineno"> 12 </span><span class="error"> * by using the specified names in the `allowedExceptionNameRegex`.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyClassBlock.kt:10:1</span><span class="message">The class `EmptyClassBlock` is using inheritance, consider using composition instead.
Does `EmptyClassBlock` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyClassBlock` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyClassBlock` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 7 </span>import org.jetbrains.kotlin.psi.KtClassOrObject
<span class="lineno"> 8 </span>import org.jetbrains.kotlin.psi.psiUtil.isObjectLiteral
<span class="lineno"> 9 </span>
<span class="lineno"> 10 </span><span class="error">/**</span>
<span class="lineno"> 11 </span><span class="error"> * Reports empty classes. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 12 </span><span class="error"> *</span>
<span class="lineno"> 13 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyDefaultConstructor.kt:14:1</span><span class="message">The class `EmptyDefaultConstructor` is using inheritance, consider using composition instead.
Does `EmptyDefaultConstructor` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyDefaultConstructor` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyDefaultConstructor` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.psiUtil.hasExpectModifier
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.psiUtil.visibilityModifierType
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Reports empty default constructors. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 16 </span><span class="error"> *</span>
<span class="lineno"> 17 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyDoWhileBlock.kt:6:1</span><span class="message">The class `EmptyDoWhileBlock` is using inheritance, consider using composition instead.
Does `EmptyDoWhileBlock` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyDoWhileBlock` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyDoWhileBlock` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 4 </span>import org.jetbrains.kotlin.psi.KtDoWhileExpression
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">/**</span>
<span class="lineno"> 7 </span><span class="error"> * Reports empty `do`/`while` loops. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 8 </span><span class="error"> *</span>
<span class="lineno"> 9 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyElseBlock.kt:6:1</span><span class="message">The class `EmptyElseBlock` is using inheritance, consider using composition instead.
Does `EmptyElseBlock` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyElseBlock` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyElseBlock` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 4 </span>import org.jetbrains.kotlin.psi.KtIfExpression
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">/**</span>
<span class="lineno"> 7 </span><span class="error"> * Reports empty `else` blocks. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 8 </span><span class="error"> *</span>
<span class="lineno"> 9 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyFinallyBlock.kt:6:1</span><span class="message">The class `EmptyFinallyBlock` is using inheritance, consider using composition instead.
Does `EmptyFinallyBlock` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyFinallyBlock` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyFinallyBlock` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 4 </span>import org.jetbrains.kotlin.psi.KtFinallySection
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">/**</span>
<span class="lineno"> 7 </span><span class="error"> * Reports empty `finally` blocks. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 8 </span><span class="error"> *</span>
<span class="lineno"> 9 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyForBlock.kt:6:1</span><span class="message">The class `EmptyForBlock` is using inheritance, consider using composition instead.
Does `EmptyForBlock` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyForBlock` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyForBlock` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 4 </span>import org.jetbrains.kotlin.psi.KtForExpression
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">/**</span>
<span class="lineno"> 7 </span><span class="error"> * Reports empty `for` loops. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 8 </span><span class="error"> *</span>
<span class="lineno"> 9 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyFunctionBlock.kt:10:1</span><span class="message">The class `EmptyFunctionBlock` is using inheritance, consider using composition instead.
Does `EmptyFunctionBlock` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyFunctionBlock` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyFunctionBlock` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 7 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 8 </span>import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
<span class="lineno"> 9 </span>
<span class="lineno"> 10 </span><span class="error">/**</span>
<span class="lineno"> 11 </span><span class="error"> * Reports empty functions. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 12 </span><span class="error"> * This rule will not report functions with the override modifier that have a comment as their only body contents</span>
<span class="lineno"> 13 </span><span class="error"> * (e.g., a // no-op comment in an unused listener function).</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyIfBlock.kt:10:1</span><span class="message">The class `EmptyIfBlock` is using inheritance, consider using composition instead.
Does `EmptyIfBlock` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyIfBlock` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyIfBlock` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 7 </span>import org.jetbrains.kotlin.lexer.KtSingleValueToken
<span class="lineno"> 8 </span>import org.jetbrains.kotlin.psi.KtIfExpression
<span class="lineno"> 9 </span>
<span class="lineno"> 10 </span><span class="error">/**</span>
<span class="lineno"> 11 </span><span class="error"> * Reports empty `if` blocks. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 12 </span><span class="error"> *</span>
<span class="lineno"> 13 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyInitBlock.kt:6:1</span><span class="message">The class `EmptyInitBlock` is using inheritance, consider using composition instead.
Does `EmptyInitBlock` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyInitBlock` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyInitBlock` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 4 </span>import org.jetbrains.kotlin.psi.KtClassInitializer
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">/**</span>
<span class="lineno"> 7 </span><span class="error"> * Reports empty `init` expressions. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 8 </span><span class="error"> *</span>
<span class="lineno"> 9 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyKtFile.kt:8:1</span><span class="message">The class `EmptyKtFile` is using inheritance, consider using composition instead.
Does `EmptyKtFile` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyKtFile` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyKtFile` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.api.Entity
<span class="lineno"> 6 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 7 </span>
<span class="lineno"> 8 </span><span class="error">/**</span>
<span class="lineno"> 9 </span><span class="error"> * Reports empty Kotlin (.kt) files. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 10 </span><span class="error"> *</span>
<span class="lineno"> 11 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyRule.kt:14:1</span><span class="message">The class `EmptyRule` is using inheritance, consider using composition instead.
Does `EmptyRule` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `EmptyRule` can be used where `Rule` is expected? Indicates __inheritance__.
Does `EmptyRule` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtBlockExpression
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtExpression
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Rule to detect empty blocks of code.</span>
<span class="lineno"> 16 </span><span class="error"> */</span>
<span class="lineno"> 17 </span><span class="error">abstract class EmptyRule(</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptySecondaryConstructor.kt:6:1</span><span class="message">The class `EmptySecondaryConstructor` is using inheritance, consider using composition instead.
Does `EmptySecondaryConstructor` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptySecondaryConstructor` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptySecondaryConstructor` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 4 </span>import org.jetbrains.kotlin.psi.KtSecondaryConstructor
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">/**</span>
<span class="lineno"> 7 </span><span class="error"> * Reports empty secondary constructors. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 8 </span><span class="error"> *</span>
<span class="lineno"> 9 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyTryBlock.kt:6:1</span><span class="message">The class `EmptyTryBlock` is using inheritance, consider using composition instead.
Does `EmptyTryBlock` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyTryBlock` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyTryBlock` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 4 </span>import org.jetbrains.kotlin.psi.KtTryExpression
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">/**</span>
<span class="lineno"> 7 </span><span class="error"> * Reports empty `try` blocks. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 8 </span><span class="error"> *</span>
<span class="lineno"> 9 </span><span class="error"> * @active since v1.6.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyWhenBlock.kt:8:1</span><span class="message">The class `EmptyWhenBlock` is using inheritance, consider using composition instead.
Does `EmptyWhenBlock` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyWhenBlock` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyWhenBlock` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.api.Entity
<span class="lineno"> 6 </span>import org.jetbrains.kotlin.psi.KtWhenExpression
<span class="lineno"> 7 </span>
<span class="lineno"> 8 </span><span class="error">/**</span>
<span class="lineno"> 9 </span><span class="error"> * Reports empty `when` expressions. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 10 </span><span class="error"> *</span>
<span class="lineno"> 11 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyWhileBlock.kt:6:1</span><span class="message">The class `EmptyWhileBlock` is using inheritance, consider using composition instead.
Does `EmptyWhileBlock` want to expose the complete interface (`addFindingIfBlockExprIsEmptyAndNotCommented, addFindingIfBlockExprIsEmpty`) of `EmptyRule` such that `EmptyWhileBlock` can be used where `EmptyRule` is expected? Indicates __inheritance__.
Does `EmptyWhileBlock` want only some/part of the behavior exposed by `EmptyRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.Config
<span class="lineno"> 4 </span>import org.jetbrains.kotlin.psi.KtWhileExpression
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">/**</span>
<span class="lineno"> 7 </span><span class="error"> * Reports empty `while` expressions. Empty blocks of code serve no purpose and should be removed.</span>
<span class="lineno"> 8 </span><span class="error"> *</span>
<span class="lineno"> 9 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/ExceptionRaisedInUnexpectedLocation.kt:16:1</span><span class="message">The class `ExceptionRaisedInUnexpectedLocation` is using inheritance, consider using composition instead.
Does `ExceptionRaisedInUnexpectedLocation` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ExceptionRaisedInUnexpectedLocation` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ExceptionRaisedInUnexpectedLocation` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtThrowExpression
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.psiUtil.anyDescendantOfType
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * This rule allows to define functions which should never throw an exception. If a function exists that does throw</span>
<span class="lineno"> 18 </span><span class="error"> * an exception it will be reported. By default this rule is checking for `toString`, `hashCode`, `equals` and</span>
<span class="lineno"> 19 </span><span class="error"> * `finalize`. This rule is configurable via the `methodNames` configuration to change the list of functions which</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/InstanceOfCheckForException.kt:21:1</span><span class="message">The class `InstanceOfCheckForException` is using inheritance, consider using composition instead.
Does `InstanceOfCheckForException` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `InstanceOfCheckForException` can be used where `Rule` is expected? Indicates __inheritance__.
Does `InstanceOfCheckForException` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 18 </span>import org.jetbrains.kotlin.resolve.BindingContext
<span class="lineno"> 19 </span>import org.jetbrains.kotlin.types.typeUtil.isSubtypeOf
<span class="lineno"> 20 </span>
<span class="lineno"> 21 </span><span class="error">/**</span>
<span class="lineno"> 22 </span><span class="error"> * This rule reports `catch` blocks which check for the type of an exception via `is` checks or casts.</span>
<span class="lineno"> 23 </span><span class="error"> * Instead of catching generic exception types and then checking for specific exception types the code should</span>
<span class="lineno"> 24 </span><span class="error"> * use multiple catch blocks. These catch blocks should then catch the specific exceptions.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/NotImplementedDeclaration.kt:14:1</span><span class="message">The class `NotImplementedDeclaration` is using inheritance, consider using composition instead.
Does `NotImplementedDeclaration` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `NotImplementedDeclaration` can be used where `Rule` is expected? Indicates __inheritance__.
Does `NotImplementedDeclaration` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtThrowExpression
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.resolve.calls.callUtil.getCalleeExpressionIfAny
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * This rule reports all exceptions of the type `NotImplementedError` that are thrown. It also reports all `TODO(..)`</span>
<span class="lineno"> 16 </span><span class="error"> * functions.</span>
<span class="lineno"> 17 </span><span class="error"> * These indicate that functionality is still under development and will not work properly. Both of these should only</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/PrintStackTrace.kt:17:1</span><span class="message">The class `PrintStackTrace` is using inheritance, consider using composition instead.
Does `PrintStackTrace` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `PrintStackTrace` can be used where `Rule` is expected? Indicates __inheritance__.
Does `PrintStackTrace` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.psiUtil.getCallNameExpression
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.psiUtil.getReceiverExpression
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * This rule reports code that tries to print the stacktrace of an exception. Instead of simply printing a stacktrace</span>
<span class="lineno"> 19 </span><span class="error"> * a better logging solution should be used.</span>
<span class="lineno"> 20 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/RethrowCaughtException.kt:13:1</span><span class="message">The class `RethrowCaughtException` is using inheritance, consider using composition instead.
Does `RethrowCaughtException` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `RethrowCaughtException` can be used where `Rule` is expected? Indicates __inheritance__.
Does `RethrowCaughtException` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtCatchClause
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtThrowExpression
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * This rule reports all exceptions that are caught and then later re-thrown without modification.</span>
<span class="lineno"> 15 </span><span class="error"> * It ignores caught exceptions that are rethrown if there is work done before that.</span>
<span class="lineno"> 16 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/ReturnFromFinally.kt:16:1</span><span class="message">The class `ReturnFromFinally` is using inheritance, consider using composition instead.
Does `ReturnFromFinally` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ReturnFromFinally` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ReturnFromFinally` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.psiUtil.collectDescendantsOfType
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.psiUtil.parents
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * Reports all `return` statements in `finally` blocks.</span>
<span class="lineno"> 18 </span><span class="error"> * Using `return` statements in `finally` blocks can discard and hide exceptions that are thrown in the `try` block.</span>
<span class="lineno"> 19 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/SwallowedException.kt:27:1</span><span class="message">The class `SwallowedException` is using inheritance, consider using composition instead.
Does `SwallowedException` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `SwallowedException` can be used where `Rule` is expected? Indicates __inheritance__.
Does `SwallowedException` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 24 </span>import org.jetbrains.kotlin.psi.psiUtil.getQualifiedExpressionForReceiverOrThis
<span class="lineno"> 25 </span>import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
<span class="lineno"> 26 </span>
<span class="lineno"> 27 </span><span class="error">/**</span>
<span class="lineno"> 28 </span><span class="error"> * Exceptions should not be swallowed. This rule reports all instances where exceptions are `caught` and not correctly</span>
<span class="lineno"> 29 </span><span class="error"> * passed into a newly thrown exception.</span>
<span class="lineno"> 30 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/ThrowingExceptionFromFinally.kt:14:1</span><span class="message">The class `ThrowingExceptionFromFinally` is using inheritance, consider using composition instead.
Does `ThrowingExceptionFromFinally` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ThrowingExceptionFromFinally` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ThrowingExceptionFromFinally` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtThrowExpression
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.psiUtil.forEachDescendantOfType
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * This rule reports all cases where exceptions are thrown from a `finally` block. Throwing exceptions from a `finally`</span>
<span class="lineno"> 16 </span><span class="error"> * block should be avoided as it can lead to confusion and discarded exceptions.</span>
<span class="lineno"> 17 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/ThrowingExceptionInMain.kt:15:1</span><span class="message">The class `ThrowingExceptionInMain` is using inheritance, consider using composition instead.
Does `ThrowingExceptionInMain` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ThrowingExceptionInMain` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ThrowingExceptionInMain` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtThrowExpression
<span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.psiUtil.anyDescendantOfType
<span class="lineno"> 14 </span>
<span class="lineno"> 15 </span><span class="error">/**</span>
<span class="lineno"> 16 </span><span class="error"> * This rule reports all exceptions that are thrown in a `main` method.</span>
<span class="lineno"> 17 </span><span class="error"> * An exception should only be thrown if it can be handled by a "higher" function.</span>
<span class="lineno"> 18 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/ThrowingExceptionsWithoutMessageOrCause.kt:13:1</span><span class="message">The class `ThrowingExceptionsWithoutMessageOrCause` is using inheritance, consider using composition instead.
Does `ThrowingExceptionsWithoutMessageOrCause` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ThrowingExceptionsWithoutMessageOrCause` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ThrowingExceptionsWithoutMessageOrCause` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import io.gitlab.arturbosch.detekt.rules.valueOrDefaultCommaSeparated
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtCallExpression
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * This rule reports all exceptions which are thrown without arguments or further description.</span>
<span class="lineno"> 15 </span><span class="error"> * Exceptions should always call one of the constructor overloads to provide a message or a cause.</span>
<span class="lineno"> 16 </span><span class="error"> * Exceptions should be meaningful and contain as much detail about the error case as possible. This will help to track</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/ThrowingNewInstanceOfSameException.kt:16:1</span><span class="message">The class `ThrowingNewInstanceOfSameException` is using inheritance, consider using composition instead.
Does `ThrowingNewInstanceOfSameException` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ThrowingNewInstanceOfSameException` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ThrowingNewInstanceOfSameException` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtValueArgument
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.psiUtil.findDescendantOfType
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * Exceptions should not be wrapped inside the same exception type and then rethrown. Prefer wrapping exceptions in more</span>
<span class="lineno"> 18 </span><span class="error"> * meaningful exception types.</span>
<span class="lineno"> 19 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/TooGenericExceptionCaught.kt:16:1</span><span class="message">The class `TooGenericExceptionCaught` is using inheritance, consider using composition instead.
Does `TooGenericExceptionCaught` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `TooGenericExceptionCaught` can be used where `Rule` is expected? Indicates __inheritance__.
Does `TooGenericExceptionCaught` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtCatchClause
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtTypeReference
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * This rule reports `catch` blocks for exceptions that have a type that is too generic.</span>
<span class="lineno"> 18 </span><span class="error"> * It should be preferred to catch specific exceptions to the case that is currently handled. If the scope of the caught</span>
<span class="lineno"> 19 </span><span class="error"> * exception is too broad it can lead to unintended exceptions being caught.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/exceptions/TooGenericExceptionThrown.kt:13:1</span><span class="message">The class `TooGenericExceptionThrown` is using inheritance, consider using composition instead.
Does `TooGenericExceptionThrown` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `TooGenericExceptionThrown` can be used where `Rule` is expected? Indicates __inheritance__.
Does `TooGenericExceptionThrown` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtThrowExpression
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.psiUtil.referenceExpression
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * This rule reports thrown exceptions that have a type that is too generic. It should be preferred to throw specific</span>
<span class="lineno"> 15 </span><span class="error"> * exceptions to the case that has currently occurred.</span>
<span class="lineno"> 16 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/ClassNaming.kt:14:1</span><span class="message">The class `ClassNaming` is using inheritance, consider using composition instead.
Does `ClassNaming` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ClassNaming` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ClassNaming` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import io.gitlab.arturbosch.detekt.rules.identifierName
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtClassOrObject
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Reports when class or object names which do not follow the specified naming convention are used.</span>
<span class="lineno"> 16 </span><span class="error"> *</span>
<span class="lineno"> 17 </span><span class="error"> * @configuration classPattern - naming pattern (default: `'[A-Z$][a-zA-Z0-9$]*'`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/ConstructorParameterNaming.kt:17:1</span><span class="message">The class `ConstructorParameterNaming` is using inheritance, consider using composition instead.
Does `ConstructorParameterNaming` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ConstructorParameterNaming` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ConstructorParameterNaming` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtParameter
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.psiUtil.isPrivate
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * Reports constructor parameter names which do not follow the specified naming convention are used.</span>
<span class="lineno"> 19 </span><span class="error"> *</span>
<span class="lineno"> 20 </span><span class="error"> * @configuration parameterPattern - naming pattern (default: `'[a-z][A-Za-z0-9]*'`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/EnumNaming.kt:14:1</span><span class="message">The class `EnumNaming` is using inheritance, consider using composition instead.
Does `EnumNaming` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `EnumNaming` can be used where `Rule` is expected? Indicates __inheritance__.
Does `EnumNaming` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import io.gitlab.arturbosch.detekt.rules.identifierName
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtEnumEntry
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Reports when enum names which do not follow the specified naming convention are used.</span>
<span class="lineno"> 16 </span><span class="error"> *</span>
<span class="lineno"> 17 </span><span class="error"> * @configuration enumEntryPattern - naming pattern (default: `'^[A-Z][_a-zA-Z0-9]*'`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/ForbiddenClassName.kt:13:1</span><span class="message">The class `ForbiddenClassName` is using inheritance, consider using composition instead.
Does `ForbiddenClassName` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ForbiddenClassName` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ForbiddenClassName` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import io.gitlab.arturbosch.detekt.rules.valueOrDefaultCommaSeparated
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtClassOrObject
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * Reports class names which are forbidden per configuration.</span>
<span class="lineno"> 15 </span><span class="error"> * By default this rule does not report any classes.</span>
<span class="lineno"> 16 </span><span class="error"> * Examples for forbidden names might be too generic class names like `...Manager`.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/FunctionMaxLength.kt:13:1</span><span class="message">The class `FunctionMaxLength` is using inheritance, consider using composition instead.
Does `FunctionMaxLength` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `FunctionMaxLength` can be used where `Rule` is expected? Indicates __inheritance__.
Does `FunctionMaxLength` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import io.gitlab.arturbosch.detekt.rules.identifierName
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * Reports when very long function names are used.</span>
<span class="lineno"> 15 </span><span class="error"> *</span>
<span class="lineno"> 16 </span><span class="error"> * @configuration maximumFunctionNameLength - maximum name length (default: `30`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/FunctionMinLength.kt:13:1</span><span class="message">The class `FunctionMinLength` is using inheritance, consider using composition instead.
Does `FunctionMinLength` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `FunctionMinLength` can be used where `Rule` is expected? Indicates __inheritance__.
Does `FunctionMinLength` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import io.gitlab.arturbosch.detekt.rules.identifierName
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * Reports when very short function names are used.</span>
<span class="lineno"> 15 </span><span class="error"> *</span>
<span class="lineno"> 16 </span><span class="error"> * @configuration minimumFunctionNameLength - minimum name length (default: `3`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/FunctionNaming.kt:16:1</span><span class="message">The class `FunctionNaming` is using inheritance, consider using composition instead.
Does `FunctionNaming` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `FunctionNaming` can be used where `Rule` is expected? Indicates __inheritance__.
Does `FunctionNaming` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import io.gitlab.arturbosch.detekt.rules.naming.util.isContainingExcludedClassOrObject
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * Reports when function names which do not follow the specified naming convention are used.</span>
<span class="lineno"> 18 </span><span class="error"> * One exception are factory functions used to create instances of classes.</span>
<span class="lineno"> 19 </span><span class="error"> * These factory functions can have the same name as the class being created.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/FunctionParameterNaming.kt:16:1</span><span class="message">The class `FunctionParameterNaming` is using inheritance, consider using composition instead.
Does `FunctionParameterNaming` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `FunctionParameterNaming` can be used where `Rule` is expected? Indicates __inheritance__.
Does `FunctionParameterNaming` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import io.gitlab.arturbosch.detekt.rules.naming.util.isContainingExcludedClass
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtParameter
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * Reports function parameter names which do not follow the specified naming convention are used.</span>
<span class="lineno"> 18 </span><span class="error"> *</span>
<span class="lineno"> 19 </span><span class="error"> * @configuration parameterPattern - naming pattern (default: `'[a-z][A-Za-z0-9]*'`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/InvalidPackageDeclaration.kt:16:1</span><span class="message">The class `InvalidPackageDeclaration` is using inheritance, consider using composition instead.
Does `InvalidPackageDeclaration` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `InvalidPackageDeclaration` can be used where `Rule` is expected? Indicates __inheritance__.
Does `InvalidPackageDeclaration` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtPackageDirective
<span class="lineno"> 14 </span>import java.nio.file.Paths
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * Reports when the package declaration is missing or the file location does not match the declared package.</span>
<span class="lineno"> 18 </span><span class="error"> *</span>
<span class="lineno"> 19 </span><span class="error"> * @configuration rootPackage - if specified this part of the package structure is ignored (default: `''`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/MatchingDeclarationName.kt:15:1</span><span class="message">The class `MatchingDeclarationName` is using inheritance, consider using composition instead.
Does `MatchingDeclarationName` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `MatchingDeclarationName` can be used where `Rule` is expected? Indicates __inheritance__.
Does `MatchingDeclarationName` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtTypeAlias
<span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.psiUtil.isPrivate
<span class="lineno"> 14 </span>
<span class="lineno"> 15 </span><span class="error">/**</span>
<span class="lineno"> 16 </span><span class="error"> * "If a Kotlin file contains a single non-private class (potentially with related top-level declarations),</span>
<span class="lineno"> 17 </span><span class="error"> * its name should be the same as the name of the class, with the .kt extension appended.</span>
<span class="lineno"> 18 </span><span class="error"> * If a file contains multiple classes, or only top-level declarations,</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/MemberNameEqualsClassName.kt:22:1</span><span class="message">The class `MemberNameEqualsClassName` is using inheritance, consider using composition instead.
Does `MemberNameEqualsClassName` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `MemberNameEqualsClassName` can be used where `Rule` is expected? Indicates __inheritance__.
Does `MemberNameEqualsClassName` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 19 </span>import org.jetbrains.kotlin.psi.KtObjectDeclaration
<span class="lineno"> 20 </span>import org.jetbrains.kotlin.resolve.BindingContext
<span class="lineno"> 21 </span>
<span class="lineno"> 22 </span><span class="error">/**</span>
<span class="lineno"> 23 </span><span class="error"> * This rule reports a member that has the same as the containing class or object.</span>
<span class="lineno"> 24 </span><span class="error"> * This might result in confusion.</span>
<span class="lineno"> 25 </span><span class="error"> * The member should either be renamed or changed to a constructor.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/NamingRules.kt:18:1</span><span class="message">The class `NamingRules` is using inheritance, consider using composition instead.
Does `NamingRules` want to expose the complete interface (`runIfActive, postVisit, preVisit, visitCondition`) of `MultiRule` such that `NamingRules` can be used where `MultiRule` is expected? Indicates __inheritance__.
Does `NamingRules` want only some/part of the behavior exposed by `MultiRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtVariableDeclaration
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">class NamingRules(config: Config = Config.empty) : MultiRule() {</span>
<span class="lineno"> 19 </span><span class="error"></span>
<span class="lineno"> 20 </span><span class="error"> private val variableNamingRule = VariableNaming(config)</span>
<span class="lineno"> 21 </span><span class="error"> private val variableMinNameLengthRule = VariableMinLength(config)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/ObjectPropertyNaming.kt:16:1</span><span class="message">The class `ObjectPropertyNaming` is using inheritance, consider using composition instead.
Does `ObjectPropertyNaming` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ObjectPropertyNaming` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ObjectPropertyNaming` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.psiUtil.isPrivate
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * Reports when property names inside objects which do not follow the specified naming convention are used.</span>
<span class="lineno"> 18 </span><span class="error"> *</span>
<span class="lineno"> 19 </span><span class="error"> * @configuration constantPattern - naming pattern (default: `'[A-Za-z][_A-Za-z0-9]*'`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/PackageNaming.kt:13:1</span><span class="message">The class `PackageNaming` is using inheritance, consider using composition instead.
Does `PackageNaming` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `PackageNaming` can be used where `Rule` is expected? Indicates __inheritance__.
Does `PackageNaming` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtPackageDirective
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * Reports when package names which do not follow the specified naming convention are used.</span>
<span class="lineno"> 15 </span><span class="error"> *</span>
<span class="lineno"> 16 </span><span class="error"> * @configuration packagePattern - naming pattern (default: `'^[a-z]+(\.[a-z][A-Za-z0-9]*)*$'`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/TopLevelPropertyNaming.kt:16:1</span><span class="message">The class `TopLevelPropertyNaming` is using inheritance, consider using composition instead.
Does `TopLevelPropertyNaming` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `TopLevelPropertyNaming` can be used where `Rule` is expected? Indicates __inheritance__.
Does `TopLevelPropertyNaming` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.psiUtil.isPrivate
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * Reports when top level constant names which do not follow the specified naming convention are used.</span>
<span class="lineno"> 18 </span><span class="error"> *</span>
<span class="lineno"> 19 </span><span class="error"> * @configuration constantPattern - naming pattern (default: `'[A-Z][_A-Z0-9]*'`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/VariableMaxLength.kt:13:1</span><span class="message">The class `VariableMaxLength` is using inheritance, consider using composition instead.
Does `VariableMaxLength` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `VariableMaxLength` can be used where `Rule` is expected? Indicates __inheritance__.
Does `VariableMaxLength` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import io.gitlab.arturbosch.detekt.rules.identifierName
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * Reports when very long variable names are used.</span>
<span class="lineno"> 15 </span><span class="error"> *</span>
<span class="lineno"> 16 </span><span class="error"> * @configuration maximumVariableNameLength - maximum name length (default: `64`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/VariableMinLength.kt:14:1</span><span class="message">The class `VariableMinLength` is using inheritance, consider using composition instead.
Does `VariableMinLength` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `VariableMinLength` can be used where `Rule` is expected? Indicates __inheritance__.
Does `VariableMinLength` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.resolve.calls.util.isSingleUnderscore
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Reports when very short variable names are used.</span>
<span class="lineno"> 16 </span><span class="error"> *</span>
<span class="lineno"> 17 </span><span class="error"> * @configuration minimumVariableNameLength - maximum name length (default: `1`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/naming/VariableNaming.kt:18:1</span><span class="message">The class `VariableNaming` is using inheritance, consider using composition instead.
Does `VariableNaming` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `VariableNaming` can be used where `Rule` is expected? Indicates __inheritance__.
Does `VariableNaming` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.psiUtil.isPrivate
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.resolve.calls.util.isSingleUnderscore
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * Reports when variable names which do not follow the specified naming convention are used.</span>
<span class="lineno"> 20 </span><span class="error"> *</span>
<span class="lineno"> 21 </span><span class="error"> * @configuration variablePattern - naming pattern (default: `'[a-z][A-Za-z0-9]*'`)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/performance/ArrayPrimitive.kt:16:1</span><span class="message">The class `ArrayPrimitive` is using inheritance, consider using composition instead.
Does `ArrayPrimitive` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ArrayPrimitive` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ArrayPrimitive` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtTypeReference
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.psiUtil.collectDescendantsOfType
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * Using Array<Primitive> leads to implicit boxing and performance hit. Prefer using Kotlin specialized Array</span>
<span class="lineno"> 18 </span><span class="error"> * Instances.</span>
<span class="lineno"> 19 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/performance/ForEachOnRange.kt:18:1</span><span class="message">The class `ForEachOnRange` is using inheritance, consider using composition instead.
Does `ForEachOnRange` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ForEachOnRange` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ForEachOnRange` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.psiUtil.getCallNameExpression
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.psiUtil.getReceiverExpression
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * Using the forEach method on ranges has a heavy performance cost. Prefer using simple for loops.</span>
<span class="lineno"> 20 </span><span class="error"> *</span>
<span class="lineno"> 21 </span><span class="error"> * Benchmarks have shown that using forEach on a range can have a huge performance cost in comparison to</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/performance/SpreadOperator.kt:18:1</span><span class="message">The class `SpreadOperator` is using inheritance, consider using composition instead.
Does `SpreadOperator` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `SpreadOperator` can be used where `Rule` is expected? Indicates __inheritance__.
Does `SpreadOperator` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.resolve.DescriptorUtils
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * In most cases using a spread operator causes a full copy of the array to be created before calling a method.</span>
<span class="lineno"> 20 </span><span class="error"> * This has a very high performance penalty. Benchmarks showing this performance penalty can be seen here:</span>
<span class="lineno"> 21 </span><span class="error"> * https://sites.google.com/a/athaydes.com/renato-athaydes/posts/kotlinshiddencosts-benchmarks</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/performance/UnnecessaryTemporaryInstantiation.kt:14:1</span><span class="message">The class `UnnecessaryTemporaryInstantiation` is using inheritance, consider using composition instead.
Does `UnnecessaryTemporaryInstantiation` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnnecessaryTemporaryInstantiation` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnnecessaryTemporaryInstantiation` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtCallExpression
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtExpression
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Avoid temporary objects when converting primitive types to String. This has a performance penalty when compared</span>
<span class="lineno"> 16 </span><span class="error"> * to using primitive types directly.</span>
<span class="lineno"> 17 </span><span class="error"> * To solve this issue, remove the wrapping type.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/CollapsibleIfStatements.kt:16:1</span><span class="message">The class `CollapsibleIfStatements` is using inheritance, consider using composition instead.
Does `CollapsibleIfStatements` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `CollapsibleIfStatements` can be used where `Rule` is expected? Indicates __inheritance__.
Does `CollapsibleIfStatements` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtIfExpression
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.psiUtil.getChildrenOfType
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * This rule detects `if` statements which can be collapsed. This can reduce nesting and help improve readability.</span>
<span class="lineno"> 18 </span><span class="error"> *</span>
<span class="lineno"> 19 </span><span class="error"> * However it should be carefully considered if merging the if statements actually does improve readability or if it</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/DataClassContainsFunctions.kt:15:1</span><span class="message">The class `DataClassContainsFunctions` is using inheritance, consider using composition instead.
Does `DataClassContainsFunctions` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `DataClassContainsFunctions` can be used where `Rule` is expected? Indicates __inheritance__.
Does `DataClassContainsFunctions` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtClass
<span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 14 </span>
<span class="lineno"> 15 </span><span class="error">/**</span>
<span class="lineno"> 16 </span><span class="error"> * This rule reports functions inside data classes which have not been whitelisted as a conversion function.</span>
<span class="lineno"> 17 </span><span class="error"> *</span>
<span class="lineno"> 18 </span><span class="error"> * Data classes should mainly be used to store data. This rule assumes that they should not contain any extra functions</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/DataClassShouldBeImmutable.kt:13:1</span><span class="message">The class `DataClassShouldBeImmutable` is using inheritance, consider using composition instead.
Does `DataClassShouldBeImmutable` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `DataClassShouldBeImmutable` can be used where `Rule` is expected? Indicates __inheritance__.
Does `DataClassShouldBeImmutable` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import org.jetbrains.kotlin.com.intellij.psi.PsiElement
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtClass
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * This rule reports mutable properties inside data classes.</span>
<span class="lineno"> 15 </span><span class="error"> *</span>
<span class="lineno"> 16 </span><span class="error"> * Data classes should mainly be used to store immutable data. This rule assumes that they should not contain any</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/EqualsNullCall.kt:12:1</span><span class="message">The class `EqualsNullCall` is using inheritance, consider using composition instead.
Does `EqualsNullCall` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `EqualsNullCall` can be used where `Rule` is expected? Indicates __inheritance__.
Does `EqualsNullCall` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtCallExpression
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span><span class="error">/**</span>
<span class="lineno"> 13 </span><span class="error"> * To compare an object with `null` prefer using `==`. This rule detects and reports instances in the code where the</span>
<span class="lineno"> 14 </span><span class="error"> * `equals()` method is used to compare a value with `null`.</span>
<span class="lineno"> 15 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/EqualsOnSignatureLine.kt:14:1</span><span class="message">The class `EqualsOnSignatureLine` is using inheritance, consider using composition instead.
Does `EqualsOnSignatureLine` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `EqualsOnSignatureLine` can be used where `Rule` is expected? Indicates __inheritance__.
Does `EqualsOnSignatureLine` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.psiUtil.siblings
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * Requires that the equals sign, when used for an expression style function, is on the same line as the</span>
<span class="lineno"> 16 </span><span class="error"> * rest of the function signature.</span>
<span class="lineno"> 17 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ExplicitCollectionElementAccessMethod.kt:18:1</span><span class="message">The class `ExplicitCollectionElementAccessMethod` is using inheritance, consider using composition instead.
Does `ExplicitCollectionElementAccessMethod` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ExplicitCollectionElementAccessMethod` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ExplicitCollectionElementAccessMethod` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.types.KotlinType
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.types.typeUtil.supertypes
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * In Kotlin functions `get` or `set` can be replaced with the shorter operator — `[]`,</span>
<span class="lineno"> 20 </span><span class="error"> * see https://kotlinlang.org/docs/reference/operator-overloading.html#indexed.</span>
<span class="lineno"> 21 </span><span class="error"> * Prefer the usage of the indexed access operator `[]` for map or list element access or insert methods.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ExplicitItLambdaParameter.kt:13:1</span><span class="message">The class `ExplicitItLambdaParameter` is using inheritance, consider using composition instead.
Does `ExplicitItLambdaParameter` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ExplicitItLambdaParameter` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ExplicitItLambdaParameter` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import io.gitlab.arturbosch.detekt.rules.IT_LITERAL
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtLambdaExpression
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * Lambda expressions are one of the core features of the language. They often include very small chunks of</span>
<span class="lineno"> 15 </span><span class="error"> * code using only one parameter. In this cases Kotlin can supply the implicit `it` parameter</span>
<span class="lineno"> 16 </span><span class="error"> * to make code more concise. It fits most usecases, but when faced larger or nested chunks of code,</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ExpressionBodySyntax.kt:18:1</span><span class="message">The class `ExpressionBodySyntax` is using inheritance, consider using composition instead.
Does `ExpressionBodySyntax` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ExpressionBodySyntax` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ExpressionBodySyntax` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtReturnExpression
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.psiUtil.anyDescendantOfType
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * Functions which only contain a `return` statement can be collapsed to an expression body. This shortens and</span>
<span class="lineno"> 20 </span><span class="error"> * cleans up the code.</span>
<span class="lineno"> 21 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/FileParsingRule.kt:7:1</span><span class="message">The class `FileParsingRule` is using inheritance, consider using composition instead.
Does `FileParsingRule` want to expose the complete interface (`runIfActive, postVisit, preVisit, visitCondition`) of `MultiRule` such that `FileParsingRule` can be used where `MultiRule` is expected? Indicates __inheritance__.
Does `FileParsingRule` want only some/part of the behavior exposed by `MultiRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.MultiRule
<span class="lineno"> 5 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 6 </span>
<span class="lineno"> 7 </span><span class="error">class FileParsingRule(val config: Config = Config.empty) : MultiRule() {</span>
<span class="lineno"> 8 </span><span class="error"></span>
<span class="lineno"> 9 </span><span class="error"> private val maxLineLength = MaxLineLength(config)</span>
<span class="lineno"> 10 </span><span class="error"> private val trailingWhitespace = TrailingWhitespace(config)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenComment.kt:13:1</span><span class="message">The class `ForbiddenComment` is using inheritance, consider using composition instead.
Does `ForbiddenComment` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ForbiddenComment` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ForbiddenComment` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import io.gitlab.arturbosch.detekt.rules.valueOrDefaultCommaSeparated
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.com.intellij.psi.PsiComment
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * This rule allows to set a list of comments which are forbidden in the codebase and should only be used during</span>
<span class="lineno"> 15 </span><span class="error"> * development. Offending code comments will then be reported.</span>
<span class="lineno"> 16 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenImport.kt:14:1</span><span class="message">The class `ForbiddenImport` is using inheritance, consider using composition instead.
Does `ForbiddenImport` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ForbiddenImport` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ForbiddenImport` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import io.gitlab.arturbosch.detekt.rules.valueOrDefaultCommaSeparated
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtImportDirective
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * This rule allows to set a list of forbidden imports. This can be used to discourage the use of unstable, experimental</span>
<span class="lineno"> 16 </span><span class="error"> * or deprecated APIs. Detekt will then report all imports that are forbidden.</span>
<span class="lineno"> 17 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenMethodCall.kt:16:1</span><span class="message">The class `ForbiddenMethodCall` is using inheritance, consider using composition instead.
Does `ForbiddenMethodCall` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ForbiddenMethodCall` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ForbiddenMethodCall` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameOrNull
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * This rule allows to set a list of forbidden methods. This can be used to discourage the use of unstable, experimental</span>
<span class="lineno"> 18 </span><span class="error"> * or deprecated methods, especially for methods imported from external libraries.</span>
<span class="lineno"> 19 </span><span class="error"> * Detekt will then report all methods invocation that are forbidden.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenPublicDataClass.kt:17:1</span><span class="message">The class `ForbiddenPublicDataClass` is using inheritance, consider using composition instead.
Does `ForbiddenPublicDataClass` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ForbiddenPublicDataClass` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ForbiddenPublicDataClass` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.psiUtil.visibilityModifierTypeOrDefault
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * The data classes are bad for the binary compatibility in public APIs. Avoid to use it.</span>
<span class="lineno"> 19 </span><span class="error"> *</span>
<span class="lineno"> 20 </span><span class="error"> * This rule is aimed to library maintainers. If you are developing a final application you don't need to care about</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenVoid.kt:21:1</span><span class="message">The class `ForbiddenVoid` is using inheritance, consider using composition instead.
Does `ForbiddenVoid` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ForbiddenVoid` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ForbiddenVoid` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 18 </span>import org.jetbrains.kotlin.resolve.bindingContextUtil.getAbbreviatedTypeOrType
<span class="lineno"> 19 </span>import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameOrNull
<span class="lineno"> 20 </span>
<span class="lineno"> 21 </span><span class="error">/**</span>
<span class="lineno"> 22 </span><span class="error"> * This rule detects usages of `Void` and reports them as forbidden.</span>
<span class="lineno"> 23 </span><span class="error"> * The Kotlin type `Unit` should be used instead. This type corresponds to the `Void` class in Java</span>
<span class="lineno"> 24 </span><span class="error"> * and has only one value - the `Unit` object.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/FunctionOnlyReturningConstant.kt:23:1</span><span class="message">The class `FunctionOnlyReturningConstant` is using inheritance, consider using composition instead.
Does `FunctionOnlyReturningConstant` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `FunctionOnlyReturningConstant` can be used where `Rule` is expected? Indicates __inheritance__.
Does `FunctionOnlyReturningConstant` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 20 </span>import org.jetbrains.kotlin.psi.KtStringTemplateExpression
<span class="lineno"> 21 </span>import org.jetbrains.kotlin.psi.psiUtil.containingClass
<span class="lineno"> 22 </span>
<span class="lineno"> 23 </span><span class="error">/**</span>
<span class="lineno"> 24 </span><span class="error"> * A function that only returns a single constant can be misleading. Instead prefer to define the constant directly</span>
<span class="lineno"> 25 </span><span class="error"> * as a `const val`.</span>
<span class="lineno"> 26 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/LibraryCodeMustSpecifyReturnType.kt:15:1</span><span class="message">The class `LibraryCodeMustSpecifyReturnType` is using inheritance, consider using composition instead.
Does `LibraryCodeMustSpecifyReturnType` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `LibraryCodeMustSpecifyReturnType` can be used where `Rule` is expected? Indicates __inheritance__.
Does `LibraryCodeMustSpecifyReturnType` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.psiUtil.isPublic
<span class="lineno"> 14 </span>
<span class="lineno"> 15 </span><span class="error">/**</span>
<span class="lineno"> 16 </span><span class="error"> * Library functions/properties should have an explicit return type.</span>
<span class="lineno"> 17 </span><span class="error"> * Inferred return type can easily be changed by mistake which may lead to breaking changes.</span>
<span class="lineno"> 18 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/LoopWithTooManyJumpStatements.kt:17:1</span><span class="message">The class `LoopWithTooManyJumpStatements` is using inheritance, consider using composition instead.
Does `LoopWithTooManyJumpStatements` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `LoopWithTooManyJumpStatements` can be used where `Rule` is expected? Indicates __inheritance__.
Does `LoopWithTooManyJumpStatements` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtExpression
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtLoopExpression
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * Loops which contain multiple `break` or `continue` statements are hard to read and understand.</span>
<span class="lineno"> 19 </span><span class="error"> * To increase readability they should be refactored into simpler loops.</span>
<span class="lineno"> 20 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/MagicNumber.kt:34:1</span><span class="message">The class `MagicNumber` is using inheritance, consider using composition instead.
Does `MagicNumber` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `MagicNumber` can be used where `Rule` is expected? Indicates __inheritance__.
Does `MagicNumber` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 31 </span>import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
<span class="lineno"> 32 </span>import java.util.Locale
<span class="lineno"> 33 </span>
<span class="lineno"> 34 </span><span class="error">/**</span>
<span class="lineno"> 35 </span><span class="error"> * This rule detects and reports usages of magic numbers in the code. Prefer defining constants with clear names</span>
<span class="lineno"> 36 </span><span class="error"> * describing what the magic number means.</span>
<span class="lineno"> 37 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/MaxLineLength.kt:15:1</span><span class="message">The class `MaxLineLength` is using inheritance, consider using composition instead.
Does `MaxLineLength` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `MaxLineLength` can be used where `Rule` is expected? Indicates __inheritance__.
Does `MaxLineLength` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 12 </span>
<span class="lineno"> 13 </span>data class KtFileContent(val file: KtFile, val content: Sequence<String>)
<span class="lineno"> 14 </span>
<span class="lineno"> 15 </span><span class="error">/**</span>
<span class="lineno"> 16 </span><span class="error"> * This rule reports lines of code which exceed a defined maximum line length.</span>
<span class="lineno"> 17 </span><span class="error"> *</span>
<span class="lineno"> 18 </span><span class="error"> * Long lines might be hard to read on smaller screens or printouts. Additionally having a maximum line length</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/MayBeConst.kt:24:1</span><span class="message">The class `MayBeConst` is using inheritance, consider using composition instead.
Does `MayBeConst` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `MayBeConst` can be used where `Rule` is expected? Indicates __inheritance__.
Does `MayBeConst` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 21 </span>import org.jetbrains.kotlin.psi.KtStringTemplateExpression
<span class="lineno"> 22 </span>import org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject
<span class="lineno"> 23 </span>
<span class="lineno"> 24 </span><span class="error">/**</span>
<span class="lineno"> 25 </span><span class="error"> * This rule identifies and reports properties (`val`) that may be `const val` instead.</span>
<span class="lineno"> 26 </span><span class="error"> * Using `const val` can lead to better performance of the resulting bytecode as well as better interoperability with</span>
<span class="lineno"> 27 </span><span class="error"> * Java.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ModifierOrder.kt:39:1</span><span class="message">The class `ModifierOrder` is using inheritance, consider using composition instead.
Does `ModifierOrder` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ModifierOrder` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ModifierOrder` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 36 </span>import org.jetbrains.kotlin.psi.KtModifierList
<span class="lineno"> 37 </span>import org.jetbrains.kotlin.psi.psiUtil.allChildren
<span class="lineno"> 38 </span>
<span class="lineno"> 39 </span><span class="error">/**</span>
<span class="lineno"> 40 </span><span class="error"> * This rule reports cases in the code where modifiers are not in the correct order. The default modifier order is</span>
<span class="lineno"> 41 </span><span class="error"> * taken from: http://kotlinlang.org/docs/reference/coding-conventions.html#modifiers</span>
<span class="lineno"> 42 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/NestedClassesVisibility.kt:16:1</span><span class="message">The class `NestedClassesVisibility` is using inheritance, consider using composition instead.
Does `NestedClassesVisibility` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `NestedClassesVisibility` can be used where `Rule` is expected? Indicates __inheritance__.
Does `NestedClassesVisibility` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtClassOrObject
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtEnumEntry
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * Nested classes inherit their visibility from the parent class</span>
<span class="lineno"> 18 </span><span class="error"> * and are often used to implement functionality local to the class it is nested in.</span>
<span class="lineno"> 19 </span><span class="error"> * These nested classes can't have a higher visibility than their parent.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/NewLineAtEndOfFile.kt:12:1</span><span class="message">The class `NewLineAtEndOfFile` is using inheritance, consider using composition instead.
Does `NewLineAtEndOfFile` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `NewLineAtEndOfFile` can be used where `Rule` is expected? Indicates __inheritance__.
Does `NewLineAtEndOfFile` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span><span class="error">/**</span>
<span class="lineno"> 13 </span><span class="error"> * This rule reports files which do not end with a line separator.</span>
<span class="lineno"> 14 </span><span class="error"> *</span>
<span class="lineno"> 15 </span><span class="error"> * @active since v1.0.0</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/NoTabs.kt:17:1</span><span class="message">The class `NoTabs` is using inheritance, consider using composition instead.
Does `NoTabs` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `NoTabs` can be used where `Rule` is expected? Indicates __inheritance__.
Does `NoTabs` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtStringTemplateEntryWithExpression
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * This rule reports if tabs are used in Kotlin files.</span>
<span class="lineno"> 19 </span><span class="error"> * According to</span>
<span class="lineno"> 20 </span><span class="error"> * [Google's Kotlin style guide](https://android.github.io/kotlin-guides/style.html#whitespace-characters)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/OptionalAbstractKeyword.kt:16:1</span><span class="message">The class `OptionalAbstractKeyword` is using inheritance, consider using composition instead.
Does `OptionalAbstractKeyword` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `OptionalAbstractKeyword` can be used where `Rule` is expected? Indicates __inheritance__.
Does `OptionalAbstractKeyword` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.psiUtil.getChildrenOfType
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * This rule reports `abstract` modifiers which are unnecessary and can be removed.</span>
<span class="lineno"> 18 </span><span class="error"> *</span>
<span class="lineno"> 19 </span><span class="error"> * <noncompliant></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/OptionalWhenBraces.kt:15:1</span><span class="message">The class `OptionalWhenBraces` is using inheritance, consider using composition instead.
Does `OptionalWhenBraces` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `OptionalWhenBraces` can be used where `Rule` is expected? Indicates __inheritance__.
Does `OptionalWhenBraces` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtLambdaExpression
<span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtWhenExpression
<span class="lineno"> 14 </span>
<span class="lineno"> 15 </span><span class="error">/**</span>
<span class="lineno"> 16 </span><span class="error"> * This rule reports unnecessary braces in when expressions. These optional braces should be removed.</span>
<span class="lineno"> 17 </span><span class="error"> *</span>
<span class="lineno"> 18 </span><span class="error"> * <noncompliant></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ProtectedMemberInFinalClass.kt:18:1</span><span class="message">The class `ProtectedMemberInFinalClass` is using inheritance, consider using composition instead.
Does `ProtectedMemberInFinalClass` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ProtectedMemberInFinalClass` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ProtectedMemberInFinalClass` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.psiUtil.isAbstract
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.psiUtil.isProtected
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * Kotlin classes are `final` by default. Thus classes which are not marked as `open` should not contain any `protected`</span>
<span class="lineno"> 20 </span><span class="error"> * members. Consider using `private` or `internal` modifiers instead.</span>
<span class="lineno"> 21 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ProtectedMemberInFinalClass.kt:67:5</span><span class="message">The class `DeclarationVisitor` is using inheritance, consider using composition instead.
Does `DeclarationVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `DeclarationVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `DeclarationVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 64 </span> return isNotAbstract && isFinal && isNotSealed && isNotEnum
<span class="lineno"> 65 </span> }
<span class="lineno"> 66 </span>
<span class="lineno"> 67 </span> <span class="error">internal inner class DeclarationVisitor : DetektVisitor() {</span>
<span class="lineno"> 68 </span><span class="error"></span>
<span class="lineno"> 69 </span><span class="error"> override fun visitDeclaration(dcl: KtDeclaration) {</span>
<span class="lineno"> 70 </span><span class="error"> if (dcl.isProtected() && !dcl.isOverride()) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/RedundantExplicitType.kt:28:1</span><span class="message">The class `RedundantExplicitType` is using inheritance, consider using composition instead.
Does `RedundantExplicitType` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `RedundantExplicitType` can be used where `Rule` is expected? Indicates __inheritance__.
Does `RedundantExplicitType` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 25 </span>import org.jetbrains.kotlin.types.typeUtil.isInt
<span class="lineno"> 26 </span>import org.jetbrains.kotlin.types.typeUtil.isLong
<span class="lineno"> 27 </span>
<span class="lineno"> 28 </span><span class="error">/**</span>
<span class="lineno"> 29 </span><span class="error"> * Local properties do not need their type to be explicitly provided when the inferred type matches the explicit type.</span>
<span class="lineno"> 30 </span><span class="error"> *</span>
<span class="lineno"> 31 </span><span class="error"> * <noncompliant></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/RedundantVisibilityModifierRule.kt:19:1</span><span class="message">The class `RedundantVisibilityModifierRule` is using inheritance, consider using composition instead.
Does `RedundantVisibilityModifierRule` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `RedundantVisibilityModifierRule` can be used where `Rule` is expected? Indicates __inheritance__.
Does `RedundantVisibilityModifierRule` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 18 </span>
<span class="lineno"> 19 </span><span class="error">/**</span>
<span class="lineno"> 20 </span><span class="error"> * This rule checks for redundant visibility modifiers.</span>
<span class="lineno"> 21 </span><span class="error"> *</span>
<span class="lineno"> 22 </span><span class="error"> * <noncompliant></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/RedundantVisibilityModifierRule.kt:59:5</span><span class="message">The class `ClassVisitor` is using inheritance, consider using composition instead.
Does `ClassVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `ClassVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `ClassVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 56 </span> }
<span class="lineno"> 57 </span> }
<span class="lineno"> 58 </span>
<span class="lineno"> 59 </span> <span class="error">private inner class ClassVisitor : DetektVisitor() {</span>
<span class="lineno"> 60 </span><span class="error"> override fun visitClass(klass: KtClass) {</span>
<span class="lineno"> 61 </span><span class="error"> super.visitClass(klass)</span>
<span class="lineno"> 62 </span><span class="error"> if (klass.isExplicitlyPublic()) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/RedundantVisibilityModifierRule.kt:72:5</span><span class="message">The class `ChildrenVisitor` is using inheritance, consider using composition instead.
Does `ChildrenVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `ChildrenVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `ChildrenVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 69 </span> }
<span class="lineno"> 70 </span> }
<span class="lineno"> 71 </span>
<span class="lineno"> 72 </span> <span class="error">private inner class ChildrenVisitor : DetektVisitor() {</span>
<span class="lineno"> 73 </span><span class="error"> override fun visitNamedFunction(function: KtNamedFunction) {</span>
<span class="lineno"> 74 </span><span class="error"> super.visitNamedFunction(function)</span>
<span class="lineno"> 75 </span><span class="error"> if (function.isExplicitlyPublicNotOverridden()) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ReturnCount.kt:20:1</span><span class="message">The class `ReturnCount` is using inheritance, consider using composition instead.
Does `ReturnCount` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ReturnCount` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ReturnCount` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.psiUtil.collectDescendantsOfType
<span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
<span class="lineno"> 19 </span>
<span class="lineno"> 20 </span><span class="error">/**</span>
<span class="lineno"> 21 </span><span class="error"> * Restrict the number of return methods allowed in methods.</span>
<span class="lineno"> 22 </span><span class="error"> *</span>
<span class="lineno"> 23 </span><span class="error"> * Having many exit points in a function can be confusing and impacts readability of the</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/SafeCast.kt:17:1</span><span class="message">The class `SafeCast` is using inheritance, consider using composition instead.
Does `SafeCast` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `SafeCast` can be used where `Rule` is expected? Indicates __inheritance__.
Does `SafeCast` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtIsExpression
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtNameReferenceExpression
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * This rule inspects casts and reports casts which could be replaced with safe casts instead.</span>
<span class="lineno"> 19 </span><span class="error"> *</span>
<span class="lineno"> 20 </span><span class="error"> * <noncompliant></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/SerialVersionUIDInSerializableClass.kt:19:1</span><span class="message">The class `SerialVersionUIDInSerializableClass` is using inheritance, consider using composition instead.
Does `SerialVersionUIDInSerializableClass` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `SerialVersionUIDInSerializableClass` can be used where `Rule` is expected? Indicates __inheritance__.
Does `SerialVersionUIDInSerializableClass` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.KtPrefixExpression
<span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 18 </span>
<span class="lineno"> 19 </span><span class="error">/**</span>
<span class="lineno"> 20 </span><span class="error"> * Classes which implement the `Serializable` interface should also correctly declare a `serialVersionUID`.</span>
<span class="lineno"> 21 </span><span class="error"> * This rule verifies that a `serialVersionUID` was correctly defined.</span>
<span class="lineno"> 22 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/SpacingBetweenPackageAndImports.kt:20:1</span><span class="message">The class `SpacingBetweenPackageAndImports` is using inheritance, consider using composition instead.
Does `SpacingBetweenPackageAndImports` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `SpacingBetweenPackageAndImports` can be used where `Rule` is expected? Indicates __inheritance__.
Does `SpacingBetweenPackageAndImports` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 17 </span>import org.jetbrains.kotlin.psi.psiUtil.anyDescendantOfType
<span class="lineno"> 18 </span>import org.jetbrains.kotlin.psi.psiUtil.siblings
<span class="lineno"> 19 </span>
<span class="lineno"> 20 </span><span class="error">/**</span>
<span class="lineno"> 21 </span><span class="error"> * This rule verifies spacing between package and import statements as well as between import statements and class</span>
<span class="lineno"> 22 </span><span class="error"> * declarations.</span>
<span class="lineno"> 23 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ThrowsCount.kt:17:1</span><span class="message">The class `ThrowsCount` is using inheritance, consider using composition instead.
Does `ThrowsCount` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `ThrowsCount` can be used where `Rule` is expected? Indicates __inheritance__.
Does `ThrowsCount` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtThrowExpression
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.psiUtil.collectDescendantsOfType
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * Functions should have clear `throw` statements. Functions with many `throw` statements can be harder to read and lead</span>
<span class="lineno"> 19 </span><span class="error"> * to confusion. Instead prefer to limit the amount of `throw` statements in a function.</span>
<span class="lineno"> 20 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/TrailingWhitespace.kt:12:1</span><span class="message">The class `TrailingWhitespace` is using inheritance, consider using composition instead.
Does `TrailingWhitespace` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `TrailingWhitespace` can be used where `Rule` is expected? Indicates __inheritance__.
Does `TrailingWhitespace` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 10 </span>import io.gitlab.arturbosch.detekt.rules.isPartOfString
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span><span class="error">/**</span>
<span class="lineno"> 13 </span><span class="error"> * This rule reports lines that end with a whitespace.</span>
<span class="lineno"> 14 </span><span class="error"> */</span>
<span class="lineno"> 15 </span><span class="error">class TrailingWhitespace(config: Config = Config.empty) : Rule(config) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnderscoresInNumericLiterals.kt:16:1</span><span class="message">The class `UnderscoresInNumericLiterals` is using inheritance, consider using composition instead.
Does `UnderscoresInNumericLiterals` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnderscoresInNumericLiterals` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnderscoresInNumericLiterals` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 14 </span>import java.util.Locale
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * This rule detects and reports decimal base 10 numeric literals above a certain length that should be underscore</span>
<span class="lineno"> 18 </span><span class="error"> * separated for readability. Underscores that do not make groups of 3 digits are also reported even if their length is</span>
<span class="lineno"> 19 </span><span class="error"> * under the `acceptableDecimalLength`. For `Serializable` classes or objects, the field `serialVersionUID` is</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnnecessaryAbstractClass.kt:26:1</span><span class="message">The class `UnnecessaryAbstractClass` is using inheritance, consider using composition instead.
Does `UnnecessaryAbstractClass` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnnecessaryAbstractClass` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnnecessaryAbstractClass` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 23 </span>import org.jetbrains.kotlin.psi.psiUtil.isAbstract
<span class="lineno"> 24 </span>import org.jetbrains.kotlin.resolve.BindingContext
<span class="lineno"> 25 </span>
<span class="lineno"> 26 </span><span class="error">/**</span>
<span class="lineno"> 27 </span><span class="error"> * This rule inspects `abstract` classes. In case an `abstract class` does not have any concrete members it should be</span>
<span class="lineno"> 28 </span><span class="error"> * refactored into an interface. Abstract classes which do not define any `abstract` members should instead be</span>
<span class="lineno"> 29 </span><span class="error"> * refactored into concrete classes.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnnecessaryAnnotationUseSiteTarget.kt:16:1</span><span class="message">The class `UnnecessaryAnnotationUseSiteTarget` is using inheritance, consider using composition instead.
Does `UnnecessaryAnnotationUseSiteTarget` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnnecessaryAnnotationUseSiteTarget` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnnecessaryAnnotationUseSiteTarget` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtPrimaryConstructor
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtProperty
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * This rule inspects the use of the Annotation use-site Target. In case that the use-site Target is not needed it can</span>
<span class="lineno"> 18 </span><span class="error"> * be removed. For more information check the kotlin documentation:</span>
<span class="lineno"> 19 </span><span class="error"> * https://kotlinlang.org/docs/reference/annotations.html#annotation-use-site-targets</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnnecessaryApply.kt:23:1</span><span class="message">The class `UnnecessaryApply` is using inheritance, consider using composition instead.
Does `UnnecessaryApply` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnnecessaryApply` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnnecessaryApply` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 20 </span>import org.jetbrains.kotlin.resolve.BindingContext
<span class="lineno"> 21 </span>import org.jetbrains.kotlin.resolve.bindingContextUtil.isUsedAsExpression
<span class="lineno"> 22 </span>
<span class="lineno"> 23 </span><span class="error">/**</span>
<span class="lineno"> 24 </span><span class="error"> * `apply` expressions are used frequently, but sometimes their usage should be replaced with</span>
<span class="lineno"> 25 </span><span class="error"> * an ordinary method/extension function call to reduce visual complexity</span>
<span class="lineno"> 26 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnnecessaryInheritance.kt:12:1</span><span class="message">The class `UnnecessaryInheritance` is using inheritance, consider using composition instead.
Does `UnnecessaryInheritance` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnnecessaryInheritance` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnnecessaryInheritance` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtClassOrObject
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span><span class="error">/**</span>
<span class="lineno"> 13 </span><span class="error"> * This rule reports unnecessary super types. Inheriting from `Any` or `Object` is unnecessary and should simply be</span>
<span class="lineno"> 14 </span><span class="error"> * removed.</span>
<span class="lineno"> 15 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnnecessaryLet.kt:18:1</span><span class="message">The class `UnnecessaryLet` is using inheritance, consider using composition instead.
Does `UnnecessaryLet` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnnecessaryLet` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnnecessaryLet` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtDotQualifiedExpression
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.KtLambdaExpression
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * `let` expressions are used extensively in our code for null-checking and chaining functions,</span>
<span class="lineno"> 20 </span><span class="error"> * but sometimes their usage should be replaced with a ordinary method/extension function call</span>
<span class="lineno"> 21 </span><span class="error"> * to reduce visual complexity</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnnecessaryParentheses.kt:13:1</span><span class="message">The class `UnnecessaryParentheses` is using inheritance, consider using composition instead.
Does `UnnecessaryParentheses` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnnecessaryParentheses` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnnecessaryParentheses` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtParenthesizedExpression
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtPsiUtil
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * This rule reports unnecessary parentheses around expressions.</span>
<span class="lineno"> 15 </span><span class="error"> * These unnecessary parentheses can safely be removed.</span>
<span class="lineno"> 16 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UntilInsteadOfRangeTo.kt:16:1</span><span class="message">The class `UntilInsteadOfRangeTo` is using inheritance, consider using composition instead.
Does `UntilInsteadOfRangeTo` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UntilInsteadOfRangeTo` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UntilInsteadOfRangeTo` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtConstantExpression
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtOperationReferenceExpression
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * Reports calls to '..' operator instead of calls to 'until'.</span>
<span class="lineno"> 18 </span><span class="error"> * 'until' is applicable in cases where the upper range value is described as</span>
<span class="lineno"> 19 </span><span class="error"> * some value subtracted by 1. 'until' helps to prevent off-by-one errors.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedImports.kt:22:1</span><span class="message">The class `UnusedImports` is using inheritance, consider using composition instead.
Does `UnusedImports` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnusedImports` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnusedImports` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 19 </span>import org.jetbrains.kotlin.psi.KtReferenceExpression
<span class="lineno"> 20 </span>import org.jetbrains.kotlin.psi.psiUtil.getChildrenOfType
<span class="lineno"> 21 </span>
<span class="lineno"> 22 </span><span class="error">/**</span>
<span class="lineno"> 23 </span><span class="error"> * This rule reports unused imports. Unused imports are dead code and should be removed.</span>
<span class="lineno"> 24 </span><span class="error"> * Exempt from this rule are imports resulting from references to elements within KDoc and</span>
<span class="lineno"> 25 </span><span class="error"> * from destructuring declarations (componentN imports).</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedImports.kt:56:5</span><span class="message">The class `UnusedImportsVisitor` is using inheritance, consider using composition instead.
Does `UnusedImportsVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `UnusedImportsVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `UnusedImportsVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 53 </span> super.visit(root)
<span class="lineno"> 54 </span> }
<span class="lineno"> 55 </span>
<span class="lineno"> 56 </span> <span class="error">private class UnusedImportsVisitor : DetektVisitor() {</span>
<span class="lineno"> 57 </span><span class="error"> private var currentPackage: FqName? = null</span>
<span class="lineno"> 58 </span><span class="error"> private var imports: List<KtImportDirective>? = null</span>
<span class="lineno"> 59 </span><span class="error"> private val namedReferences = mutableSetOf<String>()</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedPrivateClass.kt:34:1</span><span class="message">The class `UnusedPrivateClass` is using inheritance, consider using composition instead.
Does `UnusedPrivateClass` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnusedPrivateClass` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnusedPrivateClass` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 31 </span>import org.jetbrains.kotlin.psi.psiUtil.isPrivate
<span class="lineno"> 32 </span>import org.jetbrains.kotlin.utils.addIfNotNull
<span class="lineno"> 33 </span>
<span class="lineno"> 34 </span><span class="error">/**</span>
<span class="lineno"> 35 </span><span class="error"> * Reports unused private classes.</span>
<span class="lineno"> 36 </span><span class="error"> * If private classes are unused they should be removed. Otherwise this dead code</span>
<span class="lineno"> 37 </span><span class="error"> * can lead to confusion and potential bugs.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedPrivateClass.kt:61:5</span><span class="message">The class `UnusedClassVisitor` is using inheritance, consider using composition instead.
Does `UnusedClassVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `UnusedClassVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `UnusedClassVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 58 </span> }
<span class="lineno"> 59 </span> }
<span class="lineno"> 60 </span>
<span class="lineno"> 61 </span> <span class="error">@Suppress("Detekt.TooManyFunctions")</span>
<span class="lineno"> 62 </span><span class="error"> private class UnusedClassVisitor : DetektVisitor() {</span>
<span class="lineno"> 63 </span><span class="error"></span>
<span class="lineno"> 64 </span><span class="error"> private val privateClasses = mutableSetOf<KtNamedDeclaration>()</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedPrivateMember.kt:38:1</span><span class="message">The class `UnusedPrivateMember` is using inheritance, consider using composition instead.
Does `UnusedPrivateMember` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UnusedPrivateMember` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UnusedPrivateMember` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 35 </span>import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
<span class="lineno"> 36 </span>import org.jetbrains.kotlin.types.expressions.OperatorConventions
<span class="lineno"> 37 </span>
<span class="lineno"> 38 </span><span class="error">/**</span>
<span class="lineno"> 39 </span><span class="error"> * Reports unused private properties, function parameters and functions.</span>
<span class="lineno"> 40 </span><span class="error"> * If these private elements are unused they should be removed. Otherwise this dead code</span>
<span class="lineno"> 41 </span><span class="error"> * can lead to confusion and potential bugs.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedPrivateMember.kt:74:1</span><span class="message">The class `UnusedMemberVisitor` is using inheritance, consider using composition instead.
Does `UnusedMemberVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `UnusedMemberVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `UnusedMemberVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 71 </span> }
<span class="lineno"> 72 </span>}
<span class="lineno"> 73 </span>
<span class="lineno"> 74 </span><span class="error">private abstract class UnusedMemberVisitor(protected val allowedNames: Regex) : DetektVisitor() {</span>
<span class="lineno"> 75 </span><span class="error"></span>
<span class="lineno"> 76 </span><span class="error"> abstract fun getUnusedReports(issue: Issue): List<CodeSmell></span>
<span class="lineno"> 77 </span><span class="error">}</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedPrivateMember.kt:79:1</span><span class="message">The class `UnusedFunctionVisitor` is using inheritance, consider using composition instead.
Does `UnusedFunctionVisitor` want to expose the complete interface (`getUnusedReports`) of `UnusedMemberVisitor` such that `UnusedFunctionVisitor` can be used where `UnusedMemberVisitor` is expected? Indicates __inheritance__.
Does `UnusedFunctionVisitor` want only some/part of the behavior exposed by `UnusedMemberVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 76 </span> abstract fun getUnusedReports(issue: Issue): List<CodeSmell>
<span class="lineno"> 77 </span>}
<span class="lineno"> 78 </span>
<span class="lineno"> 79 </span><span class="error">private class UnusedFunctionVisitor(</span>
<span class="lineno"> 80 </span><span class="error"> allowedNames: Regex,</span>
<span class="lineno"> 81 </span><span class="error"> private val bindingContext: BindingContext</span>
<span class="lineno"> 82 </span><span class="error">) : UnusedMemberVisitor(allowedNames) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedPrivateMember.kt:149:1</span><span class="message">The class `UnusedParameterVisitor` is using inheritance, consider using composition instead.
Does `UnusedParameterVisitor` want to expose the complete interface (`getUnusedReports`) of `UnusedMemberVisitor` such that `UnusedParameterVisitor` can be used where `UnusedMemberVisitor` is expected? Indicates __inheritance__.
Does `UnusedParameterVisitor` want only some/part of the behavior exposed by `UnusedMemberVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 146 </span> }
<span class="lineno"> 147 </span>}
<span class="lineno"> 148 </span>
<span class="lineno"> 149 </span><span class="error">private class UnusedParameterVisitor(allowedNames: Regex) : UnusedMemberVisitor(allowedNames) {</span>
<span class="lineno"> 150 </span><span class="error"></span>
<span class="lineno"> 151 </span><span class="error"> private var unusedParameters: MutableSet<KtParameter> = mutableSetOf()</span>
<span class="lineno"> 152 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedPrivateMember.kt:208:1</span><span class="message">The class `UnusedPropertyVisitor` is using inheritance, consider using composition instead.
Does `UnusedPropertyVisitor` want to expose the complete interface (`getUnusedReports`) of `UnusedMemberVisitor` such that `UnusedPropertyVisitor` can be used where `UnusedMemberVisitor` is expected? Indicates __inheritance__.
Does `UnusedPropertyVisitor` want only some/part of the behavior exposed by `UnusedMemberVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 205 </span> isAbstract() || isOpen() || isOverride() || isOperator() || isMainFunction() || isExternal()
<span class="lineno"> 206 </span>}
<span class="lineno"> 207 </span>
<span class="lineno"> 208 </span><span class="error">private class UnusedPropertyVisitor(allowedNames: Regex) : UnusedMemberVisitor(allowedNames) {</span>
<span class="lineno"> 209 </span><span class="error"></span>
<span class="lineno"> 210 </span><span class="error"> private val properties = mutableSetOf<KtNamedDeclaration>()</span>
<span class="lineno"> 211 </span><span class="error"> private val nameAccesses = mutableSetOf<String>()</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseArrayLiteralsInAnnotations.kt:12:1</span><span class="message">The class `UseArrayLiteralsInAnnotations` is using inheritance, consider using composition instead.
Does `UseArrayLiteralsInAnnotations` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UseArrayLiteralsInAnnotations` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UseArrayLiteralsInAnnotations` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtAnnotationEntry
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span><span class="error">/**</span>
<span class="lineno"> 13 </span><span class="error"> * This rule detects annotations which use the arrayOf(...) syntax instead of the array literal [...] syntax.</span>
<span class="lineno"> 14 </span><span class="error"> * The latter should be preferred as it is more readable.</span>
<span class="lineno"> 15 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseCheckOrError.kt:17:1</span><span class="message">The class `UseCheckOrError` is using inheritance, consider using composition instead.
Does `UseCheckOrError` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UseCheckOrError` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UseCheckOrError` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtFunctionLiteral
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtThrowExpression
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * Kotlin provides a much more concise way to check invariants as well as pre- and post conditions.</span>
<span class="lineno"> 19 </span><span class="error"> * Prefer them instead of manually throwing an IllegalStateException.</span>
<span class="lineno"> 20 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseDataClass.kt:29:1</span><span class="message">The class `UseDataClass` is using inheritance, consider using composition instead.
Does `UseDataClass` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UseDataClass` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UseDataClass` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 26 </span>import org.jetbrains.kotlin.resolve.BindingContext
<span class="lineno"> 27 </span>import org.jetbrains.kotlin.types.KotlinType
<span class="lineno"> 28 </span>
<span class="lineno"> 29 </span><span class="error">/**</span>
<span class="lineno"> 30 </span><span class="error"> * Classes that simply hold data should be refactored into a `data class`. Data classes are specialized to hold data</span>
<span class="lineno"> 31 </span><span class="error"> * and generate `hashCode`, `equals` and `toString` implementations as well.</span>
<span class="lineno"> 32 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseIfInsteadOfWhen.kt:12:1</span><span class="message">The class `UseIfInsteadOfWhen` is using inheritance, consider using composition instead.
Does `UseIfInsteadOfWhen` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UseIfInsteadOfWhen` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UseIfInsteadOfWhen` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 9 </span>import io.gitlab.arturbosch.detekt.api.Severity
<span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtWhenExpression
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span><span class="error">/**</span>
<span class="lineno"> 13 </span><span class="error"> * Binary expressions are better expressed using an `if` expression than a `when` expression.</span>
<span class="lineno"> 14 </span><span class="error"> *</span>
<span class="lineno"> 15 </span><span class="error"> * See https://kotlinlang.org/docs/reference/coding-conventions.html#if-versus-when</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseRequire.kt:18:1</span><span class="message">The class `UseRequire` is using inheritance, consider using composition instead.
Does `UseRequire` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UseRequire` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UseRequire` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.KtThrowExpression
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * Kotlin provides a much more concise way to check preconditions than to manually throw an</span>
<span class="lineno"> 20 </span><span class="error"> * IllegalArgumentException.</span>
<span class="lineno"> 21 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UselessCallOnNotNull.kt:19:1</span><span class="message">The class `UselessCallOnNotNull` is using inheritance, consider using composition instead.
Does `UselessCallOnNotNull` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UselessCallOnNotNull` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UselessCallOnNotNull` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 16 </span>import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameOrNull
<span class="lineno"> 17 </span>import org.jetbrains.kotlin.types.TypeUtils
<span class="lineno"> 18 </span>
<span class="lineno"> 19 </span><span class="error">/**</span>
<span class="lineno"> 20 </span><span class="error"> * The Kotlin stdlib provides some functions that are designed to operate on references that may be null. These</span>
<span class="lineno"> 21 </span><span class="error"> * functions can also be called on non-nullable references or on collections or sequences that are known to be empty -</span>
<span class="lineno"> 22 </span><span class="error"> * the calls are redundant in this case and can be removed or should be changed to a call that does not check whether</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UtilityClassWithPublicConstructor.kt:18:1</span><span class="message">The class `UtilityClassWithPublicConstructor` is using inheritance, consider using composition instead.
Does `UtilityClassWithPublicConstructor` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `UtilityClassWithPublicConstructor` can be used where `Rule` is expected? Indicates __inheritance__.
Does `UtilityClassWithPublicConstructor` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.KtSecondaryConstructor
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.psi.psiUtil.isPublic
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * A class which only contains utility variables and functions with no concrete implementation can be refactored</span>
<span class="lineno"> 20 </span><span class="error"> * into an `object` or an class with a non-public constructor.</span>
<span class="lineno"> 21 </span><span class="error"> * Furthermore, this rule reports utility classes which are not final.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/VarCouldBeVal.kt:24:1</span><span class="message">The class `VarCouldBeVal` is using inheritance, consider using composition instead.
Does `VarCouldBeVal` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `VarCouldBeVal` can be used where `Rule` is expected? Indicates __inheritance__.
Does `VarCouldBeVal` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 21 </span>
<span class="lineno"> 22 </span>private val unaryAssignmentOperators = setOf(KtTokens.MINUSMINUS, KtTokens.PLUSPLUS)
<span class="lineno"> 23 </span>
<span class="lineno"> 24 </span><span class="error">/**</span>
<span class="lineno"> 25 </span><span class="error"> * Reports var declarations (locally-scoped variables) that could be val, as they are not re-assigned.</span>
<span class="lineno"> 26 </span><span class="error"> * Val declarations are assign-once (read-only), which makes understanding the current state easier.</span>
<span class="lineno"> 27 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/VarCouldBeVal.kt:68:5</span><span class="message">The class `AssignmentVisitor` is using inheritance, consider using composition instead.
Does `AssignmentVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `AssignmentVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `AssignmentVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 65 </span> private fun KtNamedFunction.isSomehowNested() =
<span class="lineno"> 66 </span> getStrictParentOfType<KtNamedFunction>() != null
<span class="lineno"> 67 </span>
<span class="lineno"> 68 </span> <span class="error">private class AssignmentVisitor : DetektVisitor() {</span>
<span class="lineno"> 69 </span><span class="error"></span>
<span class="lineno"> 70 </span><span class="error"> private val declarations = mutableSetOf<KtNamedDeclaration>()</span>
<span class="lineno"> 71 </span><span class="error"> // an easy way to find declarations when walking up the contexts of an assignment</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/WildcardImport.kt:13:1</span><span class="message">The class `WildcardImport` is using inheritance, consider using composition instead.
Does `WildcardImport` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `WildcardImport` can be used where `Rule` is expected? Indicates __inheritance__.
Does `WildcardImport` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 10 </span>import io.gitlab.arturbosch.detekt.rules.valueOrDefaultCommaSeparated
<span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtImportDirective
<span class="lineno"> 12 </span>
<span class="lineno"> 13 </span><span class="error">/**</span>
<span class="lineno"> 14 </span><span class="error"> * Wildcard imports should be replaced with imports using fully qualified class names. This helps increase clarity of</span>
<span class="lineno"> 15 </span><span class="error"> * which classes are imported and helps prevent naming conflicts.</span>
<span class="lineno"> 16 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/optional/MandatoryBracesIfStatements.kt:16:1</span><span class="message">The class `MandatoryBracesIfStatements` is using inheritance, consider using composition instead.
Does `MandatoryBracesIfStatements` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `MandatoryBracesIfStatements` can be used where `Rule` is expected? Indicates __inheritance__.
Does `MandatoryBracesIfStatements` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 13 </span>import org.jetbrains.kotlin.psi.KtIfExpression
<span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.psiUtil.siblings
<span class="lineno"> 15 </span>
<span class="lineno"> 16 </span><span class="error">/**</span>
<span class="lineno"> 17 </span><span class="error"> * This rule detects multi-line `if` statements which do not have braces.</span>
<span class="lineno"> 18 </span><span class="error"> * Adding braces would improve readability and avoid possible errors.</span>
<span class="lineno"> 19 </span><span class="error"> *</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/optional/OptionalUnit.kt:17:1</span><span class="message">The class `OptionalUnit` is using inheritance, consider using composition instead.
Does `OptionalUnit` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `OptionalUnit` can be used where `Rule` is expected? Indicates __inheritance__.
Does `OptionalUnit` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 14 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 15 </span>import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
<span class="lineno"> 16 </span>
<span class="lineno"> 17 </span><span class="error">/**</span>
<span class="lineno"> 18 </span><span class="error"> * It is not necessary to define a return type of `Unit` on functions or to specify a lone Unit statement.</span>
<span class="lineno"> 19 </span><span class="error"> * This rule detects and reports instances where the `Unit` return type is specified on functions and the occurrences</span>
<span class="lineno"> 20 </span><span class="error"> * of a lone Unit statement.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/optional/PreferToOverPairSyntax.kt:18:1</span><span class="message">The class `PreferToOverPairSyntax` is using inheritance, consider using composition instead.
Does `PreferToOverPairSyntax` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `PreferToOverPairSyntax` can be used where `Rule` is expected? Indicates __inheritance__.
Does `PreferToOverPairSyntax` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 15 </span>import org.jetbrains.kotlin.resolve.calls.callUtil.getType
<span class="lineno"> 16 </span>import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameOrNull
<span class="lineno"> 17 </span>
<span class="lineno"> 18 </span><span class="error">/**</span>
<span class="lineno"> 19 </span><span class="error"> * This rule detects the usage of the Pair constructor to create pairs of values.</span>
<span class="lineno"> 20 </span><span class="error"> *</span>
<span class="lineno"> 21 </span><span class="error"> * Using <value1> to <value2> is preferred.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/InclusionExclusionPatternsSpec.kt:106:1</span><span class="message">The class `OnlyLibraryTrackingRule` is using inheritance, consider using composition instead.
Does `OnlyLibraryTrackingRule` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `OnlyLibraryTrackingRule` can be used where `Rule` is expected? Indicates __inheritance__.
Does `OnlyLibraryTrackingRule` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 103 </span> return rule
<span class="lineno"> 104 </span>}
<span class="lineno"> 105 </span>
<span class="lineno"> 106 </span><span class="error">private class OnlyLibraryTrackingRule(config: Config) : Rule(config) {</span>
<span class="lineno"> 107 </span><span class="error"></span>
<span class="lineno"> 108 </span><span class="error"> override val issue: Issue = Issue("test", Severity.CodeSmell, "", Debt.FIVE_MINS)</span>
<span class="lineno"> 109 </span><span class="error"> private var libraryFileVisited = false</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-rules/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/InclusionExclusionPatternsSpec.kt:129:1</span><span class="message">The class `DummyRule` is using inheritance, consider using composition instead.
Does `DummyRule` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `DummyRule` can be used where `Rule` is expected? Indicates __inheritance__.
Does `DummyRule` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 126 </span> }
<span class="lineno"> 127 </span>}
<span class="lineno"> 128 </span>
<span class="lineno"> 129 </span><span class="error">private class DummyRule(config: Config = Config.empty) : Rule(config) {</span>
<span class="lineno"> 130 </span><span class="error"></span>
<span class="lineno"> 131 </span><span class="error"> override val issue = Issue("test", Severity.CodeSmell, "", Debt.FIVE_MINS)</span>
<span class="lineno"> 132 </span><span class="error"> private var isDirty: Boolean = false</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-sample-extensions/src/main/kotlin/io/gitlab/arturbosch/detekt/sample/extensions/processors/NumberOfLoopsProcessor.kt:21:5</span><span class="message">The class `LoopVisitor` is using inheritance, consider using composition instead.
Does `LoopVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `LoopVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `LoopVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 18 </span> val numberOfLoopsKey = Key<Int>("number of loops")
<span class="lineno"> 19 </span> }
<span class="lineno"> 20 </span>
<span class="lineno"> 21 </span> <span class="error">class LoopVisitor : DetektVisitor() {</span>
<span class="lineno"> 22 </span><span class="error"></span>
<span class="lineno"> 23 </span><span class="error"> internal var numberOfLoops = 0</span>
<span class="lineno"> 24 </span><span class="error"> override fun visitLoopExpression(loopExpression: KtLoopExpression) {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-sample-extensions/src/main/kotlin/io/gitlab/arturbosch/detekt/sample/extensions/processors/QualifiedNameProcessor.kt:28:5</span><span class="message">The class `ClassNameVisitor` is using inheritance, consider using composition instead.
Does `ClassNameVisitor` want to expose the complete interface (`empty public interface`) of `DetektVisitor` such that `ClassNameVisitor` can be used where `DetektVisitor` is expected? Indicates __inheritance__.
Does `ClassNameVisitor` want only some/part of the behavior exposed by `DetektVisitor`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 25 </span> result.addData(fqNamesKey, fqNames)
<span class="lineno"> 26 </span> }
<span class="lineno"> 27 </span>
<span class="lineno"> 28 </span> <span class="error">class ClassNameVisitor : DetektVisitor() {</span>
<span class="lineno"> 29 </span><span class="error"></span>
<span class="lineno"> 30 </span><span class="error"> val names = mutableSetOf<String>()</span>
<span class="lineno"> 31 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-sample-extensions/src/main/kotlin/io/gitlab/arturbosch/detekt/sample/extensions/reports/QualifiedNamesConsoleReport.kt:6:1</span><span class="message">The class `QualifiedNamesConsoleReport` is using inheritance, consider using composition instead.
Does `QualifiedNamesConsoleReport` want to expose the complete interface (`render, print`) of `ConsoleReport` such that `QualifiedNamesConsoleReport` can be used where `ConsoleReport` is expected? Indicates __inheritance__.
Does `QualifiedNamesConsoleReport` want only some/part of the behavior exposed by `ConsoleReport`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.ConsoleReport
<span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.Detektion
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">class QualifiedNamesConsoleReport : ConsoleReport() {</span>
<span class="lineno"> 7 </span><span class="error"></span>
<span class="lineno"> 8 </span><span class="error"> override fun render(detektion: Detektion): String? {</span>
<span class="lineno"> 9 </span><span class="error"> return qualifiedNamesReport(detektion)</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-sample-extensions/src/main/kotlin/io/gitlab/arturbosch/detekt/sample/extensions/reports/QualifiedNamesOutputReport.kt:6:1</span><span class="message">The class `QualifiedNamesOutputReport` is using inheritance, consider using composition instead.
Does `QualifiedNamesOutputReport` want to expose the complete interface (`render, write`) of `OutputReport` such that `QualifiedNamesOutputReport` can be used where `OutputReport` is expected? Indicates __inheritance__.
Does `QualifiedNamesOutputReport` want only some/part of the behavior exposed by `OutputReport`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 3 </span>import io.gitlab.arturbosch.detekt.api.Detektion
<span class="lineno"> 4 </span>import io.gitlab.arturbosch.detekt.api.OutputReport
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="error">class QualifiedNamesOutputReport : OutputReport() {</span>
<span class="lineno"> 7 </span><span class="error"></span>
<span class="lineno"> 8 </span><span class="error"> override val ending: String = "txt"</span>
<span class="lineno"> 9 </span><span class="error"></span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-sample-extensions/src/main/kotlin/io/gitlab/arturbosch/detekt/sample/extensions/rules/TooManyFunctions.kt:12:1</span><span class="message">The class `TooManyFunctions` is using inheritance, consider using composition instead.
Does `TooManyFunctions` want to expose the complete interface (`report, report, visitCondition`) of `Rule` such that `TooManyFunctions` can be used where `Rule` is expected? Indicates __inheritance__.
Does `TooManyFunctions` want only some/part of the behavior exposed by `Rule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 9 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 10 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 11 </span>
<span class="lineno"> 12 </span><span class="error">/**</span>
<span class="lineno"> 13 </span><span class="error"> * This is a sample rule reporting too many functions inside a file.</span>
<span class="lineno"> 14 </span><span class="error"> */</span>
<span class="lineno"> 15 </span><span class="error">class TooManyFunctions : Rule() {</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-sample-extensions/src/main/kotlin/io/gitlab/arturbosch/detekt/sample/extensions/rules/TooManyFunctionsTwo.kt:14:1</span><span class="message">The class `TooManyFunctionsTwo` is using inheritance, consider using composition instead.
Does `TooManyFunctionsTwo` want to expose the complete interface (`empty public interface`) of `ThresholdRule` such that `TooManyFunctionsTwo` can be used where `ThresholdRule` is expected? Indicates __inheritance__.
Does `TooManyFunctionsTwo` want only some/part of the behavior exposed by `ThresholdRule`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 11 </span>import org.jetbrains.kotlin.psi.KtFile
<span class="lineno"> 12 </span>import org.jetbrains.kotlin.psi.KtNamedFunction
<span class="lineno"> 13 </span>
<span class="lineno"> 14 </span><span class="error">/**</span>
<span class="lineno"> 15 </span><span class="error"> * This rule is a copy of [TooManyFunctions] but inherits from [ThresholdRule].</span>
<span class="lineno"> 16 </span><span class="error"> * The [ThresholdRule] predefines a `threshold` property which can be configured</span>
<span class="lineno"> 17 </span><span class="error"> * through the detekt configuration file.</span>
</code></pre>
</li>
<li><span class="location">/Users/mariuskohmann/Code/School/master/code/detekt/detekt-test/src/main/kotlin/io/gitlab/arturbosch/detekt/test/TestConfig.kt:8:1</span><span class="message">The class `TestConfig` is using inheritance, consider using composition instead.
Does `TestConfig` want to expose the complete interface (`empty public interface`) of `BaseConfig` such that `TestConfig` can be used where `BaseConfig` is expected? Indicates __inheritance__.
Does `TestConfig` want only some/part of the behavior exposed by `BaseConfig`? Indicates __Composition__.</span>
<pre><code><span class="lineno"> 5 </span>import io.gitlab.arturbosch.detekt.api.HierarchicalConfig
<span class="lineno"> 6 </span>import io.gitlab.arturbosch.detekt.api.internal.BaseConfig
<span class="lineno"> 7 </span>
<span class="lineno"> 8 </span><span class="error">@Suppress("UNCHECKED_CAST")</span>
<span class="lineno"> 9 </span><span class="error">open class TestConfig(</span>
<span class="lineno"> 10 </span><span class="error"> private val values: Map<String, Any> = mutableMapOf(),</span>
<span class="lineno"> 11 </span><span class="error"> override val parent: HierarchicalConfig.Parent? = null</span>
</code></pre>
</li>
</ul>
</details>
</div>
generated with <a href="https://arturbosch.github.io/detekt">detekt version 1.7.4</a> on 2020-04-23 08:14:15 UTC.
</body>
</html>