Module CallGraph
Provides predicates for visualizing the call paths leading to or from a specific function.
It defines three predicates: callEdge
, isStartOfCallPath
and isEndOfCallPath
,
as well as the nodes
and edges
predicates needed for a path problem query.
To use this library, make sure the query has @kind path-problem
and selects columns appropriate for a path problem query.
For example:
import javascript
import semmle.javascript.explore.CallGraph
import DataFlow
from InvokeNode invoke, FunctionNode function
where callEdge*(invoke, function)
and isStartOfCallPath(invoke)
and function.getName() = "targetFunction"
select invoke, invoke, function, "Call path to 'targetFunction'"
NOTE: This library should only be used for debugging and exploration, not in production code.
Import path
import semmle.javascript.explore.CallGraph
Imports
javascript | Provides classes for working with JavaScript programs, as well as JSON, YAML and HTML. |
Predicates
callEdge | Holds if |
isEndOfCallPath | Holds if |
isStartOfCallPath | Holds if |
nodes | Holds if |
Aliases
edges | Holds if |