Query module CompareIdenticalValues

name
Comparison of identical values
description
If the same expression occurs on both sides of a comparison operator, the operator is redundant, and probably indicates a mistake.
kind
problem
problem.severity
warning
id
js/comparison-of-identical-expressions
tags
reliability correctness readability convention external/cwe/cwe-570 external/cwe/cwe-571
precision
medium

Imports

Clones

Provides predicates for detecting pairs of identical AST subtrees.

Predicates

accessWithConversions

Holds if e is a reference to variable v, possibly with parentheses or numeric conversions (that is, the unary operators + or - or a call to Number) applied.

isNaNCheck

Holds if the equality test eq looks like a NaN check.

isNaNComment

A comment containing the word “NaN”.