NodeTypeStarters

io.shiftleft.semanticcpg.language.NodeTypeStarters
class NodeTypeStarters(cpg: Cpg)

Starting point for a new traversal, e.g.

  • cpg.method, cpg.call etc. - these are generated by the flatgraph codegenerator and automatically inherited
  • cpg.method.name

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def argument: Iterator[Expression]

Traverse to all arguments passed to methods

Traverse to all arguments passed to methods

Attributes

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

Shorthand for cpg.argument.code(code)

Shorthand for cpg.argument.code(code)

Attributes

def break: Iterator[ControlStructure]
def continue: Iterator[ControlStructure]
def doBlock: Iterator[ControlStructure]
def elseBlock: Iterator[ControlStructure]
def forBlock: Iterator[ControlStructure]
def goto: Iterator[ControlStructure]
def ifBlock: Iterator[ControlStructure]
def methodRefWithName(name: String): Iterator[MethodRef]

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

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

Note re API design: this step was supposed to be called methodRef(name: String), but due to limitations in Scala's implicit resolution (and the setup of our implicit steps) we have to disambiguate it from .methodRef by name.

More precisely: Scala's implicit resolution reports 'ambiguous implicits' if two methods with the same name but different parameters are defined in two different (implicitly reachable) classes. The .methodRef step is defined in generated.CpgNodeStarter. This step (filter by name) doesn't get generated by the codegen because it's more complex than the other 'filter by primary key' starter steps.

Attributes

def parameter: Iterator[MethodParameterIn]

Traverse to all input parameters

Traverse to all input parameters

Attributes

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

Shorthand for cpg.parameter.name(name)

Shorthand for cpg.parameter.name(name)

Attributes

def switchBlock: Iterator[ControlStructure]
def throws: Iterator[ControlStructure]
def tryBlock: Iterator[ControlStructure]
def whileBlock: Iterator[ControlStructure]