This is an automated email from the ASF dual-hosted git repository.
rustyrazorblade pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cassandra-easy-stress.git
The following commit(s) were added to refs/heads/main by this push:
new 855eafe Added detekt plugin. (#47)
855eafe is described below
commit 855eafe89575a3d6a93236dbf1ff06098b6bc32f
Author: Jon Haddad <[email protected]>
AuthorDate: Mon Jul 28 09:27:48 2025 -0400
Added detekt plugin. (#47)
---
build.gradle | 18 ++
detekt-baseline.xml | 150 ++++++++++++
detekt-config.yml | 658 ++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 826 insertions(+)
diff --git a/build.gradle b/build.gradle
index 801d6ac..6fde2d0 100644
--- a/build.gradle
+++ b/build.gradle
@@ -33,6 +33,7 @@ plugins {
id "nebula.ospackage" version "9.1.1"
id "nebula.ospackage-application" version "9.1.1"
id "org.jlleitschuh.gradle.ktlint" version "12.1.2"
+ id "io.gitlab.arturbosch.detekt" version "1.23.7"
}
@@ -204,3 +205,20 @@ wrapper {
distributionType = Wrapper.DistributionType.ALL
}
targetCompatibility = JavaVersion.VERSION_11
+
+detekt {
+ toolVersion = "1.23.7"
+ source = files("src/main/kotlin", "src/test/kotlin")
+ parallel = true
+ config = files("$projectDir/detekt-config.yml")
+ buildUponDefaultConfig = true
+ allRules = false
+ baseline = file("$projectDir/detekt-baseline.xml")
+ disableDefaultRuleSets = false
+ debug = false
+ ignoreFailures = false
+ ignoredBuildTypes = ["release"]
+ ignoredFlavors = ["production"]
+ ignoredVariants = ["productionRelease"]
+ autoCorrect = false
+}
diff --git a/detekt-baseline.xml b/detekt-baseline.xml
new file mode 100644
index 0000000..275fa1f
--- /dev/null
+++ b/detekt-baseline.xml
@@ -0,0 +1,150 @@
+<?xml version="1.0" ?>
+<SmellBaseline>
+ <ManuallySuppressedIssues></ManuallySuppressedIssues>
+ <CurrentIssues>
+ <ID>CyclomaticComplexMethod:SchemaBuilder.kt$SchemaBuilder$fun
parseCompaction(compaction: String): Compaction</ID>
+ <ID>EmptyForBlock:PartitionKeyGeneratorTest.kt$PartitionKeyGeneratorTest${
}</ID>
+ <ID>EmptyFunctionBlock:CreateDrop.kt$CreateDrop${ }</ID>
+ <ID>EmptyFunctionBlock:FunctionLoaderTest.kt$FunctionLoaderTest${ }</ID>
+ <ID>EmptyFunctionBlock:LastName.kt$LastName${ }</ID>
+ <ID>EmptyFunctionBlock:TxnCounter.kt$TxnCounter${}</ID>
+ <ID>EmptyFunctionBlock:USCities.kt$USCities${ }</ID>
+ <ID>ForbiddenComment:Info.kt$Info$// TODO: Show dynamic parameters</ID>
+ <ID>ForbiddenComment:Plugin.kt$Plugin$* Wrapper for Stress Profile Plugins
* Anything found in the class path will be returned. * TODO: Add a caching
layer to prevent absurdly slow * reflection time</ID>
+
<ID>ForbiddenComment:SingleLineConsoleReporter.kt$SingleLineConsoleReporter$//
TODO: refactor this + the above loop to be a single function</ID>
+
<ID>IteratorNotThrowingNoSuchElementException:FunctionLoader.kt$FunctionLoader$<no
name provided> : Iterator</ID>
+ <ID>LongMethod:Run.kt$Run$override fun execute()</ID>
+ <ID>LongParameterList:RequestQueue.kt$RequestQueue$( private val
partitionKeyGenerator: PartitionKeyGenerator, context: StressContext,
totalValues: Long, duration: Long, runner: IStressRunner, readRate: Double,
deleteRate: Double, val populatePhase: Boolean = false, )</ID>
+ <ID>LoopWithTooManyJumpStatements:Plugin.kt$Plugin$for</ID>
+ <ID>LoopWithTooManyJumpStatements:RequestQueue.kt$RequestQueue$for</ID>
+ <ID>MagicNumber:AllowFiltering.kt$AllowFiltering$100</ID>
+ <ID>MagicNumber:AllowFiltering.kt$AllowFiltering.<no name
provided>$3</ID>
+ <ID>MagicNumber:AsyncCollector.kt$AsyncCollector$4096</ID>
+ <ID>MagicNumber:BasicTimeSeries.kt$BasicTimeSeries$100</ID>
+ <ID>MagicNumber:BasicTimeSeries.kt$BasicTimeSeries$200</ID>
+ <ID>MagicNumber:BasicTimeSeries.kt$BasicTimeSeries$30</ID>
+ <ID>MagicNumber:BasicTimeSeries.kt$BasicTimeSeries$500</ID>
+ <ID>MagicNumber:Book.kt$Book$20</ID>
+ <ID>MagicNumber:Book.kt$Book$50</ID>
+ <ID>MagicNumber:CountersWide.kt$CountersWide$10000</ID>
+ <ID>MagicNumber:CreateDrop.kt$CreateDrop$10</ID>
+ <ID>MagicNumber:CreateDrop.kt$CreateDrop$1000</ID>
+ <ID>MagicNumber:CreateDrop.kt$CreateDrop$20</ID>
+ <ID>MagicNumber:CreateDrop.kt$CreateDrop$60.0</ID>
+ <ID>MagicNumber:DSESearch.kt$DSESearch$10</ID>
+ <ID>MagicNumber:DSESearch.kt$DSESearch$100</ID>
+ <ID>MagicNumber:DSESearch.kt$DSESearch$10000</ID>
+ <ID>MagicNumber:DSESearch.kt$DSESearch$5</ID>
+ <ID>MagicNumber:FileReporter.kt$FileReporter$1000</ID>
+ <ID>MagicNumber:Gaussian.kt$Gaussian$1000000</ID>
+ <ID>MagicNumber:HdrCollector.kt$HdrCollector$1_000_000.0</ID>
+
<ID>MagicNumber:HumanReadableConverter.kt$HumanReadableConverter$1000000000L</ID>
+
<ID>MagicNumber:HumanReadableConverter.kt$HumanReadableConverter$1000000L</ID>
+ <ID>MagicNumber:HumanReadableConverter.kt$HumanReadableConverter$1000L</ID>
+ <ID>MagicNumber:KeyValue.kt$KeyValue$100</ID>
+ <ID>MagicNumber:KeyValue.kt$KeyValue$200</ID>
+ <ID>MagicNumber:MaterializedViews.kt$MaterializedViews.<no name
provided>$110</ID>
+ <ID>MagicNumber:Metrics.kt$Metrics$3</ID>
+
<ID>MagicNumber:PartitionKeyGenerator.kt$PartitionKeyGenerator.Companion$4.0</ID>
+ <ID>MagicNumber:ProfileRunner.kt$ProfileRunner$3000</ID>
+ <ID>MagicNumber:Random.kt$Random$100000L</ID>
+ <ID>MagicNumber:Random.kt$Random$65</ID>
+ <ID>MagicNumber:Random.kt$Random$90</ID>
+ <ID>MagicNumber:RandomPartitionAccess.kt$RandomPartitionAccess$100</ID>
+ <ID>MagicNumber:RandomPartitionAccess.kt$RandomPartitionAccess$200</ID>
+ <ID>MagicNumber:RateLimiterOptimizer.kt$RateLimiterOptimizer$0.9</ID>
+ <ID>MagicNumber:RateLimiterOptimizer.kt$RateLimiterOptimizer$0.90</ID>
+ <ID>MagicNumber:RateLimiterOptimizer.kt$RateLimiterOptimizer$1.05</ID>
+ <ID>MagicNumber:RateLimiterOptimizer.kt$RateLimiterOptimizer$10.0</ID>
+ <ID>MagicNumber:RateLimiterOptimizer.kt$RateLimiterOptimizer$100</ID>
+ <ID>MagicNumber:RateLimiterOptimizer.kt$RateLimiterOptimizer$100.0</ID>
+ <ID>MagicNumber:RequestQueue.kt$RequestQueue$100</ID>
+ <ID>MagicNumber:RequestQueue.kt$RequestQueue$1000</ID>
+ <ID>MagicNumber:Run.kt$1000000</ID>
+ <ID>MagicNumber:Run.kt$Run$1000</ID>
+ <ID>MagicNumber:Run.kt$Run$10000</ID>
+ <ID>MagicNumber:Run.kt$Run$1000000L</ID>
+ <ID>MagicNumber:Run.kt$Run$100L</ID>
+ <ID>MagicNumber:Run.kt$Run$32768</ID>
+ <ID>MagicNumber:Run.kt$Run$5000</ID>
+ <ID>MagicNumber:Run.kt$Run$5000L</ID>
+ <ID>MagicNumber:Run.kt$Run$8</ID>
+ <ID>MagicNumber:Run.kt$Run$9042</ID>
+ <ID>MagicNumber:Run.kt$Run$9500</ID>
+ <ID>MagicNumber:SAI.kt$SAI$10000</ID>
+ <ID>MagicNumber:SAI.kt$SAI.<no name provided>$3</ID>
+ <ID>MagicNumber:Sets.kt$Sets$16</ID>
+ <ID>MagicNumber:Sets.kt$Sets$6</ID>
+
<ID>MagicNumber:SingleLineConsoleReporter.kt$SingleLineConsoleReporter$10L</ID>
+
<ID>MagicNumber:SingleLineConsoleReporter.kt$SingleLineConsoleReporter$6</ID>
+ <ID>MagicNumber:ThroughputTracker.kt$ThroughputTracker$1000.0</ID>
+ <ID>MagicNumber:USCities.kt$USCities$3</ID>
+ <ID>MagicNumber:USCities.kt$USCities$4</ID>
+ <ID>MagicNumber:UdtTimeSeries.kt$UdtTimeSeries$100</ID>
+ <ID>MagicNumber:UdtTimeSeries.kt$UdtTimeSeries$200</ID>
+ <ID>MagicNumber:UdtTimeSeries.kt$UdtTimeSeries$500</ID>
+ <ID>MagicNumber:UdtTimeSeries.kt$UdtTimeSeries.<no name
provided>$3</ID>
+ <ID>MagicNumber:Util.kt$65</ID>
+ <ID>MagicNumber:Util.kt$90</ID>
+ <ID>MaxLineLength:AllowFiltering.kt$AllowFiltering$insert =
session.prepare("INSERT INTO allow_filtering (partition_id, row_id, value,
payload) values (?, ?, ?, ?)")</ID>
+ <ID>MaxLineLength:CountersWide.kt$CountersWide.<no name
provided>$val clusteringKey = (ThreadLocalRandom.current().nextGaussian() *
rowsPerPartition.toDouble()).roundToLong()</ID>
+ <ID>MaxLineLength:FunctionLoader.kt$FunctionLoader.<no name
provided>$val annotation = tmp.value.getAnnotation(Function::class.java) ?:
throw AnnotationMissingException(tmp.value)</ID>
+ <ID>MaxLineLength:Info.kt$Info$println("${row.name.padEnd(cols[0])} |
${row.description.padEnd(cols[1])} | ${row.type.padEnd(cols[2])}")</ID>
+ <ID>MaxLineLength:Locking.kt$Locking$*</ID>
+ <ID>MaxLineLength:Locking.kt$Locking$override fun getPopulateOption(args:
Run): PopulateOption</ID>
+
<ID>MaxLineLength:ParquetCollector.kt$ParquetCollector$ParquetTableWriter(if
(fileOrDirectory.isDirectory) File(fileOrDirectory, "rawlog.parquet") else
fileOrDirectory)</ID>
+
<ID>MaxLineLength:ParquetCollector.kt$ParquetCollector.ParquetTableWriter$val
serviceStartMillis = requestStartMillis +
TimeUnit.NANOSECONDS.toMillis(serviceStartNanos - requestStartNanos)</ID>
+ <ID>MaxLineLength:ParsedFieldFunction.kt$ParsedFieldFunction$val
searchResult = regex.find(function)?.groupValues ?: throw Exception("Could not
parse $function as a field function")</ID>
+ <ID>MaxLineLength:Plugin.kt$Plugin$(prop.annotations.firstOrNull {
it.annotationClass == WorkloadParameter::class } as? WorkloadParameter)</ID>
+
<ID>MaxLineLength:RateLimiterOptimizer.kt$RateLimiterOptimizer$log.debug("Read
latency more critical: ${readLatencyRatio.format(2)} of max vs write
${writeLatencyRatio.format(2)}")</ID>
+
<ID>MaxLineLength:RateLimiterOptimizer.kt$RateLimiterOptimizer$log.debug("Write
latency more critical: ${writeLatencyRatio.format(2)} of max vs read
${readLatencyRatio.format(2)}")</ID>
+ <ID>MaxLineLength:Run.kt$Run$"The readRate + deleteRate must be <= 1.0.
Values supplied were: readRate = $tmpReadRate and deleteRate =
$tmpDeleteRate."</ID>
+ <ID>MaxLineLength:Run.kt$Run$*</ID>
+ <ID>MaxLineLength:Run.kt$Run$// var sampleRate : Double? = null // .1%..
this might be better as a number, like a million. reasonable to keep in
memory</ID>
+ <ID>MaxLineLength:Run.kt$Run$// without this cleanup we could have the
metrics runner still running and it will cause subsequent tests to fail</ID>
+ <ID>MaxLineLength:Run.kt$Run$@Parameter(names = ["--rate"], description =
"Throughput rate, accepts human numbers", converter =
HumanReadableConverter::class)</ID>
+ <ID>MaxLineLength:Run.kt$Run$description = "DEPRECATED. Concurrent queries
allowed. Increase for larger clusters. This flag is deprecated and does
nothing."</ID>
+ <ID>MaxLineLength:SchemaBuilderTest.kt$SchemaBuilderTest$val result =
createTable.withCompaction("{ 'class': 'LeveledCompactionStrategy',
'sstable_size_in_mb': 100}").build()</ID>
+ <ID>MaxLineLength:StressContext.kt$Context$fun stress(thread: Int):
StressContext</ID>
+ <ID>MaxLineLength:TxnCounter.kt$TxnCounter.<no name
provided>$override fun getNextMutation(partitionKey: PartitionKey):
Operation</ID>
+ <ID>MaxLineLength:USCities.kt$USCities$cities = reader.lines().skip(1).map
{ it.split("|") }.filter { it.size > 4 }.map { City(it[0], it[1], it[2],
it[3]) }.toList()</ID>
+ <ID>MaxLineLength:UdtTimeSeries.kt$UdtTimeSeries.<no name
provided>$val udtValue = udt.newValue().setString("data1",
chunks[0]).setString("data2", chunks[1]).setString("data3", chunks[2])</ID>
+ <ID>MayBeConst:Run.kt$val DEFAULT_ITERATIONS: Long = 1000000</ID>
+ <ID>PrintStackTrace:AsyncCollector.kt$AsyncCollector$t</ID>
+ <ID>PrintStackTrace:Main.kt$e</ID>
+ <ID>ReturnCount:RateLimiterOptimizer.kt$RateLimiterOptimizer$fun
execute(): Double</ID>
+ <ID>ReturnCount:RateLimiterOptimizer.kt$RateLimiterOptimizer$fun
getCurrentAndMaxLatency(): Optional<Pair<Double, Long>></ID>
+ <ID>ReturnCount:RateLimiterOptimizer.kt$RateLimiterOptimizer$fun
getNextValue( currentRate: Double, currentLatency: Double, maxLatency: Long, ):
Double</ID>
+ <ID>ReturnCount:RateLimiterOptimizer.kt$RateLimiterOptimizer$private fun
optimizeRateLimit( currentLatency: Double, maxLatency: Long, ): Double</ID>
+ <ID>ReturnCount:ThroughputTracker.kt$ThroughputTracker$fun
getCurrentThroughput(): Double</ID>
+ <ID>ReturnCount:ThroughputTracker.kt$ThroughputTracker$fun
getWindowSizeMs(): Long</ID>
+
<ID>SpreadOperator:CommandLineParser.kt$CommandLineParser.Companion$(*arguments)</ID>
+ <ID>SpreadOperator:Run.kt$Run$(*collectors.toTypedArray())</ID>
+ <ID>SwallowedException:Run.kt$Run$nsee:
java.util.NoSuchElementException</ID>
+
<ID>ThrowingExceptionsWithoutMessageOrCause:ThroughputTracker.kt$ThroughputTracker$IllegalStateException()</ID>
+ <ID>TooGenericExceptionCaught:AsyncCollector.kt$AsyncCollector$t:
Throwable</ID>
+ <ID>TooGenericExceptionCaught:CreateDrop.kt$CreateDrop$e: Exception</ID>
+ <ID>TooGenericExceptionCaught:Main.kt$e: Exception</ID>
+ <ID>TooGenericExceptionCaught:ProfileRunner.kt$ProfileRunner$e:
Exception</ID>
+ <ID>TooGenericExceptionCaught:Run.kt$Run$e: Exception</ID>
+
<ID>TooGenericExceptionThrown:ParsedFieldFunction.kt$ParsedFieldFunction$throw
Exception("Could not parse $function as a field function")</ID>
+ <ID>TooGenericExceptionThrown:Random.kt$Random$throw Exception("Int larger
than Int.MAX_VALUE requested, use a long instead")</ID>
+
<ID>TooGenericExceptionThrown:RandomPartitionAccess.kt$RandomPartitionAccess$throw
RuntimeException("select must be row or partition.")</ID>
+
<ID>TooGenericExceptionThrown:RandomPartitionAccess.kt$RandomPartitionAccess.<no
name provided>$throw RuntimeException("not even sure how you got here")</ID>
+
<ID>TooGenericExceptionThrown:SchemaBuilder.kt$SchemaBuilder.WindowUnit.Companion$throw
Exception("not a thing")</ID>
+ <ID>TooGenericExceptionThrown:UdtTimeSeries.kt$UdtTimeSeries.<no name
provided>$throw RuntimeException("No keyspace selected")</ID>
+ <ID>TooManyFunctions:RateLimiterOptimizer.kt$RateLimiterOptimizer</ID>
+ <ID>UnusedPrivateProperty:BookTest.kt$BookTest$i</ID>
+
<ID>UnusedPrivateProperty:ConsistencyLevelConverterTest.kt$ConsistencyLevelConverterTest$val
cl = converter.convert("LOCAL")</ID>
+ <ID>UnusedPrivateProperty:FirstName.kt$FirstName$s</ID>
+ <ID>UnusedPrivateProperty:FunctionLoaderTest.kt$FunctionLoaderTest$val
function = FunctionLoader()</ID>
+
<ID>UnusedPrivateProperty:HumanReadableTimeConverterTest.kt$HumanReadableTimeConverterTest$val
cl = converter.convert("BLAh")</ID>
+
<ID>UnusedPrivateProperty:PartitionKeyGeneratorTest.kt$PartitionKeyGeneratorTest$x</ID>
+ <ID>UnusedPrivateProperty:SchemaBuilderTest.kt$SchemaBuilderTest$val cql =
compaction.toCQL()</ID>
+
<ID>UnusedPrivateProperty:SingleLineConsoleReporter.kt$SingleLineConsoleReporter$x</ID>
+ <ID>UnusedPrivateProperty:USCitiesTest.kt$USCitiesTest$i</ID>
+ <ID>UseCheckOrError:ThroughputTracker.kt$ThroughputTracker$throw
IllegalStateException()</ID>
+
<ID>UseRequire:HumanReadableTimeConverter.kt$HumanReadableTimeConverter$throw
IllegalArgumentException("Value $value resulted in 0 time duration")</ID>
+
<ID>UselessPostfixExpression:AllPluginsBasicTest.kt$AllPluginsBasicTest$prometheusPort++</ID>
+ </CurrentIssues>
+</SmellBaseline>
diff --git a/detekt-config.yml b/detekt-config.yml
new file mode 100644
index 0000000..836857e
--- /dev/null
+++ b/detekt-config.yml
@@ -0,0 +1,658 @@
+build:
+ maxIssues: 0
+ excludeCorrectable: false
+ weights:
+ # complexity: 2
+ # LongParameterList: 1
+ # style: 1
+ # comments: 1
+
+config:
+ validation: true
+ warningsAsErrors: false
+ # when writing own rules with new properties, exclude the property path
e.g.: 'my_rule_set,.*>.*>[my_property]'
+ excludes: ''
+
+processors:
+ active: true
+ exclude:
+ - 'DetektProgressListener'
+ # - 'KtFileCountProcessor'
+ # - 'PackageCountProcessor'
+ # - 'ClassCountProcessor'
+ # - 'FunctionCountProcessor'
+ # - 'PropertyCountProcessor'
+ # - 'ProjectComplexityProcessor'
+ # - 'ProjectCognitiveComplexityProcessor'
+ # - 'ProjectLLOCProcessor'
+ # - 'ProjectCLOCProcessor'
+ # - 'ProjectLOCProcessor'
+ # - 'ProjectSLOCProcessor'
+ # - 'LicenseHeaderLoaderExtension'
+
+console-reports:
+ active: true
+ exclude:
+ - 'ProjectStatisticsReport'
+ - 'ComplexityReport'
+ - 'NotificationReport'
+ # - 'FindingsReport'
+ - 'FileBasedFindingsReport'
+ # - 'LiteFindingsReport'
+
+output-reports:
+ active: true
+ exclude:
+ # - 'TxtOutputReport'
+ # - 'XmlOutputReport'
+ # - 'HtmlOutputReport'
+
+comments:
+ active: true
+ AbsentOrWrongFileLicense:
+ active: false
+ CommentOverPrivateFunction:
+ active: false
+ CommentOverPrivateProperty:
+ active: false
+ DeprecatedBlockTag:
+ active: false
+ EndOfSentenceFormat:
+ active: false
+ OutdatedDocumentation:
+ active: false
+ allowParamOnConstructorProperties: false
+ UndocumentedPublicClass:
+ active: false
+ UndocumentedPublicFunction:
+ active: false
+ UndocumentedPublicProperty:
+ active: false
+
+complexity:
+ active: true
+ ComplexCondition:
+ threshold: 4
+ ComplexInterface:
+ threshold: 10
+ includeStaticDeclarations: false
+ includePrivateDeclarations: false
+ CyclomaticComplexMethod:
+ threshold: 15
+ ignoreSingleWhenExpression: false
+ ignoreSimpleWhenEntries: false
+ ignoreNestingFunctions: false
+ nestingFunctions:
+ - 'also'
+ - 'apply'
+ - 'forEach'
+ - 'isNotNull'
+ - 'ifNull'
+ - 'let'
+ - 'run'
+ - 'use'
+ - 'with'
+ LabeledExpression:
+ active: false
+ LargeClass:
+ threshold: 600
+ LongMethod:
+ threshold: 60
+ LongParameterList:
+ functionThreshold: 6
+ constructorThreshold: 7
+ ignoreDefaultParameters: false
+ ignoreDataClasses: true
+ ignoreAnnotatedParameter: []
+ MethodOverloading:
+ threshold: 6
+ NamedArguments:
+ active: false
+ threshold: 3
+ NestedBlockDepth:
+ threshold: 4
+ NestedScopeFunctions:
+ threshold: 1
+ functions:
+ - 'kotlin.apply'
+ - 'kotlin.run'
+ - 'kotlin.with'
+ - 'kotlin.let'
+ - 'kotlin.also'
+ ReplaceSafeCallChainWithRun:
+ active: false
+ StringLiteralDuplication:
+ active: false
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**',
'**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
+ threshold: 3
+ ignoreAnnotation: true
+ excludeStringsWithLessThan5Characters: true
+ ignoreStringsRegex: '$^'
+ TooManyFunctions:
+ active: true
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**',
'**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
+ thresholdInFiles: 11
+ thresholdInClasses: 11
+ thresholdInInterfaces: 11
+ thresholdInObjects: 11
+ thresholdInEnums: 11
+ ignoreDeprecated: false
+ ignorePrivate: false
+ ignoreOverridden: false
+
+coroutines:
+ active: true
+ GlobalCoroutineUsage:
+ active: false
+ InjectDispatcher:
+ active: false
+ dispatcherNames:
+ - 'IO'
+ - 'Default'
+ - 'Unconfined'
+ RedundantSuspendModifier:
+ active: false
+ SleepInsteadOfDelay:
+ active: false
+ SuspendFunWithFlowReturnType:
+ active: false
+
+empty-blocks:
+ active: true
+ EmptyCatchBlock:
+ active: true
+ allowedExceptionNameRegex: '^(_|(ignore|expected).*)'
+ EmptyClassBlock:
+ active: true
+ EmptyDefaultConstructor:
+ active: true
+ EmptyDoWhileBlock:
+ active: true
+ EmptyElseBlock:
+ active: true
+ EmptyFinallyBlock:
+ active: true
+ EmptyForBlock:
+ active: true
+ EmptyFunctionBlock:
+ active: true
+ ignoreOverridden: false
+ EmptyIfBlock:
+ active: true
+ EmptyInitBlock:
+ active: true
+ EmptyKtFile:
+ active: true
+ EmptySecondaryConstructor:
+ active: true
+ EmptyTryBlock:
+ active: true
+ EmptyWhenBlock:
+ active: true
+ EmptyWhileBlock:
+ active: true
+
+exceptions:
+ active: true
+ ExceptionRaisedInUnexpectedLocation:
+ active: true
+ methodNames:
+ - 'equals'
+ - 'finalize'
+ - 'hashCode'
+ - 'toString'
+ InstanceOfCheckForException:
+ active: false
+ NotImplementedDeclaration:
+ active: false
+ ObjectExtendsThrowable:
+ active: false
+ PrintStackTrace:
+ active: true
+ RethrowCaughtException:
+ active: true
+ ReturnFromFinally:
+ active: true
+ SwallowedException:
+ active: true
+ ignoredExceptionTypes:
+ - 'InterruptedException'
+ - 'MalformedURLException'
+ - 'NumberFormatException'
+ - 'ParseException'
+ allowedExceptionNameRegex: '^(_|(ignore|expected).*)'
+ ThrowingExceptionFromFinally:
+ active: true
+ ThrowingExceptionInMain:
+ active: false
+ ThrowingExceptionsWithoutMessageOrCause:
+ active: true
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**',
'**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
+ exceptions:
+ - 'ArrayIndexOutOfBoundsException'
+ - 'Exception'
+ - 'IllegalArgumentException'
+ - 'IllegalMonitorStateException'
+ - 'IllegalStateException'
+ - 'IndexOutOfBoundsException'
+ - 'NullPointerException'
+ - 'RuntimeException'
+ - 'Throwable'
+ ThrowingNewInstanceOfSameException:
+ active: true
+ TooGenericExceptionCaught:
+ active: true
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**',
'**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
+ exceptionNames:
+ - 'ArrayIndexOutOfBoundsException'
+ - 'Error'
+ - 'Exception'
+ - 'IllegalMonitorStateException'
+ - 'IndexOutOfBoundsException'
+ - 'NullPointerException'
+ - 'RuntimeException'
+ - 'Throwable'
+ allowedExceptionNameRegex: '^(_|(ignore|expected).*)'
+ TooGenericExceptionThrown:
+ active: true
+ exceptionNames:
+ - 'Error'
+ - 'Exception'
+ - 'RuntimeException'
+ - 'Throwable'
+
+naming:
+ active: true
+ BooleanPropertyNaming:
+ active: false
+ allowedPattern: '^(is|has|are)'
+ ClassNaming:
+ active: true
+ classPattern: '[A-Z][a-zA-Z0-9]*'
+ ConstructorParameterNaming:
+ active: true
+ parameterPattern: '[a-z][A-Za-z0-9]*'
+ privateParameterPattern: '[a-z][A-Za-z0-9]*'
+ excludeClassPattern: '$^'
+ EnumNaming:
+ active: true
+ enumEntryPattern: '[A-Z][_a-zA-Z0-9]*'
+ ForbiddenClassName:
+ active: false
+ forbiddenName: []
+ FunctionMaxLength:
+ active: false
+ maximumFunctionNameLength: 30
+ FunctionMinLength:
+ active: false
+ minimumFunctionNameLength: 3
+ FunctionNaming:
+ active: true
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**',
'**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
+ functionPattern: '([a-z][a-zA-Z0-9]*)|(`.*`)'
+ excludeClassPattern: '$^'
+ FunctionParameterNaming:
+ active: true
+ parameterPattern: '[a-z][A-Za-z0-9]*'
+ excludeClassPattern: '$^'
+ InvalidPackageDeclaration:
+ active: true
+ rootPackage: ''
+ LambdaParameterNaming:
+ active: false
+ parameterPattern: '[a-z][A-Za-z0-9]*|_'
+ MatchingDeclarationName:
+ active: true
+ mustBeFirst: true
+ MemberNameEqualsClassName:
+ active: true
+ ignoreOverridden: true
+ NoNameShadowing:
+ active: true
+ NonBooleanPropertyPrefixedWithIs:
+ active: false
+ ObjectPropertyNaming:
+ active: true
+ constantPattern: '[A-Za-z][_A-Za-z0-9]*'
+ propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
+ privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*'
+ PackageNaming:
+ active: true
+ packagePattern: '[a-z]+(\.[a-z][A-Za-z0-9]*)*'
+ TopLevelPropertyNaming:
+ active: true
+ constantPattern: '[A-Z][_A-Z0-9]*'
+ propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
+ privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*'
+ VariableMaxLength:
+ active: false
+ maximumVariableNameLength: 64
+ VariableMinLength:
+ active: false
+ minimumVariableNameLength: 1
+ VariableNaming:
+ active: true
+ variablePattern: '[a-z][A-Za-z0-9]*'
+ privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
+ excludeClassPattern: '$^'
+
+performance:
+ active: true
+ ArrayPrimitive:
+ active: true
+ CouldBeSequence:
+ active: false
+ threshold: 3
+ ForEachOnRange:
+ active: true
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**',
'**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
+ SpreadOperator:
+ active: true
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**',
'**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
+ UnnecessaryTemporaryInstantiation:
+ active: true
+
+potential-bugs:
+ active: true
+ AvoidReferentialEquality:
+ active: true
+ forbiddenTypePatterns:
+ - 'kotlin.String'
+ CastToNullableType:
+ active: false
+ Deprecation:
+ active: false
+ DontDowncastCollectionTypes:
+ active: false
+ DoubleMutabilityForCollection:
+ active: false
+ ElseCaseInsteadOfExhaustiveWhen:
+ active: false
+ EqualsAlwaysReturnsTrueOrFalse:
+ active: true
+ EqualsWithHashCodeExist:
+ active: true
+ ExitOutsideMain:
+ active: false
+ ExplicitGarbageCollectionCall:
+ active: true
+ HasPlatformType:
+ active: false
+ IgnoredReturnValue:
+ active: false
+ restrictToConfig: true
+ returnValueAnnotations:
+ - '*.CheckResult'
+ - '*.CheckReturnValue'
+ ignoreReturnValueAnnotations:
+ - '*.CanIgnoreReturnValue'
+ returnValueTypes:
+ - 'kotlin.sequences.Sequence'
+ - 'kotlinx.coroutines.flow.*Flow'
+ - 'java.util.stream.*Stream'
+ ignoreFunctionCall: []
+ ImplicitDefaultLocale:
+ active: true
+ ImplicitUnitReturnType:
+ active: false
+ allowExplicitReturnType: true
+ InvalidRange:
+ active: true
+ IteratorHasNextCallsNextMethod:
+ active: true
+ IteratorNotThrowingNoSuchElementException:
+ active: true
+ LateinitUsage:
+ active: false
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**',
'**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
+ ignoreOnClassesPattern: ''
+ MapGetWithNotNullAssertionOperator:
+ active: true
+ MissingPackageDeclaration:
+ active: false
+ excludes: ['**/*.kts']
+ NullCheckOnMutableProperty:
+ active: false
+ NullableToStringCall:
+ active: false
+ UnconditionalJumpStatementInLoop:
+ active: false
+ UnnecessaryNotNullOperator:
+ active: true
+ UnnecessarySafeCall:
+ active: true
+ UnreachableCatchBlock:
+ active: true
+ UnreachableCode:
+ active: true
+ UnsafeCallOnNullableType:
+ active: true
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**',
'**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
+ UnsafeCast:
+ active: true
+ UnusedUnaryOperator:
+ active: true
+ UselessPostfixExpression:
+ active: true
+ WrongEqualsTypeParameter:
+ active: true
+
+style:
+ active: true
+ CanBeNonNullable:
+ active: false
+ CascadingCallWrapping:
+ active: false
+ includeElvis: true
+ ClassOrdering:
+ active: false
+ CollapsibleIfStatements:
+ active: false
+ DataClassContainsFunctions:
+ active: false
+ conversionFunctionPrefix:
+ - 'to'
+ DataClassShouldBeImmutable:
+ active: false
+ DestructuringDeclarationWithTooManyEntries:
+ active: true
+ maxDestructuringEntries: 3
+ EqualsNullCall:
+ active: true
+ EqualsOnSignatureLine:
+ active: false
+ ExplicitCollectionElementAccessMethod:
+ active: false
+ ExplicitItLambdaParameter:
+ active: false
+ ExpressionBodySyntax:
+ active: false
+ includeLineWrapping: false
+ ForbiddenComment:
+ active: true
+ comments:
+ - value: 'TODO:'
+ reason: 'Create an issue in GitHub instead of TODO comments'
+ - value: 'FIXME:'
+ reason: 'Use a GitHub issue instead of FIXME comments'
+ - value: 'STOPSHIP:'
+ reason: 'STOPSHIP comments must be resolved before merging'
+ - value: '@author'
+ reason: 'Author information should be in version control'
+ - value: '@requiresTypeResolution'
+ reason: 'Type resolution comments are not needed'
+ allowedPatterns: ''
+ ForbiddenImport:
+ active: false
+ imports: []
+ forbiddenPatterns: ''
+ ForbiddenMethodCall:
+ active: false
+ methods:
+ - 'kotlin.io.print'
+ - 'kotlin.io.println'
+ ForbiddenVoid:
+ active: false
+ ignoreOverridden: false
+ ignoreUsageInGenerics: false
+ FunctionOnlyReturningConstant:
+ active: true
+ ignoreOverridableFunction: true
+ ignoreActualFunction: true
+ excludedFunctions: []
+ LoopWithTooManyJumpStatements:
+ active: true
+ maxJumpCount: 1
+ MagicNumber:
+ active: true
+ excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**',
'**/jvmTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts']
+ ignoreNumbers:
+ - '-1'
+ - '0'
+ - '1'
+ - '2'
+ ignoreHashCodeFunction: true
+ ignorePropertyDeclaration: false
+ ignoreLocalVariableDeclaration: false
+ ignoreConstantDeclaration: true
+ ignoreCompanionObjectPropertyDeclaration: true
+ ignoreAnnotation: false
+ ignoreNamedArgument: true
+ ignoreEnums: false
+ ignoreRanges: false
+ ignoreExtensionFunctions: true
+ BracesOnIfStatements:
+ active: false
+ singleLine: 'never'
+ multiLine: 'never'
+ MandatoryBracesLoops:
+ active: false
+ MaxChainedCallsOnSameLine:
+ active: false
+ maxChainedCalls: 5
+ MaxLineLength:
+ active: true
+ maxLineLength: 120
+ excludePackageStatements: true
+ excludeImportStatements: true
+ excludeCommentStatements: false
+ MayBeConst:
+ active: true
+ ModifierOrder:
+ active: true
+ MultilineLambdaItParameter:
+ active: false
+ NestedClassesVisibility:
+ active: true
+ NewLineAtEndOfFile:
+ active: true
+ NoTabs:
+ active: false
+ NullableBooleanCheck:
+ active: false
+ ObjectLiteralToLambda:
+ active: false
+ OptionalAbstractKeyword:
+ active: true
+ OptionalUnit:
+ active: false
+ BracesOnWhenStatements:
+ active: false
+ singleLine: 'never'
+ multiLine: 'never'
+ PreferToOverPairSyntax:
+ active: false
+ ProtectedMemberInFinalClass:
+ active: true
+ RedundantExplicitType:
+ active: false
+ RedundantHigherOrderMapUsage:
+ active: true
+ RedundantVisibilityModifierRule:
+ active: false
+ ReturnCount:
+ active: true
+ max: 2
+ excludedFunctions:
+ - 'equals'
+ excludeLabeled: false
+ excludeReturnFromLambda: true
+ excludeGuardClauses: false
+ SafeCast:
+ active: true
+ SerialVersionUIDInSerializableClass:
+ active: true
+ SpacingBetweenPackageAndImports:
+ active: false
+ ThrowsCount:
+ active: true
+ max: 2
+ excludeGuardClauses: false
+ TrailingWhitespace:
+ active: false
+ TrimMultilineRawString:
+ active: false
+ UnderscoresInNumericLiterals:
+ active: false
+ acceptableLength: 4
+ UnnecessaryAbstractClass:
+ active: true
+ UnnecessaryAnnotationUseSiteTarget:
+ active: false
+ UnnecessaryApply:
+ active: true
+ UnnecessaryFilter:
+ active: true
+ UnnecessaryInheritance:
+ active: true
+ UnnecessaryInnerClass:
+ active: false
+ UnnecessaryLet:
+ active: false
+ UnnecessaryParentheses:
+ active: false
+ UntilInsteadOfRangeTo:
+ active: false
+ UnusedImports:
+ active: false
+ UnusedPrivateClass:
+ active: true
+ UnusedPrivateMember:
+ active: true
+ allowedNames: '(_|ignored|expected|serialVersionUID)'
+ UseAnyOrNoneInsteadOfFind:
+ active: true
+ UseArrayLiteralsInAnnotations:
+ active: true
+ UseCheckNotNull:
+ active: true
+ UseCheckOrError:
+ active: true
+ UseDataClass:
+ active: false
+ allowVars: false
+ UseEmptyCounterpart:
+ active: false
+ UseIfEmptyOrIfBlank:
+ active: false
+ UseIfInsteadOfWhen:
+ active: false
+ UseIsNullOrEmpty:
+ active: true
+ UseOrEmpty:
+ active: true
+ UseRequire:
+ active: true
+ UseRequireNotNull:
+ active: true
+ UselessCallOnNotNull:
+ active: true
+ UtilityClassWithPublicConstructor:
+ active: true
+ VarCouldBeVal:
+ active: true
+ ignoreLateinitVar: false
+ WildcardImport:
+ active: true
+ excludeImports:
+ - 'java.util.*'
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]