Reference Card

Node-Type Steps

StepDescription
allAll nodes
argumentAll arguments (actual parameters)
callAll call sites
commentAll comments (only source-based CPGs)
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 paramters
namespaceAll namespaces
namespaceBlockAll namespace blocks
parameterAll parameters
returnsAll actual return parameters
typeDeclAll declarations of types
tagAll tags
typesAll used types

Core Steps

StepDescription
cloneCreate a deep copy of the traversal
dedupDeduplicate results in a traveral
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.
filterTraversal proceeds for steps with non-empty returns for the provided predicate
filterNotTraversal proceeds for steps with empty returns for the provided predicate
whereKeep nodes for which the provided predicate returns true
whereNonEmptyKeep nodes for which the provided predicate returns a non-empty result
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.)
passesNotReturns only those dataflows that DO NOT pass through a given function/condition as defined in predicate
passesReturns only those dataflows that pass through a given function/condition as defined in predicate
reachableByFind if a given source node is reachable by a sink via a dataflow
sinkList of all nodes identified as potential sensitive sinks the natured of methods, literals, types etc. associated with them
sourceList of all nodes identified as sensitive/attacker-controlled due to the natured of 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
sizeExecute the traversal and return the size of the array of nodes

Help Directive

Ocular Query ComponentDescription
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