X2Cpg

io.joern.x2cpg.X2Cpg$
object X2Cpg

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
X2Cpg.type

Members list

Concise view

Value members

Concrete methods

def applyDefaultOverlays(cpg: Cpg): Unit

For a CPG generated by a frontend, run the default passes that turn a frontend-CPG into a complete CPG.

For a CPG generated by a frontend, run the default passes that turn a frontend-CPG into a complete CPG.

Attributes

def defaultOverlayCreators(): List[LayerCreator]

This should be the only place where we define the list of default overlays.

This should be the only place where we define the list of default overlays.

Attributes

def newEmptyCpg(optionalOutputPath: Option[String]): Cpg

Create an empty CPG, backed by the file at optionalOutputPath or in-memory if optionalOutputPath is empty.

Create an empty CPG, backed by the file at optionalOutputPath or in-memory if optionalOutputPath is empty.

Attributes

def parseCommandLine[R <: X2CpgConfig[LazyRef(...)]](args: Array[String], frontendSpecific: OParser[_, R], initialConf: R): Option[R]

Parse commands line arguments in args using an X2Cpg command line parser, extended with the frontend specific options in frontendSpecific with the initial configuration set to initialConf. On success, the configuration is returned wrapped into an Option. On failure, error messages are printed and, None is returned.

Parse commands line arguments in args using an X2Cpg command line parser, extended with the frontend specific options in frontendSpecific with the initial configuration set to initialConf. On success, the configuration is returned wrapped into an Option. On failure, error messages are printed and, None is returned.

Attributes

def stripQuotes(str: String): String

Strips surrounding quotation characters from a string.

Strips surrounding quotation characters from a string.

Attributes

s

the target string.

Returns:

the stripped string.

def withErrorsToConsole[T <: X2CpgConfig[_]](config: T)(f: T => Try[_]): Try[_]

Given a function that receives a configuration and returns an arbitrary result type wrapped in a Try, evaluate the function, printing errors to the console.

Given a function that receives a configuration and returns an arbitrary result type wrapped in a Try, evaluate the function, printing errors to the console.

Attributes

def withNewEmptyCpg[T <: X2CpgConfig[_]](outPath: String, config: T)(applyPasses: (Cpg, T) => Unit): Try[Cpg]

Apply function applyPasses to a newly created CPG. The CPG is wrapped in a Try and returned. On failure, the CPG is ensured to be closed.

Apply function applyPasses to a newly created CPG. The CPG is wrapped in a Try and returned. On failure, the CPG is ensured to be closed.

Attributes

def writeCodeToFile(sourceCode: String, tmpDirPrefix: String, suffix: String): File

Write sourceCode to a temporary file inside a temporary directory. The prefix for the temporary directory is given by tmpDirPrefix. The suffix for the temporary file is given by suffix. Both file and directory are deleted on exit.

Write sourceCode to a temporary file inside a temporary directory. The prefix for the temporary directory is given by tmpDirPrefix. The suffix for the temporary file is given by suffix. Both file and directory are deleted on exit.

Attributes