Skip to content

Commit 26b7c1a

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: qldocs for CallGraph module
1 parent 27aa9c9 commit 26b7c1a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

java/ql/lib/semmle/code/java/security/CsrfUnprotectedRequestTypeQuery.qll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,21 @@ module SqlExecuteConfig implements DataFlow::ConfigSig {
126126
/** Tracks flow from SQL queries that update a database to the argument of an execute method call. */
127127
module SqlExecuteFlow = TaintTracking::Global<SqlExecuteConfig>;
128128

129+
/** Provides classes and predicates representing call paths. */
129130
module CallGraph {
130-
newtype TCallPathNode =
131+
private newtype TCallPathNode =
131132
TMethod(Method m) or
132133
TCall(Call c)
133134

135+
/** A node in a call path graph */
134136
class CallPathNode extends TCallPathNode {
137+
/** Gets the method corresponding to this `CallPathNode`, if any. */
135138
Method asMethod() { this = TMethod(result) }
136139

140+
/** Gets the call corresponding to this `CallPathNode`, if any. */
137141
Call asCall() { this = TCall(result) }
138142

143+
/** Gets the string representation of this `CallPathNode`. */
139144
string toString() {
140145
result = this.asMethod().toString()
141146
or
@@ -146,6 +151,7 @@ module CallGraph {
146151
[viableCallable(this.asCall()), this.asCall().getCallee()] = result.asMethod()
147152
}
148153

154+
/** Gets a successor node of this `CallPathNode`, if any. */
149155
CallPathNode getASuccessor() {
150156
this.asMethod() = result.asCall().getEnclosingCallable()
151157
or
@@ -160,13 +166,15 @@ module CallGraph {
160166
)
161167
}
162168

169+
/** Gets the location of this `CallPathNode`. */
163170
Location getLocation() {
164171
result = this.asMethod().getLocation()
165172
or
166173
result = this.asCall().getLocation()
167174
}
168175
}
169176

177+
/** Holds if `pred` has a successor node `succ`. */
170178
predicate edges(CallPathNode pred, CallPathNode succ) { pred.getASuccessor() = succ }
171179
}
172180

0 commit comments

Comments
 (0)