JS: Make implicit this receivers explicit

This commit is contained in:
Kasper Svendsen
2023-05-03 15:31:00 +02:00
parent ea75996932
commit 67950c8e6b
125 changed files with 1061 additions and 1002 deletions

View File

@@ -19,9 +19,9 @@ class IgnoredFile extends File {
IgnoredFile() {
any(Test t).getFile() = this
or
getRelativePath().regexpMatch("(?i).*/test(case)?s?/.*")
this.getRelativePath().regexpMatch("(?i).*/test(case)?s?/.*")
or
getBaseName().regexpMatch("(?i)(.*[._\\-]|^)(min|bundle|concat|spec|tests?)\\.[a-zA-Z]+")
this.getBaseName().regexpMatch("(?i)(.*[._\\-]|^)(min|bundle|concat|spec|tests?)\\.[a-zA-Z]+")
or
exists(TopLevel tl | tl.getFile() = this |
tl.isExterns()

View File

@@ -13,14 +13,14 @@ import meta.MetaMetrics
/** An call site that is relevant for analysis quality. */
class RelevantInvoke extends InvokeNode {
RelevantInvoke() { not getFile() instanceof IgnoredFile }
RelevantInvoke() { not this.getFile() instanceof IgnoredFile }
}
/** An call site that is relevant for analysis quality. */
class RelevantFunction extends Function {
RelevantFunction() {
not getFile() instanceof IgnoredFile and
hasBody() // ignore abstract or ambient functions
not this.getFile() instanceof IgnoredFile and
this.hasBody() // ignore abstract or ambient functions
}
}