Rule Description KPI url
InstanceOfCheckForException This rule reports catch blocks which check for the type of an exception via is checks or casts. Instead of catching generic exception types and then checking for specific exception types the code should use multiple catch blocks. These catch blocks should then catch the specific exceptions. Robustness https://arturbosch.github.io/detekt/exceptions.html#instanceofcheckforexception
IteratorHasNextCallsNextMethod Verifies implementations of the Iterator interface. The hasNext() method of an Iterator implementation should not have any side effects. This rule reports implementations that call the next() method of the Iterator inside the hasNext() method. Robustness https://arturbosch.github.io/detekt/potential-bugs.html#iteratorhasnextcallsnextmethod
NestedClassesVisibility Nested classes are often used to implement functionality local to the class it is nested in. Therefore it should not be public to other parts of the code. Prefer keeping nested classes private. Security https://arturbosch.github.io/detekt/style.html#nestedclassesvisibility
PrintStackTrace This rule reports code that tries to print the stacktrace of an exception. Instead of simply printing a stacktrace a better logging solution should be used. Security https://arturbosch.github.io/detekt/exceptions.html#printstacktrace
RethrowCaughtException This rule reports all exceptions that are caught and then later re-thrown without modification. It ignores caught exception that are rethrown if there is work done before that. Robustness https://arturbosch.github.io/detekt/exceptions.html#rethrowcaughtexception
SpreadOperator Using a spread operator causes a full copy of the array to be created before calling a method. This has a very high performance penalty. Benchmarks showing this performance penalty can be seen here: https://sites.google.com/a/athaydes.com/renato-athaydes/posts/kotlinshiddencosts-benchmarks Efficiency https://arturbosch.github.io/detekt/performance.html#spreadoperator
SwallowedException Exceptions should not be swallowed. This rule reports all instances where exceptions are caught and not correctly passed into a newly thrown exception. Analyzability https://arturbosch.github.io/detekt/exceptions.html#swallowedexception
ThrowingExceptionFromFinally This rule reports all cases where exceptions are thrown from a finally block. Throwing exceptions from a finally block should be avoided as it can lead to confusion and discarded exceptions. Maintainability https://arturbosch.github.io/detekt/exceptions.html#throwingexceptionfromfinally
ThrowingExceptionInMain This rule reports all exceptions that are thrown in a main method. An exception should only be thrown if it can be handled by a higher function. Robustness https://arturbosch.github.io/detekt/exceptions.html#throwingexceptioninmain
TooGenericExceptionThrown This rule reports thrown exceptions that have a type that is too generic. It should be preferred to throw specific exceptions to the case that has currently occurred. Robustness https://arturbosch.github.io/detekt/exceptions.html#toogenericexceptionthrown
UnreachableCode Reports unreachable code. Code can be unreachable because it is behind return, throw, continue or break expressions. This unreachable code should be removed as it serves no purpose. Robustness https://arturbosch.github.io/detekt/potential-bugs.html#unreachablecode