@@ -126,16 +126,21 @@ module SqlExecuteConfig implements DataFlow::ConfigSig {
126
126
/** Tracks flow from SQL queries that update a database to the argument of an execute method call. */
127
127
module SqlExecuteFlow = TaintTracking:: Global< SqlExecuteConfig > ;
128
128
129
+ /** Provides classes and predicates representing call paths. */
129
130
module CallGraph {
130
- newtype TCallPathNode =
131
+ private newtype TCallPathNode =
131
132
TMethod ( Method m ) or
132
133
TCall ( Call c )
133
134
135
+ /** A node in a call path graph */
134
136
class CallPathNode extends TCallPathNode {
137
+ /** Gets the method corresponding to this `CallPathNode`, if any. */
135
138
Method asMethod ( ) { this = TMethod ( result ) }
136
139
140
+ /** Gets the call corresponding to this `CallPathNode`, if any. */
137
141
Call asCall ( ) { this = TCall ( result ) }
138
142
143
+ /** Gets the string representation of this `CallPathNode`. */
139
144
string toString ( ) {
140
145
result = this .asMethod ( ) .toString ( )
141
146
or
@@ -146,6 +151,7 @@ module CallGraph {
146
151
[ viableCallable ( this .asCall ( ) ) , this .asCall ( ) .getCallee ( ) ] = result .asMethod ( )
147
152
}
148
153
154
+ /** Gets a successor node of this `CallPathNode`, if any. */
149
155
CallPathNode getASuccessor ( ) {
150
156
this .asMethod ( ) = result .asCall ( ) .getEnclosingCallable ( )
151
157
or
@@ -160,13 +166,15 @@ module CallGraph {
160
166
)
161
167
}
162
168
169
+ /** Gets the location of this `CallPathNode`. */
163
170
Location getLocation ( ) {
164
171
result = this .asMethod ( ) .getLocation ( )
165
172
or
166
173
result = this .asCall ( ) .getLocation ( )
167
174
}
168
175
}
169
176
177
+ /** Holds if `pred` has a successor node `succ`. */
170
178
predicate edges ( CallPathNode pred , CallPathNode succ ) { pred .getASuccessor ( ) = succ }
171
179
}
172
180
0 commit comments