Potentially confusing code constructs
- Confusing floating point literal
Reports any floating point number that does not have a decimal point, or any numbers before the decimal point, or and numbers after the decimal point.
- Confusing sequence of '+' or '-'
Reports a suspicious combination of + or - characters in JavaScript code (for example, a+++b.
- Execution of dynamically generated code
Reports a call of the eval(), setTimeout(), or setInterval() function or an allocation of a Function object.
- Magic number
Reports a "magic number" that is a numeric literal used without being named by a constant declaration.
- Negated 'if' statement
Reports if statements which have an else branch and a negated condition.
- Negated conditional expression
Reports a conditional expression whose condition is negated.
- Nested conditional expression
Reports a ternary conditional expression within another ternary condition.
- Nested function
Reports a function nested inside another function.
- Overly complex arithmetic expression
Reports an arithmetic expression with too many terms.
- Overly complex boolean expression
Reports a boolean expression with too many terms.
- Pointless arithmetic expression
Reports an arithmetic expression that include adding or subtracting zero, multiplying by zero or one, division by one, and shift by zero.
- Result of increment or decrement used
Reports an increment (++) or decrement (--) expression where the result of the assignment is used in a containing expression.
- Statement with empty body
Reports an if, while, for, or with statement with an empty body.
- Unnecessary block statement
Reports a block statement that is not used as the body of if, for, while, do, with, or try statements, or as the body of a function declaration.
- Use of 'caller' property
Reports a usage of the caller property in a JavaScript function.