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
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
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
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
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
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: Efficiency
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
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
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
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
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