Archive
Software Resiliency
-
The code contains too many jump instructions that derive the control flow out of a finally structure
Using return, break, throw, and continue from a finally block overwrites similar statements from the suspended try and catch blocks.
-
The code contains classes that overload equals(Object)
βequalsβ as a method name should be used exclusively to override Object.equals(Object) to prevent any confusion. It is tempting to overload the method to…
-
Avoid equality in loop termination condition
Testing for loop termination using an equality operator (== and !=) is dangerous, because it could set up an infinite loop. Using a broader…
-
Avoid variable assignments in conditional expressions
This pattern verifies the presence of variable assignments in conditional (IF) expressions. It is generally not recommended to use the assignment operator in this…
-
Avoid using ellipsis in functions
Functions should not be defined with a variable number of arguments. Varargs methods are a convenient way to define methods that require a variable…
-
The code contains use of getClass().getName()
It could be necessary to check whether a given object has a specific class type or whether two objects have the same class type…
-
Avoid unconditional jump statement
Having an unconditional break, return or throw in a loop renders it useless; the loop will only execute once and the loop structure itself…
-
Avoid octal values
Integer literals starting with a zero are octal rather than decimal values. While using octal values is fully supported, most developers do not have…
-
The code contains too many throws to system exceptions
The code contains too many thows to system exceptions (java.lang.Error, java.lang.RuntimeException). Application should have their own error exception classes. Throwing generic exception force callers…
-
The code contains too many queries leading to a high number of table columns
Complex select clauses, i.e select clauses with many column can be difficult to read and does not help the reader who needs to identify…