Files
codeql/javascript/ql/src/Declarations/ArgumentsRedefined.ql
2018-08-02 17:53:23 +01:00

22 lines
673 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."