Query module DuplicateCondition

name
Duplicate ‘if’ condition
description
If two conditions in an ‘if’-‘else if’ chain are identical, the second condition will never hold.
kind
problem
problem.severity
warning
id
js/duplicate-condition
tags
maintainability correctness external/cwe/cwe-561
precision
very-high

Imports

Clones

Provides predicates for detecting pairs of identical AST subtrees.

Predicates

getCondition

Gets the ith condition in the if-else if chain starting at stmt.

Classes

DuplicateIfCondition

A detector for duplicated if conditions in the same if-else if chain.