mirror of
https://github.com/github/codeql.git
synced 2026-03-31 12:48:17 +02:00
20 lines
592 B
Plaintext
20 lines
592 B
Plaintext
/**
|
|
* @name Unused index variable
|
|
* @description Iterating over an array but not using the index variable to access array elements
|
|
* may indicate a typo or logic error.
|
|
* @kind problem
|
|
* @problem.severity warning
|
|
* @id js/unused-index-variable
|
|
* @precision high
|
|
* @tags quality
|
|
* reliability
|
|
* correctness
|
|
*/
|
|
|
|
import javascript
|
|
import LanguageFeatures.UnusedIndexVariable
|
|
|
|
from RelationalComparison rel, Variable idx, Variable v
|
|
where unusedIndexVariable(rel, idx, v)
|
|
select rel, "Index variable " + idx + " is never used to access elements of " + v + "."
|