Alex Thottunkel
- Total activity 2325
- Last activity
- Member since
- Following 0 users
- Followed by 0 users
- Votes 1
- Subscriptions 1186
Articles
Recent activity by Alex Thottunkel Sort by recent activity-
Avoid self-assigned variables
Why you should care There is no reason to re-assign a variable to itself. Either this statement is redundant and should be removed, or the re-assignment is a mistake and some other value or variab...
-
Avoid binary operators with identical members
Why you should care Using the same value on either side of a binary operator is almost always a mistake. In the case of logical operators, it is either a copy/paste error and therefore a bug, or i...
-
Avoid 'if/else if' & cases statements having the same condition
Why you should care A chain of if/else if statements is evaluated from top to bottom. At most, only one branch will be executed: the first one with a condition that evaluates to true. Therefore, ...
-
Avoid dead code
Why you should care Dead code are instructions that can never be reached. Obvious dead code are instructions that follow unconditional jumps in the same statement block. Dead code could just be d...
-
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...