Inspectopedia Help

Potentially confusing code constructs

Confusing floating point literal   New in this release

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 '-'   New in this release

Reports a suspicious combination of + or - characters in JavaScript code (for example, a+++b.

Execution of dynamically generated code   New in this release

Reports a call of the eval(), setTimeout(), or setInterval() function or an allocation of a Function object.

Magic number   New in this release

Reports a "magic number" that is a numeric literal used without being named by a constant declaration.

Negated 'if' statement   New in this release

Reports if statements which have an else branch and a negated condition.

Negated conditional expression   New in this release

Reports a conditional expression whose condition is negated.

Nested conditional expression   New in this release

Reports a ternary conditional expression within another ternary condition.

Nested function   New in this release

Reports a function nested inside another function.

Overly complex arithmetic expression   New in this release

Reports an arithmetic expression with too many terms.

Overly complex boolean expression   New in this release

Reports a boolean expression with too many terms.

Pointless arithmetic expression   New in this release

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   New in this release

Reports an increment (++) or decrement (--) expression where the result of the assignment is used in a containing expression.

Statement with empty body   New in this release

Reports an if, while, for, or with statement with an empty body.

Unnecessary block statement   New in this release

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   New in this release

Reports a usage of the caller property in a JavaScript function.

Last modified: 11 September 2024