srcgraph-metrics
Graph-theoretic code-analysis metrics over the srcgraph-core
traits — SCC (circular dependencies), LCOM4 (cohesion), betweenness centrality
(architectural chokepoints), instability + SDP violations, and clone detection.
Each metric is behind its own cargo feature (default = ["all"]).
Algorithms are generic over petgraph::Graph<N, E> where N: ClassNode, E: EdgeKind, so
you can run them against an OwnedGraph loaded from GraphML or against a live in-process
graph (e.g. yah's kg-store::Store::class_graph()).
use ;
let graph = from_graphml_file?;
let scc = compute_scc;
let bet = compute_betweenness;
Benchmarks against networkx on a 7000+ node graph land in the 50× range (cargo bench -p srcgraph-metrics --bench betweenness).
License: MIT OR Apache-2.0.