CpgPass
A single-threaded CPG pass. This is the simplest pass to implement: override run and add desired graph modifications to the provided DiffGraphBuilder.
Internally implemented as a ForkJoinParallelCpgPass with a single part and parallelism disabled.
Value parameters
- cpg
-
the code property graph to modify
- outName
-
optional name for output
Attributes
- Graph
-
- Supertypes
-
class ForkJoinParallelCpgPass[AnyRef]trait CpgPassBaseclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class SimpleCpgPass
Members list
Type members
Inherited types
Attributes
- Inherited from:
- ForkJoinParallelCpgPassWithAccumulator
Value members
Abstract methods
The main method to implement. Add all desired graph changes (nodes, edges, properties) to the provided builder.
The main method to implement. Add all desired graph changes (nodes, edges, properties) to the provided builder.
Value parameters
- builder
-
the DiffGraphBuilder that accumulates graph modifications
Attributes
Concrete methods
Override and return false to disable parallel execution. Useful for debugging.
Override and return false to disable parallel execution. Useful for debugging.
Attributes
- Definition Classes
Process a single part and record graph modifications in the provided builder.
Process a single part and record graph modifications in the provided builder.
Value parameters
- builder
-
the DiffGraphBuilder that accumulates graph modifications
- part
-
the part to process, as produced by generateParts
Attributes
- Definition Classes
Inherited methods
Attributes
- Inherited from:
- CpgPassBase
Create a fresh accumulator instance. Called once per parallel worker thread.
Create a fresh accumulator instance. Called once per parallel worker thread.
Attributes
- Definition Classes
- Inherited from:
- ForkJoinParallelCpgPass
Creates a new DiffGraphBuilder, runs the pass (init, generateParts, runOnPart, finish), applies all accumulated changes to the graph, and logs timing information. Exceptions during execution are logged and re-thrown.
Creates a new DiffGraphBuilder, runs the pass (init, generateParts, runOnPart, finish), applies all accumulated changes to the graph, and logs timing information. Exceptions during execution are logged and re-thrown.
Attributes
- Definition Classes
- Inherited from:
- ForkJoinParallelCpgPassWithAccumulator
Called once after all parts have been processed (in a finally block). Use to release resources acquired in init.
Called once after all parts have been processed (in a finally block). Use to release resources acquired in init.
Attributes
- Inherited from:
- ForkJoinParallelCpgPassWithAccumulator
Attributes
- Inherited from:
- CpgPassBase
Called once before generateParts. Use to set up large data structures or acquire external resources.
Called once before generateParts. Use to set up large data structures or acquire external resources.
Attributes
- Inherited from:
- ForkJoinParallelCpgPassWithAccumulator
Merge the accumulator (right) into left. Called during the combine phase of fork/join.
Merge the accumulator (right) into left. Called during the combine phase of fork/join.
Attributes
- Definition Classes
- Inherited from:
- ForkJoinParallelCpgPass
Name of the pass. By default it is inferred from the name of the class, override if needed.
Name of the pass. By default it is inferred from the name of the class, override if needed.
Attributes
- Inherited from:
- CpgPassBase
Called once after all parts are processed and accumulators are merged. Use to record additional graph changes based on the fully merged accumulator.
Called once after all parts are processed and accumulators are merged. Use to record additional graph changes based on the fully merged accumulator.
Value parameters
- accumulator
-
the final merged accumulator
- builder
-
the DiffGraphBuilder for any additional modifications
Attributes
- Definition Classes
- Inherited from:
- ForkJoinParallelCpgPass
Process a single part, recording graph changes in builder and side results in accumulator.
Process a single part, recording graph changes in builder and side results in accumulator.
Value parameters
- accumulator
-
the thread-local accumulator for this worker
- builder
-
the DiffGraphBuilder that accumulates graph modifications
- part
-
the part to process
Attributes
- Definition Classes
- Inherited from:
- ForkJoinParallelCpgPass
Runs the full pass lifecycle (init, generateParts, parallel runOnPart, accumulator merge, finish) and absorbs all changes into externalBuilder without applying them to the graph. The caller is responsible for applying the builder.
Runs the full pass lifecycle (init, generateParts, parallel runOnPart, accumulator merge, finish) and absorbs all changes into externalBuilder without applying them to the graph. The caller is responsible for applying the builder.
Value parameters
- externalBuilder
-
the builder to absorb all generated changes into
Attributes
- Returns
-
the number of parts that were processed
- Definition Classes
- Inherited from:
- ForkJoinParallelCpgPassWithAccumulator
Wraps runWithBuilder with logging and exception handling. Use with caution — API is unstable.
Wraps runWithBuilder with logging and exception handling. Use with caution — API is unstable.
Value parameters
- builder
-
the DiffGraphBuilder to absorb changes into
Attributes
- Returns
-
the number of parts processed, or
-1if the pass threw an exception - Inherited from:
- CpgPassBase
Executes fun while logging the pass start and completion time (including duration via MDC).
Executes fun while logging the pass start and completion time (including duration via MDC).
Type parameters
- A
-
the return type of the wrapped computation
Value parameters
- fun
-
the computation to execute
Attributes
- Returns
-
the result of
fun - Inherited from:
- CpgPassBase
Deprecated and Inherited methods
Attributes
- Deprecated
- Please use createAndApply
- Definition Classes
- Inherited from:
- ForkJoinParallelCpgPassWithAccumulator
Attributes
- Deprecated
- true
- Inherited from:
- CpgPassBase