Expand description
Diff engine for comparing two Code Property Graphs.
§Overview
This module loads or builds two CodePropertyGraphs (typically from
two projects or two cached snapshots) and computes a symmetric
difference: which functions, classes and call-edges were added, removed
or stayed the same.
§Output
The result is a DiffReport containing two flat vectors:
nodes– every node present in at least one of the two graphs, tagged withStatus.edges– every unique(caller, callee, kind)tuple, also tagged with its status.
§Matching strategy
- Nodes are matched by their
namefield (must be unique within a graph; the caller is responsible for disambiguation). - Edges are matched by the triple
(source_name, target_name, edge_kind).
§Example
use icb_server::diff::{diff_graphs, Status};
use icb_graph::graph::CodePropertyGraph;
let old = CodePropertyGraph::new();
let new = CodePropertyGraph::new();
let report = diff_graphs(&old, &new);
assert!(report.nodes.is_empty());Structs§
- Diff
Edge - A single edge in the diff output.
- Diff
Node - A single node in the diff output.
- Diff
Report - Complete result of a diff operation.
Enums§
- Status
- Status of an entity in the diff.
Functions§
- diff_
graphs - Compute the symmetric difference between two graphs.