forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThrift.qll
More file actions
33 lines (29 loc) · 898 Bytes
/
Copy pathThrift.qll
File metadata and controls
33 lines (29 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* Provides classes and predicates for working with the Apache Thrift framework.
*/
import java
/**
* A file detected as generated by the Apache Thrift Compiler.
*/
class ThriftGeneratedFile extends GeneratedFile {
ThriftGeneratedFile() {
exists(JavadocElement t | t.getFile() = this |
exists(string msg | msg = t.getText() | msg.regexpMatch("(?i).*\\bAutogenerated by Thrift.*"))
)
}
}
/**
* A Thrift `Iface` interface in a class generated by the Apache Thrift Compiler.
*/
class ThriftIface extends Interface {
ThriftIface() {
this.hasName("Iface") and
this.getEnclosingType() instanceof TopLevelType and
this.getFile() instanceof ThriftGeneratedFile
}
Method getAnImplementingMethod() {
result.getDeclaringType().(Class).getASupertype+() = this and
result.overrides+(this.getAMethod()) and
not result.getFile() = this.getFile()
}
}