Alex Thottunkel
- Total activity 2329
- Last activity
- Member since
- Following 0 users
- Followed by 0 users
- Votes 1
- Subscriptions 1176
Articles
Recent activity by Alex Thottunkel Sort by recent activity-
Avoid ‘if ... else if’ constructs with missing final ‘else’ clauses
Why you should care This rule applies whenever an if statement is followed by one or more else if statements; the final else if should be followed by an else statement. The requirement for a fina...
-
Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression
Why you should care The use of increment and decrement operators in method calls or in combination with other arithmetic operators is not recommended, because: It can significantly impair the r...
-
'switch' statements should not be nested
Why you should care Nested switch structures are difficult to understand because you can easily confuse the cases of an inner switch as belonging to an outer statement. Therefore nested switch sta...
-
Avoid collapsible nested 'if'
Why you should care Merging collapsible if statements increases the code's readability. How we detect CAST Highlight counts one occurrence each time several nested 'if', having each one no 'else'...
-
The code contains one or more "with" instructions
Why you should care 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 object. This is often...
-
The code contains inner functions
Why you should care 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 inconsistent with...
-
The code contains at least one class defining a destructor
Why you should care For several reasons detailed in references, using finalizers is not recommended: The finalization is not determined. You don't know when the finalizer will be called Due t...
-
The code contains too many switch cases with missing ending breaks
Why you should care Ending switch branches with ‘breaks’ helps the code be more consistent, functional, and easier to debug. This allows developers in different teams navigate the code easier and ...
-
The code contains modifications of buildtins objects : Object, Array or Function
Why you should care 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 ...
-
Avoid using ellipsis in functions
Why you should care Functions should not be defined with a variable number of arguments. Varargs methods are a convenient way to define methods that require a variable number of arguments, but the...