Archive
Product
-
Avoid protected member in final classes
The difference between private and protected visibility is that child classes can see and use protected members, but they cannot see private ones. Since…
-
Avoid loop counter modification
Loop counters shall not be modified in the body of the loop. However other loop control variables representing logical values may be modified in…
-
Avoid Equals methods not testing their parameters
Because the equals method takes a generic Object as a parameter, any type of object may be passed to it. The method should not…
-
Avoid catches that only rethrow
catch clause that only rethrows the caught exception has the same effect as omitting the catch altogether and letting it bubble up automatically, but…
-
Avoid nested try-catch blocks
Although this is sometimes unavailable, nesting try/catch blocks severely impacts the readability of the source code as it makes it difficult to understand which…
-
Avoid long case statements
The switch statement should be used only to clearly define some new branches in the control flow. As soon as a case clause contains…
-
The code contains non-wrapped immediate function calls
When a function is to be invoked immediately, the entire invocation expression should be wrapped in parents. Wrapping an immediate function invocation in parentheses…
-
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…