Skip to content

Commit 8c4574e

Browse files
committed
unified: Handle implicit locals in AnalysisQuality.qll
1 parent f730e9f commit 8c4574e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎unified/ql/lib/codeql/unified/internal/AnalysisQuality.qll‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ module StaticNameResolutionStats implements EntityStatsSig {
5151
or
5252
result.isModuleScopeNode(_) and
5353
result.(NamespaceNode).ref().isIdentifier(this)
54+
or
55+
// Resolving to an implicitly-declared local such as "self" should count as
56+
// as a successfully resolved name
57+
exists(LocalName implicitLocal |
58+
implicitLocal = this.(LocalNameAccess).getLocalName() and
59+
not exists(implicitLocal.getABinding()) and
60+
result.isLocalName(implicitLocal)
61+
)
5462
)
5563
}
5664

0 commit comments

Comments
 (0)