mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
JS: Make implicit this receivers explicit
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user