CodeQL library for JavaScript/TypeScript
codeql/javascript-all 0.8.13 (changelog, source)
Search

Predicate noSideEffects

Holds if evaluating e has no side effects (except potentially allocating and initializing a new object).

For calls, we do not check whether their arguments have any side effects: even if they do, the call itself is useless and should be flagged by this query.

Import path

import Expressions.ExprHasNoEffect
predicate noSideEffects(Expr e)