detekt.ArrayPrimitive
Using Array<Primitive> leads to implicit boxing and a performance hit
Codiga provides multiple sets of rules for 12+ languages. Below we provide a link and a description for all the rules supported by our platform. Note that not all the rules are being listed and described below.
Using Array<Primitive> leads to implicit boxing and a performance hit
Class and Object names should match the pattern: [A-Z][a-zA-Z0-9]*
Condition is too complex
Function too complex.
Constructor private parameter names should match the pattern: [a-z][A-Za-z0-9]*
When expression has multiple case statements for the same value
Empty catch block detected. If the exception can be safely ignored
The class or object Attempts is empty.
An empty default constructor can be removed.
Detect empty files
This when block is empty.
This empty block of code can be removed.
Enum entry names should match the pattern: [A-Z][\_a-zA-Z0-9]*
An explicit call to the Garbage Collector as in System should not be made.
This comment contains text that has been defined as forbidden in detekt.
Using the forEach method on ranges has a heavy performance cost. Prefer using simple for loops.
Function names should match the pattern: ([a-z][a-zA-Z0-9]*)|(`.*`)
Function is returning a constant. Prefer declaring a constant instead.
Function parameter names should match the pattern: [a-z][A-Za-z0-9]*
This implementation of Iterator does not correctly implement the next() method as it doesn't throw a NoSuchElementException when no elements remain in the Iterator.
Detect classes that are too large
Function is too long
Too many parameters
Too many jump statements
Replace magic numbers with a constant
The file name 'does not match the name of the single top-level declaration
Line is too long
Refactor into a const
Name confusion
Incorrect modifier order
Function nested too deeply.
Object constant names should match the pattern: [A-Za-z][\_A-Za-z0-9]*
The abstract keyword on this declaration is unnecessary.
Package name should match the pattern: [a-z]+(\\.[a-z][A-Za-z0-9]*)*
Member with protected visibility in final class is private. Consider using private or internal as modifier.
Function has 3 return statements which exceeds the limit of 2.
In most cases using a spread operator causes a full copy of the array to be created before calling a method which has a very high performance penalty.
Too many throw statements in function.
Caught exception is too generic. Prefer catching specific exceptions to the case that is currently handled.
Throwable is a too generic Exception. Prefer throwing specific exceptions that indicate a specific error case.
Too many functions in object
Top level constant names should match the pattern: [A-Z][\_A-Z0-9]*
An abstract class without a concrete member can be refactored to an interface.
This expression is followed by unreachable code which should either be used or removed.
The class only contains utility functions. Consider defining it as an object.
Private variable names should match the pattern: (\_)?[a-z][A-Za-z0-9]*
Use qualified import
Empty block of code can be removed.
Empty function block can be removed
Empty if block can be removed
Empty secondary constructor can be removed
A class should always override hashCode when overriding equals and the other way around.
Reports empty init expressions. Empty blocks of code serve no purpose and should be removed.
String.format() uses implicitly default locale for string formatting.
This method is not expected to throw exceptions. This can cause weird behavior.
Function parameter is unused
Instead of simply printing a stacktrace a better logging solution should be used.
Classes which implement the Serializable interface should also correctly declare a serialVersionUID
Exceptions should not be swallowed.
Exceptions should always call one of the constructor overloads to provide a message or a cause.
Equals methods should always report if some other object is equal to the current object