Files
codeql/javascript/ql/src/Expressions/ExprHasNoEffect.ql
Erik Krogh Kristensen 2e0244cda6 address review feedback
2019-10-21 20:32:45 +02:00

23 lines
570 B
Plaintext

/**
* @name Expression has no effect
* @description An expression that has no effect and is used in a void context is most
* likely redundant and may indicate a bug.
* @kind problem
* @problem.severity warning
* @id js/useless-expression
* @tags maintainability
* correctness
* external/cwe/cwe-480
* external/cwe/cwe-561
* @precision very-high
*/
import javascript
import ExprHasNoEffect
import semmle.javascript.RestrictedLocations
from Expr e
where hasNoEffect(e)
select e.(FirstLineOf), "This expression has no effect."