Skip to main content

Module risk

Module risk 

Source

Functionsยง

aggregate_file_scores
Aggregate symbol scores into file-level scores. File score = max composite among contained symbols. Files with zero symbols are excluded.
compute_coupling_scores
Compute coupling scores via degree centrality over non-structural edges. Only counts edges where both endpoints are in the symbol set. Excludes structural edges (Contains, ChildOf, HasDecorator, TestedBy). Normalizes by max_degree. Returns 0.0 for all if max_degree == 0.
compute_criticality_scores
Compute criticality scores by delegating to brandes_betweenness. Returns normalized betweenness centrality [0.0, 1.0] per symbol.
compute_risk_stats
Compute summary statistics for risk scores.
compute_sensitivity
Compute security sensitivity: 1.0 if symbol name or decorators match a pattern, 0.0 otherwise. Uses word-boundary matching: patterns match against segments of the qualified name and decorators.
compute_test_gaps
Compute test gap: 1.0 if symbol has no incoming TestedBy edges, 0.0 if tested.
score_symbols
Compute composite risk scores for all symbols.
split_into_segments
Split a string into segments at word boundaries: _, ., ::, and camelCase transitions. All segments are lowercased.