Merge pull request #383 from esben-semmle/js/unused-eval-variable

Approved by xiemaisi
This commit is contained in:
semmle-qlci
2018-10-31 10:42:55 +00:00
committed by GitHub
4 changed files with 29 additions and 0 deletions

View File

@@ -163,6 +163,12 @@ predicate whitelisted(UnusedLocal v) {
isEnumMember(vd) or
// ignore ambient declarations - too noisy
vd.isAmbient()
) or
exists (DirectEval eval |
// eval nearby
eval.getEnclosingFunction() = v.getADeclaration().getEnclosingFunction() and
// ... but not on the RHS
not v.getAnAssignedExpr() = eval
)
}