mirror of
https://github.com/github/codeql.git
synced 2025-12-26 05:36:32 +01:00
24 lines
664 B
Plaintext
24 lines
664 B
Plaintext
/**
|
|
* @name Arguments redefined
|
|
* @description The special 'arguments' variable can be redefined, but this should be avoided
|
|
* since it makes code hard to read and maintain and may prevent compiler
|
|
* optimizations.
|
|
* @kind problem
|
|
* @problem.severity recommendation
|
|
* @id js/arguments-redefinition
|
|
* @tags efficiency
|
|
* maintainability
|
|
* @precision very-high
|
|
*/
|
|
|
|
import javascript
|
|
import Definitions
|
|
|
|
from VarRef d
|
|
where
|
|
d.getVariable().(LocalVariable).getName() = "arguments" and
|
|
(d instanceof LValue or d instanceof VarDecl) and
|
|
not d.isAmbient() and
|
|
not d.inExternsFile()
|
|
select d, "Redefinition of arguments."
|