MethodTraversal

io.shiftleft.semanticcpg.language.types.structure.MethodTraversal
final class MethodTraversal(val traversal: Iterator[Method]) extends AnyVal

A method, function, or procedure

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def annotation: Iterator[Annotation]

Traverse to annotations of method

Traverse to annotations of method

Attributes

def body: Iterator[Block]

Traverse to method body (alias for block)

Traverse to method body (alias for block)

Attributes

def break: Iterator[ControlStructure]
def cfgLast: Iterator[CfgNode]

Traverse to last expression in CFG.

Traverse to last expression in CFG.

Attributes

def cfgNode: Iterator[CfgNode]
def continue: Iterator[ControlStructure]
def controlStructure: Iterator[ControlStructure]

All control structures of this method

All control structures of this method

Attributes

def controlStructure(regex: String): Iterator[ControlStructure]

Shorthand to traverse to control structures where condition matches regex

Shorthand to traverse to control structures where condition matches regex

Attributes

def definingMethod: Iterator[Method]

The method in which this method is defined

The method in which this method is defined

Attributes

def definingTypeDecl: Iterator[TypeDecl]

The type declaration associated with this method, e.g., the class it is defined in.

The type declaration associated with this method, e.g., the class it is defined in.

Attributes

def doBlock: Iterator[ControlStructure]
def elseBlock: Iterator[ControlStructure]
def external: Iterator[Method]

Traverse to external methods, that is, methods not present but only referenced in the CPG.

Traverse to external methods, that is, methods not present but only referenced in the CPG.

Attributes

def forBlock: Iterator[ControlStructure]
def goto: Iterator[ControlStructure]
def ifBlock: Iterator[ControlStructure]
def internal: Iterator[Method]

Traverse to internal methods, that is, methods for which code is included in this CPG.

Traverse to internal methods, that is, methods for which code is included in this CPG.

Attributes

def isNotStub: Iterator[Method]

Traverse only to methods that are not stubs.

Traverse only to methods that are not stubs.

Attributes

def isStub: Iterator[Method]

Traverse only to methods that are stubs, e.g., their code is not available or the method body is empty.

Traverse only to methods that are stubs, e.g., their code is not available or the method body is empty.

Attributes

def isVariadic: Iterator[Method]

Traverse only to methods that accept variadic arguments.

Traverse only to methods that accept variadic arguments.

Attributes

def local: Iterator[Local]

Traverse to the methods local variables

Traverse to the methods local variables

Attributes

def namespace: Iterator[Namespace]

Traverse to namespace

Traverse to namespace

Attributes

def namespaceBlock: Iterator[NamespaceBlock]

Traverse to namespace block

Traverse to namespace block

Attributes

def numberOfLines: Iterator[Int]
def switchBlock: Iterator[ControlStructure]
def throws: Iterator[ControlStructure]
def topLevelExpressions: Iterator[Expression]
def tryBlock: Iterator[ControlStructure]
def typeDecl: Iterator[TypeDecl]

The type declaration associated with this method, e.g., the class it is defined in. Alias for 'definingTypeDecl'

The type declaration associated with this method, e.g., the class it is defined in. Alias for 'definingTypeDecl'

Attributes

def whileBlock: Iterator[ControlStructure]

Concrete fields

val traversal: Iterator[Method]