This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @author Artur Bosch | |
| * https://github.com/arturbosch/detekt/blob/master/detekt-sample-ruleset/src/test/kotlin/io/gitlab/arturbosch/detekt/sampleruleset/TooManyFunctionsSpec.kt | |
| **/ | |
| class TooManyFunctionsSpec : SubjectSpek<TooManyFunctions>({ | |
| subject { TooManyFunctions() } | |
| describe("a simple test") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @author Artur Bosch | |
| * https://github.com/arturbosch/detekt/blob/master/detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/NestedBlockDepth.kt | |
| */ | |
| class NestedBlockDepth(config: Config = Config.empty, threshold: Int = 3) : ThresholdRule(config, threshold) { | |
| // ... | |
| override fun visitNamedFunction(function: KtNamedFunction) { | |
| val visitor = FunctionDepthVisitor(threshold) | |
| visitor.visitNamedFunction(function) | |
| if (visitor.isTooDeep) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @author Artur Bosch | |
| * https://github.com/arturbosch/detekt/blob/master/detekt-sample-ruleset/src/main/kotlin/io/gitlab/arturbosch/detekt/sampleruleset/TooManyFunctions.kt | |
| */ | |
| class TooManyFunctions : Rule() { | |
| override val issue = Issue(javaClass.simpleName, Severity.CodeSmell, "") | |
| private var amount: Int = 0 |