pub fn collect_function_metrics(cpg: &CodePropertyGraph) -> Vec<FunctionMetric>Expand description
Computes metrics for every function and class node in the graph.
Builds a name → index lookup once, making per‑node edge counting O(1) instead of a repeated linear scan over all graph nodes.