Query module RedundantExpression

name
Identical operands
description
Passing identical, or seemingly identical, operands to an operator such as subtraction or conjunction may indicate a typo; even if it is intentional, it makes the code hard to read.
kind
problem
problem.severity
warning
id
js/redundant-operation
tags
reliability correctness external/cwe/cwe-480 external/cwe/cwe-561
precision
very-high

Imports

Clones

Provides predicates for detecting pairs of identical AST subtrees.

Classes

AverageExpr

An expression of the form (e + f)/2.

IdemnecantExpr

A binary expression whose operator is idemnecant.

RedundantAverageOperand

A clone detector for redundant expressions of the form (e + e)/2.

RedundantIdemnecantOperand

A clone detector for idemnecant operators.

RedundantIdempotentOperand

A clone detector for idempotent expressions.

RedundantOperand

A clone detector that finds redundant expressions.