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
error
precision
very-high
id
java/comparison-of-identical-expressions
tags
reliability correctness logic

Imports

java

Provides all default Java QL imports.

Predicates

comparison
equal

Are left and right structurally equal?

sameVariable

Are left and right accesses to v on the same object?

specialCase
toCompare

Are left and right in syntactic positions where we might want to compare them for structural equality?

varsToCompare