Archive
Code Insights
-
The code contains too many var statements declaring several variables in it
Although JavaScript allows to declare multiple variables in a single chain, it is recommended to declare each variable separately as it is easier to…
-
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.
-
Avoid small switch/Case
SWITCH statements are useful when there are many different cases depending on the value of the same expression. However, code will me more readable…
-
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…
-
The code contains too many negative comparisons
This pattern verifies the presence in source code of negative comparisons. Depending on the frequency, CAST Highlight will trigger this code insight.
-
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…