Detekt Config (detekt.yml)
1.22.0Schema URL
Type:
object
Properties
build
object
3 nested properties
maxIssues
integer
excludeCorrectable
boolean
weights
Record<string, integer>
config
object
4 nested properties
validation
boolean
warningsAsErrors
boolean
checkExhaustiveness
boolean
excludes
string
processors
object
2 nested properties
active
boolean
exclude
string[]
console-reports
object
2 nested properties
active
boolean
exclude
string[]
output-reports
object
2 nested properties
active
boolean
exclude
string[]
comments
object
11 nested properties
active
boolean
AbsentOrWrongFileLicense
object
ruleProperties object
2 nested properties
licenseTemplateFile
string
licenseTemplateIsRegex
boolean
CommentOverPrivateFunction
object
ruleProperties object
CommentOverPrivateProperty
object
ruleProperties object
DeprecatedBlockTag
object
ruleProperties object
KDocReferencesNonPublicProperty
object
ruleProperties object
OutdatedDocumentation
object
ruleProperties object
3 nested properties
matchTypeParameters
boolean
matchDeclarationsOrder
boolean
allowParamOnConstructorProperties
boolean
UndocumentedPublicClass
object
ruleProperties object
5 nested properties
searchInNestedClass
boolean
searchInInnerClass
boolean
searchInInnerObject
boolean
searchInInnerInterface
boolean
searchInProtectedClass
boolean
UndocumentedPublicFunction
object
ruleProperties object
1 nested properties
searchProtectedFunction
boolean
UndocumentedPublicProperty
object
ruleProperties object
1 nested properties
searchProtectedProperty
boolean
complexity
object
16 nested properties
active
boolean
ComplexInterface
object
ruleProperties object
4 nested properties
threshold
integer
includeStaticDeclarations
boolean
includePrivateDeclarations
boolean
ignoreOverloaded
boolean
CyclomaticComplexMethod
object
ruleProperties object
5 nested properties
threshold
integer
ignoreSingleWhenExpression
boolean
ignoreSimpleWhenEntries
boolean
ignoreNestingFunctions
boolean
nestingFunctions
string[]
LongParameterList
object
ruleProperties object
5 nested properties
functionThreshold
integer
constructorThreshold
integer
ignoreDefaultParameters
boolean
ignoreDataClasses
boolean
ignoreAnnotatedParameter
string[]
NamedArguments
object
ruleProperties object
2 nested properties
threshold
integer
ignoreArgumentsMatchingNames
boolean
NestedScopeFunctions
object
ruleProperties object
2 nested properties
threshold
integer
functions
string[]
ReplaceSafeCallChainWithRun
object
ruleProperties object
StringLiteralDuplication
object
ruleProperties object
4 nested properties
threshold
integer
ignoreAnnotation
boolean
excludeStringsWithLessThan5Characters
boolean
ignoreStringsRegex
string
TooManyFunctions
object
ruleProperties object
8 nested properties
thresholdInFiles
integer
thresholdInClasses
integer
thresholdInInterfaces
integer
thresholdInObjects
integer
thresholdInEnums
integer
ignoreDeprecated
boolean
ignorePrivate
boolean
ignoreOverridden
boolean
coroutines
object
7 nested properties
active
boolean
GlobalCoroutineUsage
object
ruleProperties object
RedundantSuspendModifier
object
ruleProperties object
SleepInsteadOfDelay
object
ruleProperties object
SuspendFunWithCoroutineScopeReceiver
object
ruleProperties object
SuspendFunWithFlowReturnType
object
ruleProperties object
empty-blocks
object
16 nested properties
active
boolean
EmptyClassBlock
object
ruleProperties object
EmptyDefaultConstructor
object
ruleProperties object
EmptyDoWhileBlock
object
ruleProperties object
EmptyElseBlock
object
ruleProperties object
EmptyFinallyBlock
object
ruleProperties object
EmptyForBlock
object
ruleProperties object
EmptyIfBlock
object
ruleProperties object
EmptyInitBlock
object
ruleProperties object
EmptyKtFile
object
ruleProperties object
EmptySecondaryConstructor
object
ruleProperties object
EmptyTryBlock
object
ruleProperties object
EmptyWhenBlock
object
ruleProperties object
EmptyWhileBlock
object
ruleProperties object
exceptions
object
15 nested properties
active
boolean
ExceptionRaisedInUnexpectedLocation
object
ruleProperties object
1 nested properties
methodNames
string[]
InstanceOfCheckForException
object
ruleProperties object
NotImplementedDeclaration
object
ruleProperties object
ObjectExtendsThrowable
object
ruleProperties object
PrintStackTrace
object
ruleProperties object
RethrowCaughtException
object
ruleProperties object
SwallowedException
object
ruleProperties object
2 nested properties
ignoredExceptionTypes
string[]
allowedExceptionNameRegex
string
ThrowingExceptionFromFinally
object
ruleProperties object
ThrowingExceptionInMain
object
ruleProperties object
ThrowingExceptionsWithoutMessageOrCause
object
ruleProperties object
1 nested properties
exceptions
string[]
ThrowingNewInstanceOfSameException
object
ruleProperties object
TooGenericExceptionCaught
object
ruleProperties object
2 nested properties
exceptionNames
string[]
allowedExceptionNameRegex
string
naming
object
22 nested properties
active
boolean
BooleanPropertyNaming
object
ruleProperties object
2 nested properties
allowedPattern
string
ignoreOverridden
boolean
ConstructorParameterNaming
object
ruleProperties object
4 nested properties
parameterPattern
string
privateParameterPattern
string
excludeClassPattern
string
ignoreOverridden
boolean
FunctionMaxLength
object
ruleProperties object
1 nested properties
maximumFunctionNameLength
integer
FunctionMinLength
object
ruleProperties object
1 nested properties
minimumFunctionNameLength
integer
FunctionNaming
object
ruleProperties object
3 nested properties
functionPattern
string
excludeClassPattern
string
ignoreOverridden
boolean
FunctionParameterNaming
object
ruleProperties object
3 nested properties
parameterPattern
string
excludeClassPattern
string
ignoreOverridden
boolean
InvalidPackageDeclaration
object
ruleProperties object
2 nested properties
rootPackage
string
requireRootInDeclaration
boolean
NoNameShadowing
object
ruleProperties object
NonBooleanPropertyPrefixedWithIs
object
ruleProperties object
ObjectPropertyNaming
object
ruleProperties object
3 nested properties
constantPattern
string
propertyPattern
string
privatePropertyPattern
string
TopLevelPropertyNaming
object
ruleProperties object
3 nested properties
constantPattern
string
propertyPattern
string
privatePropertyPattern
string
VariableMaxLength
object
ruleProperties object
1 nested properties
maximumVariableNameLength
integer
VariableMinLength
object
ruleProperties object
1 nested properties
minimumVariableNameLength
integer
VariableNaming
object
ruleProperties object
4 nested properties
variablePattern
string
privateVariablePattern
string
excludeClassPattern
string
ignoreOverridden
boolean
performance
object
7 nested properties
active
boolean
ArrayPrimitive
object
ruleProperties object
ForEachOnRange
object
ruleProperties object
SpreadOperator
object
ruleProperties object
UnnecessaryPartOfBinaryExpression
object
ruleProperties object
UnnecessaryTemporaryInstantiation
object
ruleProperties object
potential-bugs
object
34 nested properties
active
boolean
AvoidReferentialEquality
object
ruleProperties object
1 nested properties
forbiddenTypePatterns
string[]
CastToNullableType
object
ruleProperties object
Deprecation
object
ruleProperties object
DontDowncastCollectionTypes
object
ruleProperties object
DoubleMutabilityForCollection
object
ruleProperties object
1 nested properties
mutableTypes
string[]
ElseCaseInsteadOfExhaustiveWhen
object
ruleProperties object
EqualsAlwaysReturnsTrueOrFalse
object
ruleProperties object
EqualsWithHashCodeExist
object
ruleProperties object
ExitOutsideMain
object
ruleProperties object
ExplicitGarbageCollectionCall
object
ruleProperties object
HasPlatformType
object
ruleProperties object
IgnoredReturnValue
object
ruleProperties object
5 nested properties
restrictToConfig
boolean
returnValueAnnotations
string[]
ignoreReturnValueAnnotations
string[]
returnValueTypes
string[]
ignoreFunctionCall
string[]
ImplicitDefaultLocale
object
ruleProperties object
ImplicitUnitReturnType
object
ruleProperties object
1 nested properties
allowExplicitReturnType
boolean
InvalidRange
object
ruleProperties object
IteratorHasNextCallsNextMethod
object
ruleProperties object
IteratorNotThrowingNoSuchElementException
object
ruleProperties object
MapGetWithNotNullAssertionOperator
object
ruleProperties object
MissingPackageDeclaration
object
ruleProperties object
NullCheckOnMutableProperty
object
ruleProperties object
NullableToStringCall
object
ruleProperties object
UnconditionalJumpStatementInLoop
object
ruleProperties object
UnnecessaryNotNullCheck
object
ruleProperties object
UnnecessaryNotNullOperator
object
ruleProperties object
UnnecessarySafeCall
object
ruleProperties object
UnreachableCatchBlock
object
ruleProperties object
UnreachableCode
object
ruleProperties object
UnsafeCallOnNullableType
object
ruleProperties object
UnsafeCast
object
ruleProperties object
UnusedUnaryOperator
object
ruleProperties object
UselessPostfixExpression
object
ruleProperties object
WrongEqualsTypeParameter
object
ruleProperties object
style
object
81 nested properties
active
boolean
AlsoCouldBeApply
object
ruleProperties object
CanBeNonNullable
object
ruleProperties object
ClassOrdering
object
ruleProperties object
CollapsibleIfStatements
object
ruleProperties object
DataClassContainsFunctions
object
ruleProperties object
1 nested properties
conversionFunctionPrefix
string[]
DataClassShouldBeImmutable
object
ruleProperties object
DestructuringDeclarationWithTooManyEntries
object
ruleProperties object
1 nested properties
maxDestructuringEntries
integer
EqualsNullCall
object
ruleProperties object
EqualsOnSignatureLine
object
ruleProperties object
ExplicitCollectionElementAccessMethod
object
ruleProperties object
ExplicitItLambdaParameter
object
ruleProperties object
ForbiddenComment
object
ruleProperties object
3 nested properties
values
string[]
allowedPatterns
string
customMessage
string
ForbiddenImport
object
ruleProperties object
2 nested properties
imports
object[]
forbiddenPatterns
string
ForbiddenVoid
object
ruleProperties object
2 nested properties
ignoreOverridden
boolean
ignoreUsageInGenerics
boolean
FunctionOnlyReturningConstant
object
ruleProperties object
3 nested properties
ignoreOverridableFunction
boolean
ignoreActualFunction
boolean
excludedFunctions
string[]
MagicNumber
object
ruleProperties object
11 nested properties
ignoreNumbers
string[]
ignoreHashCodeFunction
boolean
ignorePropertyDeclaration
boolean
ignoreLocalVariableDeclaration
boolean
ignoreConstantDeclaration
boolean
ignoreCompanionObjectPropertyDeclaration
boolean
ignoreAnnotation
boolean
ignoreNamedArgument
boolean
ignoreEnums
boolean
ignoreRanges
boolean
ignoreExtensionFunctions
boolean
MandatoryBracesIfStatements
object
ruleProperties object
MandatoryBracesLoops
object
ruleProperties object
MaxLineLength
object
ruleProperties object
5 nested properties
maxLineLength
integer
excludePackageStatements
boolean
excludeImportStatements
boolean
excludeCommentStatements
boolean
excludeRawStrings
boolean
MayBeConst
object
ruleProperties object
ModifierOrder
object
ruleProperties object
MultilineLambdaItParameter
object
ruleProperties object
NestedClassesVisibility
object
ruleProperties object
NewLineAtEndOfFile
object
ruleProperties object
NoTabs
object
ruleProperties object
NullableBooleanCheck
object
ruleProperties object
ObjectLiteralToLambda
object
ruleProperties object
OptionalAbstractKeyword
object
ruleProperties object
OptionalUnit
object
ruleProperties object
OptionalWhenBraces
object
ruleProperties object
PreferToOverPairSyntax
object
ruleProperties object
ProtectedMemberInFinalClass
object
ruleProperties object
RedundantExplicitType
object
ruleProperties object
RedundantHigherOrderMapUsage
object
ruleProperties object
RedundantVisibilityModifierRule
object
ruleProperties object
ReturnCount
object
ruleProperties object
5 nested properties
max
integer
excludedFunctions
string[]
excludeLabeled
boolean
excludeReturnFromLambda
boolean
excludeGuardClauses
boolean
SafeCast
object
ruleProperties object
SerialVersionUIDInSerializableClass
object
ruleProperties object
SpacingBetweenPackageAndImports
object
ruleProperties object
ThrowsCount
object
ruleProperties object
2 nested properties
max
integer
excludeGuardClauses
boolean
TrailingWhitespace
object
ruleProperties object
TrimMultilineRawString
object
ruleProperties object
UnderscoresInNumericLiterals
object
ruleProperties object
2 nested properties
acceptableLength
integer
allowNonStandardGrouping
boolean
UnnecessaryAbstractClass
object
ruleProperties object
UnnecessaryAnnotationUseSiteTarget
object
ruleProperties object
UnnecessaryApply
object
ruleProperties object
UnnecessaryBackticks
object
ruleProperties object
UnnecessaryFilter
object
ruleProperties object
UnnecessaryInheritance
object
ruleProperties object
UnnecessaryInnerClass
object
ruleProperties object
UnnecessaryLet
object
ruleProperties object
UnnecessaryParentheses
object
ruleProperties object
1 nested properties
allowForUnclearPrecedence
boolean
UntilInsteadOfRangeTo
object
ruleProperties object
UnusedImports
object
ruleProperties object
UnusedPrivateClass
object
ruleProperties object
UseAnyOrNoneInsteadOfFind
object
ruleProperties object
UseArrayLiteralsInAnnotations
object
ruleProperties object
UseCheckNotNull
object
ruleProperties object
UseCheckOrError
object
ruleProperties object
UseEmptyCounterpart
object
ruleProperties object
UseIfEmptyOrIfBlank
object
ruleProperties object
UseIfInsteadOfWhen
object
ruleProperties object
UseIsNullOrEmpty
object
ruleProperties object
UseOrEmpty
object
ruleProperties object
UseRequire
object
ruleProperties object
UseRequireNotNull
object
ruleProperties object
UseSumOfInsteadOfFlatMapSize
object
ruleProperties object
UselessCallOnNotNull
object
ruleProperties object
UtilityClassWithPublicConstructor
object
ruleProperties object
formatting
object
64 nested properties
active
boolean
android
boolean
autoCorrect
boolean
ArgumentListWrapping
object
ruleProperties object
3 nested properties
autoCorrect
boolean
indentSize
integer
maxLineLength
integer
BlockCommentInitialStarAlignment
object
ruleProperties object
1 nested properties
autoCorrect
boolean
CommentWrapping
object
ruleProperties object
2 nested properties
autoCorrect
boolean
indentSize
integer
Filename
object
ruleProperties object
FinalNewline
object
ruleProperties object
2 nested properties
autoCorrect
boolean
insertFinalNewLine
boolean
FunctionSignature
object
ruleProperties object
5 nested properties
autoCorrect
boolean
forceMultilineWhenParameterCountGreaterOrEqualThan
integer
functionBodyExpressionWrapping
string
maxLineLength
integer
indentSize
integer
KdocWrapping
object
ruleProperties object
2 nested properties
autoCorrect
boolean
indentSize
integer
MaximumLineLength
object
ruleProperties object
2 nested properties
maxLineLength
integer
ignoreBackTickedIdentifier
boolean
NoBlankLinesInChainedMethodCalls
object
ruleProperties object
1 nested properties
autoCorrect
boolean
NoWildcardImports
object
ruleProperties object
1 nested properties
packagesToUseImportOnDemandProperty
string
ParameterListWrapping
object
ruleProperties object
2 nested properties
autoCorrect
boolean
maxLineLength
integer
SpacingBetweenDeclarationsWithAnnotations
object
ruleProperties object
1 nested properties
autoCorrect
boolean
SpacingBetweenDeclarationsWithComments
object
ruleProperties object
1 nested properties
autoCorrect
boolean
SpacingBetweenFunctionNameAndOpeningParenthesis
object
ruleProperties object
1 nested properties
autoCorrect
boolean
TrailingCommaOnCallSite
object
ruleProperties object
2 nested properties
autoCorrect
boolean
useTrailingCommaOnCallSite
boolean
TrailingCommaOnDeclarationSite
object
ruleProperties object
2 nested properties
autoCorrect
boolean
useTrailingCommaOnDeclarationSite
boolean
UnnecessaryParenthesesBeforeTrailingLambda
object
ruleProperties object
1 nested properties
autoCorrect
boolean
libraries
object
4 nested properties
active
boolean
LibraryCodeMustSpecifyReturnType
object
ruleProperties object
LibraryEntitiesShouldNotBePublic
object
ruleProperties object
ruleauthors
object
3 nested properties
active
boolean
UseEntityAtName
object
ruleProperties object
ViolatesTypeResolutionRequirements
object
ruleProperties object
Definitions
ruleProperties
object
active
boolean
excludes
string[]
ignoreAnnotated
string[]
ignoreFunction
string[]