io.joern.x2cpg.passes.frontend
Members list
Type members
Classlikes
The Javascript specific call linker links static call sites (by full name) and call sites to methods in the same file (by name).
The Javascript specific call linker links static call sites (by full name) and call sites to methods in the same file (by name).
Attributes
- Graph
- Supertypes
- class CpgPassclass ForkJoinParallelCpgPass[AnyRef]class NewStyleCpgPassBase[AnyRef]trait CpgPassBaseclass Objecttrait Matchableclass Any
A pass that creates a MetaData node, specifying that this is a CPG for language, and a NamespaceBlock for anything that cannot be assigned to any other namespace.
A pass that creates a MetaData node, specifying that this is a CPG for language, and a NamespaceBlock for anything that cannot be assigned to any other namespace.
Attributes
- Companion:
- object
- Graph
- Supertypes
- class CpgPassclass ForkJoinParallelCpgPass[AnyRef]class NewStyleCpgPassBase[AnyRef]trait CpgPassBaseclass Objecttrait Matchableclass Any
Attributes
- Companion:
- class
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- MetaDataPass.type
Link remaining unlinked Python calls to methods only by their name (not full name)
Link remaining unlinked Python calls to methods only by their name (not full name)
Attributes
- cpg
the target code property graph.
- Graph
- Supertypes
- class CpgPassclass ForkJoinParallelCpgPass[AnyRef]class NewStyleCpgPassBase[AnyRef]trait CpgPassBaseclass Objecttrait Matchableclass Any
Performs type recovery from the root of a compilation unit level
Performs type recovery from the root of a compilation unit level
Attributes
- ComputationalUnit
the AstNode type used to represent a computational unit of the language.
- builder
the graph builder
- cu
a compilation unit, e.g. file, procedure, type, etc.
- Graph
- Supertypes
- class RecursiveTask[Unit]class ForkJoinTask[Unit]trait Serializabletrait Future[Unit]class Objecttrait Matchableclass Any
- Known subtypes
- class RecoverForPythonFile
Defines how a procedure is available to be called in the current scope either by it being defined in this module or being imported.
Defines how a procedure is available to be called in the current scope either by it being defined in this module or being imported.
Attributes
- callingName
how this procedure is to be called, i.e., alias name, name with path, etc.
- fullName
the full name to where this method is defined.
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- class ScopedPythonProcedure
Tasks responsible for populating the symbol table with import data.
Tasks responsible for populating the symbol table with import data.
Attributes
- node
a node that references import information.
- Graph
- Supertypes
- class RecursiveTask[Unit]class ForkJoinTask[Unit]trait Serializabletrait Future[Unit]class Objecttrait Matchableclass Any
- Known subtypes
A thread-safe symbol table that can represent multiple types per symbol. Each node in an AST gets converted to an SBKey which gives contextual information to identify an AST entity. Each value in this table represents a set of types that the key could be in a flow-insensitive manner.
A thread-safe symbol table that can represent multiple types per symbol. Each node in an AST gets converted to an SBKey which gives contextual information to identify an AST entity. Each value in this table represents a set of types that the key could be in a flow-insensitive manner.
The SymbolTable operates like a map with a few convenient methods that are designed for this structure's purpose.
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
Creates a TYPE
node for each type in usedTypes
Creates a TYPE
node for each type in usedTypes
Attributes
- Companion:
- object
- Graph
- Supertypes
- class CpgPassclass ForkJoinParallelCpgPass[AnyRef]class NewStyleCpgPassBase[AnyRef]trait CpgPassBaseclass Objecttrait Matchableclass Any
Attributes
- Companion:
- class
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- TypeNodePass.type
Attempts to set the methodFullName
and link to callees using the recovered type information from
XTypeRecovery. Note that some methods may not be present as they could be external and have been dynamically
discovered, thus the io.joern.x2cpg.passes.base.MethodStubCreator would have missed it.
Attempts to set the methodFullName
and link to callees using the recovered type information from
XTypeRecovery. Note that some methods may not be present as they could be external and have been dynamically
discovered, thus the io.joern.x2cpg.passes.base.MethodStubCreator would have missed it.
Attributes
- cpg
the target code property graph.
- Graph
- Supertypes
- class CpgPassclass ForkJoinParallelCpgPass[AnyRef]class NewStyleCpgPassBase[AnyRef]trait CpgPassBaseclass Objecttrait Matchableclass Any
- Known subtypes
- class PythonTypeHintCallLinker
Based on a flow-insensitive symbol-table-style approach. This pass aims to be fast and deterministic and does not try to converge to some fixed point. This will help recover:
Based on a flow-insensitive symbol-table-style approach. This pass aims to be fast and deterministic and does not try to converge to some fixed point. This will help recover:
- Imported call signatures from external dependencies
- Dynamic type hints for mutable variables in a computational unit.
The algorithm flows roughly as follows:
- Scan for method signatures of methods for each compilation unit, either by internally defined methods or by reading import signatures. This includes looking for aliases, e.g. import foo as bar.
- TODO: While performing the above, note field/member assignments in a symbol table.
- (Optionally) Prune these method signatures by checking their validity against the CPG.
- Visit assignments to populate where variables are assigned a value to extrapolate its type. Store these values in a local symbol table.
- Find instances of where these variables are used and update their type information.
- If this variable is the receiver of a call, make sure to set the type of the call accordingly.
The symbol tables use the SymbolTable class to track possible type information.
Attributes
- ComputationalUnit
the AstNode type used to represent a computational unit of the language.
- cpg
the CPG to recovery types for.
- Graph
- Supertypes
- class CpgPassclass ForkJoinParallelCpgPass[AnyRef]class NewStyleCpgPassBase[AnyRef]trait CpgPassBaseclass Objecttrait Matchableclass Any
- Known subtypes
- class PythonTypeRecovery