NodeTypeStarters

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

Value members

Concrete methods

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

Traverse to all nodes.

Traverse to all nodes.

@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 continues (`ControlStructure` nodes)")
def continue: Traversal[ControlStructure]
@Doc(info = "All control structures (source-based frontends)")
def controlStructure: Traversal[ControlStructure]
@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]
def id[NodeType <: StoredNode](anId: Long): Traversal[NodeType]

Begin traversal at node with id.

Begin traversal at node with id.

def id[NodeType <: StoredNode](ids: Seq[Long]): Traversal[NodeType]

Begin traversal at set of nodes - specified by their ids

Begin traversal at set of nodes - specified by their ids

@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 given name")
def method(name: String): Traversal[Method]

Shorthand for cpg.method.name(fullName)

Shorthand for cpg.method.name(fullName)

@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 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]