Skip to content

Conversation

@matejdro
Copy link
Owner

No description provided.

@github-actions
Copy link
Contributor

Lint report

Results

Suppressed Results

Nothing here.

Rules information

Rules details
- detekt.potential-bugs.AvoidReferentialEquality [] 

> Avoid using referential equality and prefer to use referential equality checks instead.

,

- detekt.potential-bugs.Deprecation [] 

> Deprecated elements should not be used.

,

- detekt.potential-bugs.DontDowncastCollectionTypes [] 

> Down-casting immutable collection types is breaking the collection contract.

,

- detekt.potential-bugs.DoubleMutabilityForCollection [] 

> Using var with mutable collections or values leads to double mutability. Consider using val or immutable collection or value types.

,

- detekt.potential-bugs.DuplicateCaseInWhenExpression [] 

> Duplicated `case` statements in a `when` expression detected. Both cases should be merged.

,

- detekt.potential-bugs.ElseCaseInsteadOfExhaustiveWhen [] 

> A `when` expression that has an exhaustive set of cases should not contain an `else` case.

,

- detekt.potential-bugs.EqualsAlwaysReturnsTrueOrFalse [] 

> Having an `equals()` method that always returns true or false is not a good idea. It does not follow the contract of this method. Consider a good default implementation (e.g. `this == other`).

,

- detekt.potential-bugs.EqualsWithHashCodeExist [] 

> Always override hashCode when you override equals. All hash-based collections depend on objects meeting the equals-contract. Two equal objects must produce the same hashcode. When inheriting equals or hashcode, override the inherited and call the super method for clarification.

,

- detekt.potential-bugs.ExitOutsideMain [] 

> Do not directly exit the process outside the `main` function. Throw an exception instead.

,

- detekt.potential-bugs.ExplicitGarbageCollectionCall [] 

> Don't try to be smarter than the JVM. Your code should work independently whether the garbage collector is disabled or not. If you face memory issues, try tuning the JVM options instead of relying on code itself.

,

- detekt.potential-bugs.HasPlatformType [] 

> Platform types must be declared explicitly in public APIs.

,

- detekt.potential-bugs.ImplicitDefaultLocale [] 

> Implicit default locale used for string processing. Consider using explicit locale.

,

- detekt.potential-bugs.InvalidRange [] 

> If a for loops condition is false before the first iteration, the loop will never get executed.

,

- detekt.potential-bugs.IteratorHasNextCallsNextMethod [] 

> The `hasNext()` method of an Iterator implementation should not call the `next()` method. The state of the iterator should not be changed inside the `hasNext()` method. The `hasNext()` method is not supposed to have any side effects.

,

- detekt.potential-bugs.IteratorNotThrowingNoSuchElementException [] 

> The `next()` method of an `Iterator` implementation should throw a `NoSuchElementException` when there are no more elements to return.

,

- detekt.potential-bugs.LateinitUsage [] 

> Usage of `lateinit` detected. Using `lateinit` for property initialization is error prone, try using constructor injection or delegation.

,

- detekt.potential-bugs.MapGetWithNotNullAssertionOperator [] 

> map.get() with not-null assertion operator (!!) can result in a NullPointerException. Consider usage of map.getValue(), map.getOrDefault() or map.getOrElse() instead.

,

- detekt.potential-bugs.MissingPackageDeclaration [] 

> Kotlin source files should define a package.

,

- detekt.potential-bugs.MissingWhenCase [] 

> Check usage of `when` used as a statement and don't compare all enum or sealed class cases.

,

- detekt.potential-bugs.NullCheckOnMutableProperty [] 

> Checking nullability on a mutable property is not useful because the property may be set to null afterwards.

,

- detekt.potential-bugs.RedundantElseInWhen [] 

> Check for redundant `else` case in `when` expression when used as statement.

,

- detekt.potential-bugs.UnconditionalJumpStatementInLoop [] 

> An unconditional jump statement in a loop is useless. The loop itself is only executed once.

,

- detekt.potential-bugs.UnnecessaryNotNullOperator [] 

> Unnecessary not-null unary operator (!!) detected.

,

- detekt.potential-bugs.UnnecessaryNotNullCheck [] 

> Remove unnecessary not-null checks on non-null types.

,

- detekt.potential-bugs.UnnecessarySafeCall [] 

> Unnecessary safe call operator detected.

,

- detekt.potential-bugs.UnreachableCode [] 

> Unreachable code detected. This code should be removed.

,

- detekt.potential-bugs.UnsafeCallOnNullableType [] 

> Unsafe calls on nullable types detected. These calls will throw a NullPointerException in case the nullable value is null.

,

- detekt.potential-bugs.UnsafeCast [] 

> Cast operator throws an exception if the cast is not possible.

,

- detekt.potential-bugs.UselessPostfixExpression [] 

> The incremented or decremented value is unused. This value is replaced with the original value.

,

- detekt.potential-bugs.WrongEqualsTypeParameter [] 

> Wrong parameter type for `equals()` method found. To correctly override the `equals()` method use `Any?`.

,

- detekt.potential-bugs.IgnoredReturnValue [] 

> This call returns a value which is ignored

,

- detekt.potential-bugs.ImplicitUnitReturnType [] 

> Functions using expression statements have an implicit return type. Changing the type of the expression accidentally, changes the function return type. This may lead to backward incompatibility. Use a block statement to make clear this function will never return a value.

,

- detekt.potential-bugs.NullableToStringCall [] 

> `toString()` on nullable receiver may return the string "null"

,

- detekt.potential-bugs.UnreachableCatchBlock [] 

> Unreachable catch block detected.

,

- detekt.potential-bugs.CastToNullableType [] 

> Use safe cast instead of unsafe cast to nullable types.

,

- detekt.potential-bugs.CastNullableToNonNullableType [] 

> Nullable type to non-null type cast is found. Consider using two assertions, `null` assertions and type cast

,

- detekt.potential-bugs.UnusedUnaryOperator [] 

> This unary operator is unused.

,

- detekt.potential-bugs.PropertyUsedBeforeDeclaration [] 

> Properties before declaration should not be used.

,

- detekt.complexity.LongParameterList [] 

> The more parameters a function has the more complex it is. Long parameter lists are often used to control complex algorithms and violate the Single Responsibility Principle. Prefer functions with short parameter lists.

,

- detekt.complexity.LongMethod [] 

> One method should have one responsibility. Long methods tend to handle many things at once. Prefer smaller methods to make them easier to understand.

,

- detekt.complexity.LargeClass [] 

> One class should have one responsibility. Large classes tend to handle many things at once. Split up large classes into smaller classes that are easier to understand.

,

- detekt.complexity.ComplexInterface [] 

> An interface contains too many functions and properties. Large classes tend to handle many things at once. An interface should have one responsibility. Split up large interfaces into smaller ones that are easier to understand.

,

- detekt.complexity.CyclomaticComplexMethod [] 

> Prefer splitting up complex methods into smaller, easier to test methods.

,

- detekt.complexity.CognitiveComplexMethod [] 

> Prefer splitting up complex methods into smaller, easier to understand methods.

,

- detekt.complexity.StringLiteralDuplication [] 

> Multiple occurrences of the same string literal within a single file detected. Prefer extracting the string literal into a property or constant.

,

- detekt.complexity.MethodOverloading [] 

> Methods which are overloaded often might be harder to maintain. Furthermore, these methods are tightly coupled. Refactor these methods and try to use optional parameters.

,

- detekt.complexity.NestedBlockDepth [] 

> Excessive nesting leads to hidden complexity. Prefer extracting code to make it easier to understand.

,

- detekt.complexity.NestedScopeFunctions [] 

> Over-using scope functions makes code confusing, hard to read and bug prone.

,

- detekt.complexity.TooManyFunctions [] 

> Too many functions inside a/an file/class/object/interface always indicate a violation of the single responsibility principle. Maybe the file/class/object/interface wants to manage too many things at once. Extract functionality which clearly belongs together.

,

- detekt.complexity.ComplexCondition [] 

> Complex conditions should be simplified and extracted into well-named methods if necessary.

,

- detekt.complexity.LabeledExpression [] 

> Expression with labels increase complexity and affect maintainability.

,

- detekt.complexity.ReplaceSafeCallChainWithRun [] 

> Chains of safe calls on non-nullable types can be surrounded with `run {}`.

,

- detekt.complexity.NamedArguments [] 

> Named arguments are required for function calls with many arguments.

,

- detekt.coroutines.GlobalCoroutineUsage [] 

> The usage of the `GlobalScope` instance is highly discouraged.

,

- detekt.coroutines.InjectDispatcher [] 

> Don't hardcode dispatchers when creating new coroutines or calling `withContext`. Use dependency injection for dispatchers to make testing easier.

,

- detekt.coroutines.RedundantSuspendModifier [] 

> The `suspend` modifier is only needed for functions that contain suspending calls.

,

- detekt.coroutines.SleepInsteadOfDelay [] 

> Usage of `Thread.sleep()` in coroutines can potentially halt multiple coroutines at once.

,

- detekt.coroutines.SuspendFunWithFlowReturnType [] 

> The `suspend` modifier should not be used for functions that return a Coroutines Flow type. Flows are cold streams and invoking a function that returns one should not produce any side effects.

,

- detekt.coroutines.SuspendFunWithCoroutineScopeReceiver [] 

> The `suspend` modifier should not be used for functions that use a CoroutinesScope as receiver. You should use suspend functions without the receiver or use plain functions and use coroutineScope { } instead.

,

- detekt.coroutines.SuspendFunSwallowedCancellation [] 

> `runCatching` does not propagate `CancellationException`, don't use it with `suspend` lambda blocks.

,

- detekt.comments.CommentOverPrivateFunction [] 

> Comments for private functions should be avoided. Prefer giving the function an expressive name. Split it up in smaller, self-explaining functions if necessary.

,

- detekt.comments.CommentOverPrivateProperty [] 

> Private properties should be named in a self-explanatory manner without the need for a  comment.

,

- detekt.comments.DeprecatedBlockTag [] 

> Do not use the `@deprecated` block tag, which is not supported by KDoc. Use the `@Deprecated` annotation instead.

,

- detekt.comments.EndOfSentenceFormat [] 

> The first sentence in a KDoc comment should end with proper punctuation or with a correct URL.

,

- detekt.comments.OutdatedDocumentation [] 

> KDoc comments should match the actual function or class signature

,

- detekt.comments.UndocumentedPublicClass [] 

> Public classes, interfaces and objects require documentation.

,

- detekt.comments.UndocumentedPublicFunction [] 

> Public functions require documentation.

,

- detekt.comments.UndocumentedPublicProperty [] 

> Public properties require documentation.

,

- detekt.comments.AbsentOrWrongFileLicense [] 

> License text is absent or incorrect.

,

- detekt.comments.KDocReferencesNonPublicProperty [] 

> KDoc comments should not refer to non-public properties.

,

- detekt.empty-blocks.EmptyCatchBlock [] 

> Empty catch block detected. Empty catch blocks indicate that an exception is ignored and not handled.

,

- detekt.empty-blocks.EmptyClassBlock [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.empty-blocks.EmptyDefaultConstructor [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.empty-blocks.EmptyDoWhileBlock [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.empty-blocks.EmptyElseBlock [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.empty-blocks.EmptyFinallyBlock [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.empty-blocks.EmptyForBlock [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.empty-blocks.EmptyFunctionBlock [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.empty-blocks.EmptyIfBlock [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.empty-blocks.EmptyInitBlock [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.empty-blocks.EmptyKtFile [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.empty-blocks.EmptySecondaryConstructor [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.empty-blocks.EmptyTryBlock [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.empty-blocks.EmptyWhenBlock [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.empty-blocks.EmptyWhileBlock [] 

> Empty block of code detected. As they serve no purpose they should be removed.

,

- detekt.exceptions.TooGenericExceptionCaught [] 

> The caught exception is too generic. Prefer catching specific exceptions to the case that is currently handled.

,

- detekt.exceptions.ExceptionRaisedInUnexpectedLocation [] 

> This method is not expected to throw exceptions. This can cause weird behavior.

,

- detekt.exceptions.TooGenericExceptionThrown [] 

> The thrown exception is too generic. Prefer throwing project specific exceptions to handle error cases.

,

- detekt.exceptions.NotImplementedDeclaration [] 

> The NotImplementedDeclaration should only be used when a method stub is necessary. This defers the development of the functionality of this function. Hence, the `NotImplementedDeclaration` should only serve as a temporary declaration. Before releasing, this type of declaration should be removed.

,

- detekt.exceptions.PrintStackTrace [] 

> Do not print a stack trace. These debug statements should be removed or replaced with a logger.

,

- detekt.exceptions.InstanceOfCheckForException [] 

> Instead of catching for a general exception type and checking for a specific exception type, use multiple catch blocks.

,

- detekt.exceptions.ThrowingExceptionsWithoutMessageOrCause [] 

> A call to the default constructor of an exception was detected. Instead one of the constructor overloads should be called. This allows to provide more meaningful exceptions.

,

- detekt.exceptions.ReturnFromFinally [] 

> Do not return within a finally statement. This can discard exceptions.

,

- detekt.exceptions.ThrowingExceptionFromFinally [] 

> Do not throw an exception within a finally statement. This can discard exceptions and is confusing.

,

- detekt.exceptions.ThrowingExceptionInMain [] 

> The main method should not throw an exception.

,

- detekt.exceptions.RethrowCaughtException [] 

> Do not rethrow a caught exception of the same type.

,

- detekt.exceptions.ThrowingNewInstanceOfSameException [] 

> Avoid catch blocks that rethrow a caught exception wrapped inside a new instance of the same exception.

,

- detekt.exceptions.SwallowedException [] 

> The caught exception is swallowed. The original exception could be lost.

,

- detekt.exceptions.ObjectExtendsThrowable [] 

> An `object` should not extend and type of Throwable. Throwables are stateful and should be instantiated only when needed for when a specific error occurs. An `object`, being a singleton, that extends any type of Throwable consequently introduces a global singleton exception whose instance may be inadvertently reused from multiple places, thus introducing shared mutable state.

,

- detekt.naming.MatchingDeclarationName [] 

> If a source file contains only a single non-private top-level class or object, the file name should reflect the case-sensitive name plus the .kt extension.

,

- detekt.naming.MemberNameEqualsClassName [] 

> A member should not be given the same name as its parent class or object.

,

- detekt.naming.InvalidPackageDeclaration [] 

> Kotlin source files should be stored in the directory corresponding to its package statement.

,

- detekt.naming.NoNameShadowing [] 

> Disallow shadowing variable declarations.

,

- detekt.naming.TopLevelPropertyNaming [] 

> Top level property names should follow the naming convention set in the projects configuration.

,

- detekt.naming.BooleanPropertyNaming [] 

> Boolean property name should follow the naming convention set in the projects configuration.

,

- detekt.naming.LambdaParameterNaming [] 

> Lambda parameter names should follow the naming convention set in the projects configuration.

,

- detekt.naming.ConstructorParameterNaming [] 

> Constructor parameter names should follow the naming convention set in the projects configuration.

,

- detekt.naming.ForbiddenClassName [] 

> Forbidden class name as per configuration detected.

,

- detekt.naming.ClassNaming [] 

> A class or object name should fit the naming pattern defined in the projects configuration.

,

- detekt.naming.PackageNaming [] 

> Package names should match the naming convention set in the configuration.

,

- detekt.naming.EnumNaming [] 

> Enum names should follow the naming convention set in the projects configuration.

,

- detekt.naming.ObjectPropertyNaming [] 

> Property names inside objects should follow the naming convention set in the projects configuration.

,

- detekt.naming.FunctionParameterNaming [] 

> Function parameter names should follow the naming convention set in the projects configuration.

,

- detekt.naming.FunctionNaming [] 

> Function names should follow the naming convention set in the configuration.

,

- detekt.naming.FunctionMinLength [] 

> Function names should not be shorter than the minimum defined in the configuration.

,

- detekt.naming.FunctionMaxLength [] 

> Function names should not be longer than the maximum set in the project configuration.

,

- detekt.naming.VariableMaxLength [] 

> Variable names should not be longer than the maximum set in the configuration.

,

- detekt.naming.VariableMinLength [] 

> Variable names should not be shorter than the minimum defined in the configuration.

,

- detekt.naming.VariableNaming [] 

> Variable names should follow the naming convention set in the projects configuration.

,

- detekt.naming.NonBooleanPropertyPrefixedWithIs [] 

> Only boolean property names can start with `is` prefix.

,

- detekt.performance.ForEachOnRange [] 

> Using the forEach method on ranges has a heavy performance cost. Prefer using simple for loops.

,

- detekt.performance.SpreadOperator [] 

> In most cases using a spread operator causes a full copy of the array to be created before calling a method. This may result in a performance penalty.

,

- detekt.performance.UnnecessaryTemporaryInstantiation [] 

> Avoid temporary objects when converting primitive types to `String`.

,

- detekt.performance.ArrayPrimitive [] 

> Using `Array<Primitive>` leads to implicit boxing and a performance hit.

,

- detekt.performance.CouldBeSequence [] 

> Several chained collection operations that should be a sequence.

,

- detekt.performance.UnnecessaryPartOfBinaryExpression [] 

> Detects duplicate condition into binary expression and recommends to remove unnecessary checks

,

- detekt.style.CanBeNonNullable [] 

> Variable can be changed to non-nullable, as it is never set to null.

,

- detekt.style.CascadingCallWrapping [] 

> If a chained call is wrapped to a new line, subsequent chained calls should be as well.

,

- detekt.style.ClassOrdering [] 

> Class contents should be in this order: Property declarations/initializer blocks; secondary constructors; method declarations then companion objects.

,

- detekt.style.CollapsibleIfStatements [] 

> Two if statements which could be collapsed were detected. These statements can be merged to improve readability.

,

- detekt.style.DestructuringDeclarationWithTooManyEntries [] 

> Too many entries in a destructuring declaration make the code hard to understand.

,

- detekt.style.ReturnCount [] 

> Restrict the number of return statements in methods.

,

- detekt.style.ThrowsCount [] 

> Restrict the number of throw statements in methods.

,

- detekt.style.TrimMultilineRawString [] 

> Multiline raw strings should be followed by `trimMargin()` or `trimIndent()`.

,

- detekt.style.NewLineAtEndOfFile [] 

> Checks whether files end with a line separator.

,

- detekt.style.WildcardImport [] 

> Wildcard imports should be replaced with imports using fully qualified class names. Wildcard imports can lead to naming conflicts. A library update can introduce naming clashes with your classes which results in compilation errors.

,

- detekt.style.MaxLineLength [] 

> Line detected, which is longer than the defined maximum line length in the code style.

,

- detekt.style.TrailingWhitespace [] 

> Whitespaces at the end of a line are unnecessary and can be removed.

,

- detekt.style.NoTabs [] 

> Checks if tabs are used in Kotlin files.

,

- detekt.style.EqualsOnSignatureLine [] 

> Equals signs for expression style functions should be on the same line as the signature.

,

- detekt.style.EqualsNullCall [] 

> Equals() method is called with null as parameter. Consider using == to compare to null.

,

- detekt.style.ForbiddenAnnotation [] 

> Avoid using this annotation.

,

- detekt.style.ForbiddenComment [] 

> Flags a forbidden comment.

,

- detekt.style.ForbiddenImport [] 

> Mark forbidden imports. A forbidden import could be an import for an unstable / experimental api and hence you might want to mark it as forbidden in order to get warned about the usage.

,

- detekt.style.ForbiddenMethodCall [] 

> Mark forbidden methods. A forbidden method could be an invocation of an unstable / experimental method and hence you might want to mark it as forbidden in order to get warned about the usage.

,

- detekt.style.ForbiddenSuppress [] 

> Suppressing a rule which is forbidden in current configuration.

,

- detekt.style.FunctionOnlyReturningConstant [] 

> A function that only returns a constant is misleading. Consider declaring a constant instead.

,

- detekt.style.SpacingBetweenPackageAndImports [] 

> Violation of the package declaration style detected.

,

- detekt.style.LoopWithTooManyJumpStatements [] 

> The loop contains more than one break or continue statement. The code should be refactored to increase readability.

,

- detekt.style.SafeCast [] 

> Prefer to use a safe cast instead of if-else-null.

,

- detekt.style.UnnecessaryAbstractClass [] 

> An abstract class is unnecessary. May be refactored to an interface or to a concrete class.

,

- detekt.style.UnnecessaryAnnotationUseSiteTarget [] 

> Unnecessary Annotation use-site Target. It can be removed.

,

- detekt.style.UnnecessaryParentheses [] 

> Unnecessary parentheses don't add any value to the code and should be removed.

,

- detekt.style.UnnecessaryInheritance [] 

> The extended super type is unnecessary.

,

- detekt.style.UnnecessaryInnerClass [] 

> The 'inner' qualifier is unnecessary.

,

- detekt.style.UtilityClassWithPublicConstructor [] 

> The class declaration is unnecessary because it only contains utility functions. An object declaration should be used instead.

,

- detekt.style.ObjectLiteralToLambda [] 

> Report object literals that can be changed to lambdas.

,

- detekt.style.OptionalAbstractKeyword [] 

> Unnecessary abstract modifier in interface detected. This abstract modifier is unnecessary and thus can be removed.

,

- detekt.style.OptionalWhenBraces [] 

> Optional braces in when expression detected.

,

- detekt.style.OptionalUnit [] 

> Return type of `Unit` is unnecessary and can be safely removed.

,

- detekt.style.ProtectedMemberInFinalClass [] 

> Member with protected visibility in final class is private. Consider using private or internal as modifier.

,

- detekt.style.SerialVersionUIDInSerializableClass [] 

> A class which implements the Serializable interface does not define a correct serialVersionUID field. The serialVersionUID field should be a private constant long value inside a companion object.

,

- detekt.style.MagicNumber [] 

> Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

,

- detekt.style.ModifierOrder [] 

> Modifiers are not in the correct order. Consider to reorder these modifiers.

,

- detekt.style.DataClassContainsFunctions [] 

> Data classes should mainly be used to store data and should not have any extra functions (Compiler will automatically generate equals, toString and hashCode functions).

,

- detekt.style.DataClassShouldBeImmutable [] 

> Data classes should mainly be immutable and should not have any side effects (To copy an object altering some of its properties use the copy function).

,

- detekt.style.UseDataClass [] 

> Classes that do nothing but hold data should be replaced with a data class.

,

- detekt.style.UnusedImports [] 

> Unused Imports are dead code and should be removed.

,

- detekt.style.UnusedParameter [] 

> Function parameter is unused and should be removed.

,

- detekt.style.UnusedPrivateClass [] 

> Private class is unused and should be removed.

,

- detekt.style.UnusedPrivateMember [] 

> Private function is unused and should be removed.

,

- detekt.style.UnusedPrivateProperty [] 

> Property is unused and should be removed.

,

- detekt.style.ExpressionBodySyntax [] 

> Functions with exact one statement, the return statement, can be rewritten with ExpressionBodySyntax.

,

- detekt.style.NestedClassesVisibility [] 

> The explicit public modifier still results in an internal nested class.

,

- detekt.style.RedundantVisibilityModifierRule [] 

> Redundant visibility modifiers detected, which can be safely removed.

,

- detekt.style.UntilInsteadOfRangeTo [] 

> A `..` call can be replaced with `until`.

,

- detekt.style.UnnecessaryApply [] 

> The `apply` usage is unnecessary and can be removed.

,

- detekt.style.UnnecessaryBracesAroundTrailingLambda [] 

> Braces around trailing lambda is unnecessary.

,

- detekt.style.UnnecessaryFilter [] 

> `filter()` with other collection operations may be simplified.

,

- detekt.style.UnnecessaryLet [] 

> The `let` usage is unnecessary.

,

- detekt.style.MayBeConst [] 

> Usage of `vals` that can be `const val` detected.

,

- detekt.style.PreferToOverPairSyntax [] 

> Pair was created using the Pair constructor, using the to syntax is preferred.

,

- detekt.style.BracesOnIfStatements [] 

> Braces do not comply with the specified policy

,

- detekt.style.BracesOnWhenStatements [] 

> Braces do not comply with the specified policy

,

- detekt.style.MandatoryBracesLoops [] 

> A multi-line loop was found that does not have braces. These should be added to improve readability.

,

- detekt.style.NullableBooleanCheck [] 

> Nullable boolean check should use `==` rather than `?:`

,

- detekt.style.VarCouldBeVal [] 

> Var declaration could be val.

,

- detekt.style.ForbiddenVoid [] 

> `Unit` should be used instead of `Void`.

,

- detekt.style.ExplicitItLambdaParameter [] 

> Declaring lambda parameters as `it` is redundant.

,

- detekt.style.ExplicitCollectionElementAccessMethod [] 

> Prefer usage of the indexed access operator [] for map element access or insert methods.

,

- detekt.style.UselessCallOnNotNull [] 

> This call on a non-null reference may be reduced or removed. Some calls are intended to be called on nullable collection or text types (e.g. `String?`).When this call is used on a reference to a non-null type (e.g. `String`) it is redundant and will have no effect, so it can be removed.

,

- detekt.style.UnderscoresInNumericLiterals [] 

> Report missing or invalid underscores in base 10 numbers. Numeric literals should be underscore separated to increase readability.

,

- detekt.style.UseRequire [] 

> Use require() instead of throwing an IllegalArgumentException.

,

- detekt.style.UseCheckOrError [] 

> Use check() or error() instead of throwing an IllegalStateException.

,

- detekt.style.UseIfInsteadOfWhen [] 

> Binary expressions are better expressed using an `if` expression than a `when` expression.

,

- detekt.style.RedundantExplicitType [] 

> Type does not need to be stated explicitly and can be removed.

,

- detekt.style.UseArrayLiteralsInAnnotations [] 

> Array literals [...] should be preferred as they are more readable than `arrayOf(...)` expressions.

,

- detekt.style.UseEmptyCounterpart [] 

> Instantiation of an object's "empty" state should use the object's "empty" initializer.

,

- detekt.style.UseCheckNotNull [] 

> Use checkNotNull() instead of check() for checking not-null.

,

- detekt.style.UseRequireNotNull [] 

> Use requireNotNull() instead of require() for checking not-null.

,

- detekt.style.RedundantHigherOrderMapUsage [] 

> Checks for redundant 'map' calls, which can be removed.

,

- detekt.style.UseIfEmptyOrIfBlank [] 

> Use `ifEmpty` or `ifBlank` instead of `isEmpty` or `isBlank` to assign a default value.

,

- detekt.style.MultilineLambdaItParameter [] 

> Multiline lambdas should not use `it` as a parameter name.

,

- detekt.style.MultilineRawStringIndentation [] 

> The indentation of the raw String should be consistent

,

- detekt.style.StringShouldBeRawString [] 

> The string can be converted to raw string.

,

- detekt.style.UseIsNullOrEmpty [] 

> Use `isNullOrEmpty()` call instead of `x == null || x.isEmpty()`.

,

- detekt.style.UseOrEmpty [] 

> Use `orEmpty()` call instead of `?:` with empty collection factory methods

,

- detekt.style.UseAnyOrNoneInsteadOfFind [] 

> Use `any` or `none` instead of `find` and `null` checks.

,

- detekt.style.UnnecessaryBackticks [] 

> Backticks are unnecessary.

,

- detekt.style.MaxChainedCallsOnSameLine [] 

> Chained calls beyond the maximum should be wrapped to a new line.

,

- detekt.style.AlsoCouldBeApply [] 

> When an `also` block contains only `it`-started expressions, simplify it to the `apply` block.

,

- detekt.style.UseSumOfInsteadOfFlatMapSize [] 

> Use `sumOf` instead of `flatMap` and `size/count` calls

,

- detekt.style.DoubleNegativeLambda [] 

> Double negative from a function name expressed in the negative (like `takeUnless`) with a lambda block that also contains negation. This is more readable when rewritten using a positive form of the function (like `takeIf`).

,

- detekt.style.UseLet [] 

> Use `?.let {}` instead of if/else with a null block when checking for nullable values

,

- detekt.formatting.AnnotationOnSeparateLine [] 

> Multiple annotations should be placed on separate lines. 

,

- detekt.formatting.AnnotationSpacing [] 

> There should not be empty lines between an annotation and the object that it's annotating

,

- detekt.formatting.ArgumentListWrapping [] 

> Reports incorrect argument list wrapping

,

- detekt.formatting.BlockCommentInitialStarAlignment [] 

> Detect the alignment of the initial star in a block comment.

,

- detekt.formatting.ChainWrapping [] 

> Checks if condition chaining is wrapped right

,

- detekt.formatting.ClassName [] 

> Class or object name should start with an uppercase letter and use camel case.

,

- detekt.formatting.CommentSpacing [] 

> Checks if comments have the right spacing

,

- detekt.formatting.CommentWrapping [] 

> Reports mis-indented code

,

- detekt.formatting.EnumEntryNameCase [] 

> Reports enum entries with names that don't meet standard conventions.

,

- detekt.formatting.Filename [] 

> Checks if top level class matches the filename

,

- detekt.formatting.FinalNewline [] 

> Detects missing final newlines

,

- detekt.formatting.FunctionName [] 

> Function name should start with a lowercase letter (except factory methods) and use camel case.

,

- detekt.formatting.FunKeywordSpacing [] 

> Checks the spacing after the fun keyword.

,

- detekt.formatting.FunctionReturnTypeSpacing [] 

> Checks the spacing between colon and return type.

,

- detekt.formatting.FunctionStartOfBodySpacing [] 

> Check for consistent spacing before start of function body.

,

- detekt.formatting.FunctionTypeReferenceSpacing [] 

> Checks the spacing before and after the angle brackets of a type argument list.

,

- detekt.formatting.ImportOrdering [] 

> Detects imports in non default order

,

- detekt.formatting.Indentation [] 

> Reports mis-indented code

,

- detekt.formatting.KdocWrapping [] 

> Reports mis-indented code

,

- detekt.formatting.MaximumLineLength [] 

> Reports lines with exceeded length

,

- detekt.formatting.ModifierListSpacing [] 

> Checks the spacing between the modifiers in and after the last modifier in a modifier list.

,

- detekt.formatting.ModifierOrdering [] 

> Detects modifiers in non default order

,

- detekt.formatting.MultiLineIfElse [] 

> Detects multiline if-else statements without braces

,

- detekt.formatting.NoBlankLineBeforeRbrace [] 

> Detects blank lines before rbraces

,

- detekt.formatting.NoBlankLinesInChainedMethodCalls [] 

> Detects blank lines in chained method rules.

,

- detekt.formatting.NoConsecutiveBlankLines [] 

> Reports consecutive blank lines

,

- detekt.formatting.NoEmptyClassBody [] 

> Reports empty class bodies

,

- detekt.formatting.NoEmptyFirstLineInMethodBlock [] 

> Reports methods that have an empty first line.

,

- detekt.formatting.NoLineBreakAfterElse [] 

> Reports line breaks after else

,

- detekt.formatting.NoLineBreakBeforeAssignment [] 

> Reports line breaks before assignment

,

- detekt.formatting.NoMultipleSpaces [] 

> Reports multiple space usages

,

- detekt.formatting.NoSemicolons [] 

> Detects semicolons

,

- detekt.formatting.NoTrailingSpaces [] 

> Detects trailing spaces

,

- detekt.formatting.NoUnitReturn [] 

> Detects optional 'Unit' return types

,

- detekt.formatting.NoUnusedImports [] 

> Detects unused imports

,

- detekt.formatting.NoWildcardImports [] 

> Detects wildcard imports

,

- detekt.formatting.NullableTypeSpacing [] 

> Ensure no spaces in nullable type.

,

- detekt.formatting.PackageName [] 

> Checks package name is formatted correctly

,

- detekt.formatting.ParameterListWrapping [] 

> Detects mis-aligned parameter lists

,

- detekt.formatting.ParameterWrapping [] 

> Type or value of functions and class parameters must wrap if parameters don't fit on a single line

,

- detekt.formatting.PropertyName [] 

> Reports incorrect property name.

,

- detekt.formatting.PropertyWrapping [] 

> Type or value of properties must wrap if parameters don't fit on a single line

,

- detekt.formatting.SpacingAroundAngleBrackets [] 

> Reports spaces around angle brackets

,

- detekt.formatting.SpacingAroundColon [] 

> Reports spaces around colons

,

- detekt.formatting.SpacingAroundComma [] 

> Reports spaces around commas

,

- detekt.formatting.SpacingAroundCurly [] 

> Reports spaces around curly braces

,

- detekt.formatting.SpacingAroundDot [] 

> Reports spaces around member invocation operator (dot).

,

- detekt.formatting.SpacingAroundDoubleColon [] 

> Reports spaces around double colons

,

- detekt.formatting.SpacingAroundKeyword [] 

> Reports spaces around keywords

,

- detekt.formatting.SpacingAroundOperators [] 

> Reports spaces around operators

,

- detekt.formatting.SpacingAroundParens [] 

> Reports spaces around parentheses

,

- detekt.formatting.SpacingAroundRangeOperator [] 

> Reports spaces around range operator

,

- detekt.formatting.SpacingAroundUnaryOperator [] 

> Reports spaces around unary operator

,

- detekt.formatting.SpacingBetweenDeclarationsWithAnnotations [] 

> Declarations and declarations with annotations should have an empty space between.

,

- detekt.formatting.SpacingBetweenDeclarationsWithComments [] 

> Declarations and declarations with comments should have an empty space between.

,

- detekt.formatting.SpacingBetweenFunctionNameAndOpeningParenthesis [] 

> Ensure consistent spacing between function name and opening parenthesis.

,

- detekt.formatting.StringTemplate [] 

> Detects simplifications in template strings

,

- detekt.formatting.TrailingCommaOnCallSite [] 

> Rule to mandate/forbid trailing commas at call sites

,

- detekt.formatting.TrailingCommaOnDeclarationSite [] 

> Rule to mandate/forbid trailing commas at declaration sites

,

- detekt.formatting.UnnecessaryParenthesesBeforeTrailingLambda [] 

> Ensures there are no unnecessary parentheses before a trailing lambda

,

- detekt.formatting.Wrapping [] 

> Reports missing newlines (e.g. between parentheses of a multi-line function call

,

- detekt.formatting.ContextReceiverMapping [] 

> Reports mis-indented code

,

- detekt.formatting.DiscouragedCommentLocation [] 

> Detect discouraged comment locations.

,

- detekt.formatting.EnumWrapping [] 

> An enum should be a single line, or each enum entry has to be placed on a separate line.

,

- detekt.formatting.FunctionSignature [] 

> Format signature to be single when possible, multiple lines otherwise.

,

- detekt.formatting.IfElseBracing [] 

> All branches must be wrapped in curly braces if any branches are wrapped.

,

- detekt.formatting.IfElseWrapping [] 

> A single line if-statement may contain no more than one else-branch.

,

- detekt.formatting.MultilineExpressionWrapping [] 

> Multiline expression on the right hand side of an expression must start on a separate line.

,

- detekt.formatting.NoBlankLineInList [] 

> Disallow blank lines in lists before, between or after any list element.

,

- detekt.formatting.NoConsecutiveComments [] 

> Disallow consecutive comments in most cases.

,

- detekt.formatting.NoEmptyFirstLineInClassBody [] 

> Disallow blank lines at start of a class body.

,

- detekt.formatting.NoSingleLineBlockComment [] 

> Reports single block line comments

,

- detekt.formatting.ParameterListSpacing [] 

> Ensure consistent spacing inside the parameter list.

,

- detekt.formatting.StringTemplateIndent [] 

> Enforce consistent multiline string template indentation which are post-fixed with .trimIndent()

,

- detekt.formatting.TryCatchFinallySpacing [] 

> Enforce consistent spacing in try-catch-finally blocks.

,

- detekt.formatting.TypeArgumentListSpacing [] 

> Reports spaces in the type reference before a function.

,

- detekt.formatting.TypeParameterListSpacing [] 

> Check spacing after a type parameter list in function and class declarations.

,

- detekt.compiler.CompilerInfo [] 

> Reports the info raised by the compiler

,

- detekt.compiler.CompilerWarning [] 

> Reports the warnings raised by the compiler

,

- detekt.Compose.ComposableAnnotationNaming [] 

> Composable annotations (e.g. tagged with `@ComposableTargetMarker`) should have the `Composable` suffix.

See https://mrmans0n.github.io/compose-rules/rules/#naming-composable-annotations-properly for more information.
,

- detekt.Compose.CompositionLocalAllowlist [] 

> CompositionLocals are implicit dependencies and creating new ones should be avoided.

See https://mrmans0n.github.io/compose-rules/rules/#compositionlocals for more information.
,

- detekt.Compose.CompositionLocalNaming [] 

> CompositionLocals should be named using the `Local` prefix as an adjective, followed by a descriptive noun.

See https://mrmans0n.github.io/compose-rules/rules/#naming-compositionlocals-properly for more information.
,

- detekt.Compose.ContentEmitterReturningValues [] 

> Composable functions should either emit content into the composition or return a value, but not both.

If a composable should offer additional control surfaces to its caller, those control surfaces or callbacks should be provided as parameters to the composable function by the caller.
See https://mrmans0n.github.io/compose-rules/rules/#do-not-emit-content-and-return-a-result for more information.
,

- detekt.Compose.ContentSlotReused [] 

> Content slots should not be reused in different code branches/scopes of a composable function, to preserve the slot internal state.

You can wrap the slot in a remember { movableContentOf { ... }} block to make sure their internal state is preserved correctly.
See https://mrmans0n.github.io/compose-rules/rules/#content-slots-should-not-be-reused-in-branching-code for more information.
,

- detekt.Compose.ContentTrailingLambda [] 

> A @Composable `content` parameter should be moved to be the trailing lambda in a composable function.

See https://mrmans0n.github.io/compose-rules/rules/#slots-for-main-content-should-be-the-trailing-lambda for more information.
,

- detekt.Compose.DefaultsVisibility [] 

> @Composable `Defaults` objects should match visibility of the composables they serve.

,

- detekt.Compose.LambdaParameterEventTrailing [] 

> Lambda parameters in a @Composable that are for events (e.g. onClick, onChange, etc) and are required (they don't have a default value) should not be used as the trailing parameter.

Composable functions that emit content usually reserve the trailing lambda syntax for the content slot, and that can lead to an assumption that other composables can be used in that lambda.
See https://mrmans0n.github.io/compose-rules/rules/#avoid-using-the-trailing-lambda-for-event-lambdas-in-ui-composables for more information.
,

- detekt.Compose.LambdaParameterInRestartableEffect [] 

> Lambda parameters in a @Composable that are referenced directly inside of restarting effects can cause issues or unpredictable behavior.

If restarting the effect is ok, you can add the reference to this parameter as a key in that effect, so when the parameter changes, a new effect is created.
However, if the effect is not to be restarted, you will need to use rememberUpdatedState on the parameter and use its result in the effect.
See https://mrmans0n.github.io/compose-rules/rules/#be-mindful-of-the-arguments-you-use-inside-of-a-restarting-effect for more information.
,

- detekt.Compose.Material2 [] 

> Compose Material 2 is disallowed by your configuration.

See https://mrmans0n.github.io/compose-rules/rules/#dont-use-material-2 for more information.
,

- detekt.Compose.ModifierClickableOrder [] 

> This order of modifiers is likely to cause visual issues. You should have your clickable modifiers after modifiers that use shapes, so that the clickable selected area takes into account the change in shape as well.

See https://mrmans0n.github.io/compose-rules/rules/#modifier-order-matters for more information.
,

- detekt.Compose.ModifierComposed [] 

> Using composed for modifiers is not recommended anymore, due to the performance issues it creates.

You should consider migrating this modifier to be based on Modifier.Node instead.
See https://mrmans0n.github.io/compose-rules/rules/#avoid-modifier-extension-factory-functions for more information.
,

- detekt.Compose.ModifierMissing [] 

> This @Composable function emits content but doesn't have a modifier parameter.

See https://mrmans0n.github.io/compose-rules/rules/#when-should-i-expose-modifier-parameters for more information.
,

- detekt.Compose.ModifierNaming [] 

> Modifier parameters should be called `modifier`.

See https://mrmans0n.github.io/compose-rules/rules/#naming-modifiers-properly for more information.
,

- detekt.Compose.ModifierNotUsedAtRoot [] 

> The main Modifier of a @Composable should be applied once as a first modifier in the chain to the root-most layout in the component implementation.

You should move the modifier usage to the appropriate parent Composable.
See https://mrmans0n.github.io/compose-rules/rules/#modifiers-should-be-used-at-the-top-most-layout-of-the-component for more information.
,

- detekt.Compose.ModifierReused [] 

> Modifiers should only be used once and by the root level layout of a Composable. This is true even if appended to or with other modifiers e.g. 'modifier.fillMaxWidth()'.

Use Modifier (with a capital 'M') to construct a new Modifier that you can pass to other composables.
See https://mrmans0n.github.io/compose-rules/rules/#dont-re-use-modifiers for more information.
,

- detekt.Compose.ModifierWithoutDefault [] 

> This @Composable function has a modifier parameter but it doesn't have a default value.

See https://mrmans0n.github.io/compose-rules/rules/#modifiers-should-have-default-parameters for more information.
,

- detekt.Compose.MultipleEmitters [] 

> Composable functions should only be emitting content into the composition from one source at their top level.

See https://mrmans0n.github.io/compose-rules/rules/#do-not-emit-multiple-pieces-of-content for more information.
,

- detekt.Compose.MutableParams [] 

> Using mutable objects as state in Compose will cause your users to see incorrect or stale data in your app.

Mutable objects that are not observable, such as ArrayList or a mutable data class, cannot be observed by Compose to trigger recomposition when they change.
See https://mrmans0n.github.io/compose-rules/rules/#do-not-use-inherently-mutable-types-as-parameters for more information.
,

- detekt.Compose.MutableStateAutoboxing [] 

> Using mutableInt/Long/Double/FloatStateOf is recommended over mutableStateOf<X> for Int/Long/Double/Float, as it uses the primitives directly which is more performant.

,

- detekt.Compose.MutableStateParam [] 

> MutableState shouldn't be used as a parameter in a @Composable function, as it promotes joint ownership over a state between a component and its user.

If possible, consider making the component stateless and concede the state change to the caller. If mutation of the parent’s owned property is required in the component, consider creating a ComponentState class with the domain specific meaningful field that is backed by mutableStateOf().
See https://mrmans0n.github.io/compose-rules/rules/#do-not-use-mutablestate-as-a-parameter for more information.
,

- detekt.Compose.ComposableNaming [] 

> Composable functions that return Unit should start with an uppercase letter. They are considered declarative entities that can be either present or absent in a composition and therefore follow the naming rules for classes.

However, Composable functions that return a value should start with a lowercase letter instead. They should follow the standard Kotlin Coding Conventions for the naming of functions for any function annotated @composable that returns a value other than Unit
,

- detekt.Compose.ParameterNaming [] 

> Lambda parameters in a composable function should be in present tense, not past tense.

Examples: onClick and not onClicked, onTextChange and not onTextChanged, etc.
,

- detekt.Compose.ComposableParamOrder [] 

> Parameters in a composable function should be ordered following this pattern: params without defaults, modifiers, params with defaults and optionally, a trailing function that might not have a default param.

,

- detekt.Compose.PreviewAnnotationNaming [] 

> Multipreview annotations should begin with the `Preview` suffix

,

- detekt.Compose.PreviewNaming [] 

> Enforces a cohesive naming strategy for preview @Composable functions.

,

- detekt.Compose.PreviewPublic [] 

> Composables annotated with @Preview that are used only for previewing the UI should not be public.

See https://mrmans0n.github.io/compose-rules/rules/#preview-composables-should-not-be-public for more information.
,

- detekt.Compose.RememberContentMissing [] 

> Using movableContentOf/movableContentWithReceiverOf in a @Composable function without it being remembered can cause visual problems, as the content would be recycled when detached from the composition.

,

- detekt.Compose.RememberMissing [] 

> Using mutableStateOf/derivedStateOf in a @Composable function without it being inside of a remember function.

If you don't remember the state instance, a new state instance will be created when the function is recomposed.
,

- detekt.Compose.UnstableCollections [] 

> The Compose Compiler cannot infer the stability of a parameter if a List/Set/Map is used in it, even if the item type is stable.

You should use Kotlinx Immutable Collections instead, or create an @Immutable wrapper for this class.

See https://mrmans0n.github.io/compose-rules/rules/#avoid-using-unstable-collections for more information.
,

- detekt.Compose.ViewModelForwarding [] 

> Forwarding a ViewModel/Presenter through multiple @Composable functions should be avoided. Consider using state hoisting.

See https://mrmans0n.github.io/compose-rules/rules/#hoist-all-the-things for more information.
,

- detekt.Compose.ViewModelInjection [] 

> Implicit dependencies of composables should be made explicit.

Acquiring a ViewModel should be done in composable default parameters, so that it is more testable and flexible.
,

- detekt.kotlinovanavigation.NavigationKeyNoEnums [] 

> Navigation keys should not contain any enums due to hashcode non-determinism. See https://github.com/Zhuinden/simple-stack-compose-integration/issues/29.

Tool information

  • Name: detekt
  • Organization: detekt
  • Version: 1.23.8

@matejdro matejdro closed this Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants