Reference Card

Node-Type Steps #

StepDescription
allAll nodes
argumentAll arguments (actual parameters)
assignmentAll assignments
callAll call sites
commentAll comments (only source-based CPGs)
controlStructureAll control structures (also break, continue, ifBlock etc. for specific structures)
fileAll source files
identifierAll identifiers, e.g. occurrences of local variables or class members in method bodies
literalAll literals, e.g. numbers or strings
localAll local variables
memberAll members of complex types, e.g. classes, structs
metaDataThe meta data node
methodAll methods
methodRefAll method references
methodReturnAll formal return parameters
namespaceAll namespaces
namespaceBlockAll namespace blocks
parameterAll parameters
returnsAll actual return parameters
tagAll tags
typeDeclAll declarations of types
typeRefAll type references

Core Steps #

StepDescription
cloneCreate a deep copy of the traversal
dedupDeduplicate results in a traversal
mapTransform the traversal by a given function
sideEffectExtend the traversal with a side-effect step by applying a function

Filter Steps #

StepDescription
andThe and step is a filter with multiple and related filter traversals.
filterKeep nodes for which the provided predicate returns true
filterNotKeep nodes for which the provided predicate returns false
whereTraversal proceeds for steps with non-empty returns for the provided predicate
whereNotTraversal proceeds for steps with empty returns for the provided predicate
orThe or step is a filter with multiple or related filter traversals.

Repeat Steps #

StepDescription
repeatRepeat the given traversal. This step can be combined with the until and emit steps to provide a termination and emit criteria.
untilTermination criteria for a repeat step. If used before the repeat step it as “while” characteristics. If used after the repeat step it as “do-while” characteristics.
timesModifier for repeat steps. Configure the amount of times the repeat traversal is executed.
emitEmit is used with the repeat step to emit the elements of the repeatTraversal after each iteration of the repeat loop.

Complex Steps #

StepDescription
calleeList all nodes representing Call Graph callees of the traversed nodes
callerList all nodes representing Call Graph callers of the traversed nodes
callInList all nodes representing Call Graph parent call-sites of the traversed nodes
controlledByReturns only those dataflows that are wrapped by a given AST control condition (>, <, =, etc.)
dumpExecute the traversal and return the CODE property with syntax highlighting
dumpRawExecute the traversal and return the CODE property without syntax highlighting
inCallLists all nodes representing surrounding Call Graph call-sites of the traversed nodes
locationsList of all locations nodes traversed in a given dataflow
notControlledByReturns only those flows that are NOT wrapped by a given AST control condition (>, <, =, etc.)
reachableByFind if a given source node is reachable by a sink via a dataflow
reachableByFlowsFind paths for flows of data from sinks to sources
sinkList of all nodes identified as potential sensitive sinks for the methods, literals, types etc. associated with them
sourceList of all nodes identified as sensitive/attacker-controlled for the methods, literals, types etc. associated with them
tagListExecute the traversal and return TAG nodes connected to each of the nodes

Execution Directives #

DirectiveDescription
toListExecute the traversal and convert the result to a list
lShorthand for toList
toJsonExecute the traversal and convert the result to JSON
toJsonPrettyExecute the traversal and convert the result to prettified JSON
pExecute the traversal and pretty print the results
browseExecute the traversal and pretty print the results in less
sizeExecute the traversal and return the size of the array of nodes

Help Directive #

DirectiveDescription
helpPrint help based on the current element type

Augmentation Directives #

DirectiveDescription
newTagNodeTag node with a specific name
newTagNodePairTag node with a specific name and value
storeStore changes in the current DiffGraph