-
Notifications
You must be signed in to change notification settings - Fork 5
/
exercise6.ql
34 lines (28 loc) · 1 KB
/
exercise6.ql
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
34
/** Exercise 6: Extend the `RemoteFlowSource`'s value set with the parameters of the public methods of the component classes identified in exercise 3. */
import java
import semmle.code.java.dataflow.FlowSources
module XWiki {
class Component extends Class {
Component() {
this.getAnAnnotation()
.getType()
.hasQualifiedName("org.xwiki.component.annotation", "Component")
}
}
class ScriptComponent extends Component {
ScriptComponent() { this.getASupertype().hasName("ScriptService") }
}
class ScriptComponentMethodParameterSource extends RemoteFlowSource {
ScriptComponentMethodParameterSource() {
exists(
ScriptComponent scriptComponent, Method apiMethod // FROM
|
scriptComponent.getAMethod() = apiMethod and // WHERE
apiMethod.isPublic() and
apiMethod.getAParameter() = this.asParameter()
)
}
override string getSourceType() { result = "XWiki component method parameter" }
}
}
select any(RemoteFlowSource s)