NodeTypeStarters

@TraversalSource
class NodeTypeStarters(cpg: Cpg) extends TraversalSource
class TraversalSource
class Object
trait Matchable
class Any

Value members

Concrete methods

@Doc(info = "All nodes of the graph")
override def all: Traversal[StoredNode]

Traverse to all nodes.

Traverse to all nodes.

Definition Classes
TraversalSource
def annotation: Traversal[Annotation]

Traverse to all annotations

Traverse to all annotations

@Doc(info = "All arguments (actual parameters)")
def argument: Traversal[Expression]

Traverse to all arguments passed to methods

Traverse to all arguments passed to methods

def argument(code: String): Traversal[Expression]

Shorthand for cpg.argument.code(code)

Shorthand for cpg.argument.code(code)

@Doc(info = "All breaks (`ControlStructure` nodes)")
def break: Traversal[ControlStructure]
@Doc(info = "All call sites")
def call: Traversal[Call]

Traverse to all call sites

Traverse to all call sites

def call(name: String): Traversal[Call]

Shorthand for cpg.call.name(name)

Shorthand for cpg.call.name(name)

@Doc(info = "All comments in source-based CPGs")
def comment: Traversal[Comment]

Traverse to all comments in source-based CPGs.

Traverse to all comments in source-based CPGs.

def comment(code: String): Traversal[Comment]

Shorthand for cpg.comment.code(code)

Shorthand for cpg.comment.code(code)

@Doc(info = "All config files")
def configFile: Traversal[ConfigFile]

Traverse to all config files

Traverse to all config files

def configFile(name: String): Traversal[ConfigFile]

Shorthand for cpg.configFile.name(name)

Shorthand for cpg.configFile.name(name)

@Doc(info = "All continues (`ControlStructure` nodes)")
def continue: Traversal[ControlStructure]
@Doc(info = "All control structures (source-based frontends)")
def controlStructure: Traversal[ControlStructure]
@Doc(info = "All dependencies")
def dependency: Traversal[Dependency]

Traverse to all dependencies

Traverse to all dependencies

def dependency(name: String): Traversal[Dependency]

Shorthand for cpg.dependency.name(name)

Shorthand for cpg.dependency.name(name)

@Doc(info = "All do blocks (`ControlStructure` nodes)")
def doBlock: Traversal[ControlStructure]
@Doc(info = "All else blocks (`ControlStructure` nodes)")
def elseBlock: Traversal[ControlStructure]
@Doc(info = "All source files")
def file: Traversal[File]

Traverse to all source files

Traverse to all source files

def file(name: String): Traversal[File]

Shorthand for cpg.file.name(name)

Shorthand for cpg.file.name(name)

@Doc(info = "All for blocks (`ControlStructure` nodes)")
def forBlock: Traversal[ControlStructure]
@Doc(info = "All gotos (`ControlStructure` nodes)")
def goto: Traversal[ControlStructure]
@Doc(info = "All identifier usages")
def identifier: Traversal[Identifier]

Traverse to all identifiers, e.g., occurrences of local variables or class members in method bodies.

Traverse to all identifiers, e.g., occurrences of local variables or class members in method bodies.

def identifier(name: String): Traversal[Identifier]

Shorthand for cpg.identifier.name(name)

Shorthand for cpg.identifier.name(name)

@Doc(info = "All if blocks (`ControlStructure` nodes)")
def ifBlock: Traversal[ControlStructure]
@Doc(info = "All jump targets, i.e., labels")
def jumpTarget: Traversal[JumpTarget]

Traverse to all jump targets

Traverse to all jump targets

@Doc(info = "All literals, e.g., numbers or strings")
def literal: Traversal[Literal]

Traverse to all literals (constant strings and numbers provided directly in the code).

Traverse to all literals (constant strings and numbers provided directly in the code).

def literal(code: String): Traversal[Literal]

Shorthand for cpg.literal.code(code)

Shorthand for cpg.literal.code(code)

@Doc(info = "All local variables")
def local: Traversal[Local]

Traverse to all local variable declarations

Traverse to all local variable declarations

def local(name: String): Traversal[Local]

Shorthand for cpg.local.name

Shorthand for cpg.local.name

@Doc(info = "All members of complex types (e.g., classes/structures)")
def member: Traversal[Member]

Traverse to all class members

Traverse to all class members

def member(name: String): Traversal[Member]

Shorthand for cpg.member.name(name)

Shorthand for cpg.member.name(name)

@Doc(info = "Meta data blocks for graph")
def metaData: Traversal[MetaData]

Traverse to all meta data entries

Traverse to all meta data entries

@Doc(info = "All methods")
def method: Traversal[Method]

Traverse to all methods

Traverse to all methods

@Doc(info = "All methods with a name that matches the given pattern")
def method(namePattern: String): Traversal[Method]

Shorthand for cpg.method.name(name)

Shorthand for cpg.method.name(name)

@Doc(info = "All method references")
def methodRef: Traversal[MethodRef]

Traverse to all method references

Traverse to all method references

def methodRef(name: String): Traversal[MethodRef]

Shorthand for cpg.methodRef.filter(_.referencedMethod.name(name))

Shorthand for cpg.methodRef.filter(_.referencedMethod.name(name))

@Doc(info = "All formal return parameters")
def methodReturn: Traversal[MethodReturn]

Traverse to all formal return parameters

Traverse to all formal return parameters

@Doc(info = "All namespaces")
def namespace: Traversal[Namespace]

Traverse to all namespaces, e.g., packages in Java.

Traverse to all namespaces, e.g., packages in Java.

def namespace(name: String): Traversal[Namespace]

Shorthand for cpg.namespace.name(name)

Shorthand for cpg.namespace.name(name)

def namespaceBlock: Traversal[NamespaceBlock]

Traverse to all namespace blocks, e.g., packages in Java.

Traverse to all namespace blocks, e.g., packages in Java.

def namespaceBlock(name: String): Traversal[NamespaceBlock]

Shorthand for cpg.namespaceBlock.name(name)

Shorthand for cpg.namespaceBlock.name(name)

@Doc(info = "All parameters")
def parameter: Traversal[MethodParameterIn]

Traverse to all input parameters

Traverse to all input parameters

def parameter(name: String): Traversal[MethodParameterIn]

Shorthand for cpg.parameter.name(name)

Shorthand for cpg.parameter.name(name)

@Doc(info = "All actual return parameters")
def ret: Traversal[Return]

Traverse to all return expressions

Traverse to all return expressions

def ret(code: String): Traversal[Return]

Shorthand for returns.code(code)

Shorthand for returns.code(code)

@Doc(info = "All static imports")
def staticImport: Traversal[Import]
@Doc(info = "All switch blocks (`ControlStructure` nodes)")
def switchBlock: Traversal[ControlStructure]
@Doc(info = "All tags")
def tag: Traversal[Tag]

Traverse to all tags

Traverse to all tags

@Doc(info = "All tags with given name")
def tag(name: String): Traversal[Tag]
@Doc(info = "All throws (`ControlStructure` nodes)")
def throws: Traversal[ControlStructure]
@Doc(info = "All try blocks (`ControlStructure` nodes)")
def tryBlock: Traversal[ControlStructure]
@Doc(info = "All used types")
def typ: Traversal[Type]

Traverse to all types, e.g., Set

Traverse to all types, e.g., Set

@Doc(info = "All used types with given name")
def typ(name: String): Traversal[Type]

Shorthand for cpg.typ.name(name)

Shorthand for cpg.typ.name(name)

@Doc(info = "All declarations of types")
def typeDecl: Traversal[TypeDecl]

Traverse to all declarations, e.g., Set

Traverse to all declarations, e.g., Set

def typeDecl(name: String): Traversal[TypeDecl]

Shorthand for cpg.typeDecl.name(name)

Shorthand for cpg.typeDecl.name(name)

@Doc(info = "All type references")
def typeRef: Traversal[TypeRef]

Traverse to all type references

Traverse to all type references

@Doc(info = "All while blocks (`ControlStructure` nodes)")
def whileBlock: Traversal[ControlStructure]

Inherited methods

def has(key: String, value: Any): Traversal[Node]

Start traversal with all nodes that have given property value

Start traversal with all nodes that have given property value

Inherited from:
TraversalSource
def has(property: Property[_]): Traversal[Node]

Start traversal with all nodes that have given property value

Start traversal with all nodes that have given property value

Inherited from:
TraversalSource
def hasLabel(label: String): Traversal[Node]
Inherited from:
TraversalSource
def id[NodeType : DefaultsToNode](id: Long): Traversal[NodeType]
Inherited from:
TraversalSource
def ids[NodeType : DefaultsToNode](ids: Long*): Traversal[NodeType]
Inherited from:
TraversalSource
def label(label: String): Traversal[Node]
Inherited from:
TraversalSource
def labelAndProperty(label: String, propertyKey: String, propertyValue: Any): Traversal[Node]

Start traversal with all nodes with given label that have given property value Inspects the cardinality of the indices of the properties and labels, and takes the smaller one

Start traversal with all nodes with given label that have given property value Inspects the cardinality of the indices of the properties and labels, and takes the smaller one

Inherited from:
TraversalSource
def labelAndProperty(label: String, property: Property[_]): Traversal[Node]

Start traversal with all nodes with given label that have given property value Inspects the cardinality of the indices of the properties and labels, and takes the smaller one

Start traversal with all nodes with given label that have given property value Inspects the cardinality of the indices of the properties and labels, and takes the smaller one

Inherited from:
TraversalSource
def labelTyped[A <: Node](label: String): Traversal[A]
Inherited from:
TraversalSource