Skip to content

Commit

Permalink
Java: qldocs for CallGraph module
Browse files Browse the repository at this point in the history
  • Loading branch information
Jami Cogswell authored and Jami Cogswell committed Dec 17, 2024
1 parent 4417f74 commit 13753dd
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,21 @@ module SqlExecuteConfig implements DataFlow::ConfigSig {
/** Tracks flow from SQL queries that update a database to the argument of an execute method call. */
module SqlExecuteFlow = TaintTracking::Global<SqlExecuteConfig>;

/** Provides classes and predicates representing call paths. */
module CallGraph {
newtype TCallPathNode =
private newtype TCallPathNode =
TMethod(Method m) or
TCall(Call c)

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

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

/** Gets the string representation of this `CallPathNode`. */
string toString() {
result = this.asMethod().toString()
or
Expand All @@ -145,6 +150,7 @@ module CallGraph {
[viableCallable(this.asCall()), this.asCall().getCallee()] = result.asMethod()
}

/** Gets a successor node of this `CallPathNode`, if any. */
CallPathNode getASuccessor() {
this.asMethod() = result.asCall().getEnclosingCallable()
or
Expand All @@ -159,6 +165,7 @@ module CallGraph {
)
}

/** Gets the location of this `CallPathNode`. */
Location getLocation() {
result = this.asMethod().getLocation()
or
Expand Down

0 comments on commit 13753dd

Please sign in to comment.