Files
codeql/javascript/ql/src/Declarations/ArgumentsRedefined.ql
2019-01-07 10:15:45 +00:00

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."