topos.graphs.cpg.modelsΒΆ

CPG Models β€” Code Property Graph node & edge types per Yamaguchi et al.

class topos.graphs.cpg.models.CPGEdgeKind(*values)[source]

Bases: StrEnum

The four CPG edge families.

AST = 'ast'
CFG = 'cfg'
DDG = 'ddg'
CDG = 'cdg'
class topos.graphs.cpg.models.CPGEdge(source, target, kind, label='')[source]

Bases: object

A typed, labeled edge in the CPG multigraph.

source
target
kind
label = ''
class topos.graphs.cpg.models.CPGNode(uast)[source]

Bases: object

A CPG node: a UAST node enriched with quick-lookup metadata.

The CPG uses the UAST node directly as the node payload β€” every CPG node is a UAST node, so the AST family of edges is implicit in the UAST children lists. We materialize them as CPGEdges anyway so downstream queries are uniform.

uast
property id
property kind
property attributes