CodeQL library for JavaScript/TypeScript
codeql/javascript-all 0.8.9 (changelog, source)
Search

Module UnusedIndexVariable

Provides a predicate for identifying unused index variables in loops.

Import path

import LanguageFeatures.UnusedIndexVariable

Imports

javascript

Provides classes for working with JavaScript programs, as well as JSON, YAML and HTML.

Predicates

unusedIndexVariable

Holds if rel is a for-loop condition of the form idx <= v.length, but all array indices v[c] inside the loop body (of which there must be at least one) use a constant index c instead of an index based on idx.