Archive
Software Resiliency
-
Avoid βif … else ifβ constructs with missing final βelseβ clauses
This rule applies whenever an if statement is followed by one or more else if statements; the final else if should be followed by…
-
The code contains one or more “with” instructions
The with statement in javascript inserts an object at the front scope chain, so any property/variable references will first try to be resolved against…
-
The code contains inner functions
While most script engines support Function Declarations within blocks it is not part of ECMAScript (see ECMA-262, clause 13 and 14). Worse implementations are…
-
The code contains at least one class defining a destructor
For several reasons detailed in references, using finalizers is not recommended.
-
The code contains too many switch cases with missing ending breaks
Ending switch branches with βbreaksβ helps the code be more consistent, functional, and easier to debug. This allows developers in different teams navigate the…
-
The code contains modifications of buildtins objects : Object, Array or Function
Modifying builtins like Object.prototype and Array.prototype are strictly forbidden. Modifying other builtins like Function.prototype is less dangerous but still leads to hard to debug…
-
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…
-
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…