Skip to main content

analyze_unit

Function analyze_unit 

Source
pub fn analyze_unit(
    unit: &FnUnit<'_>,
    path: &str,
    imports: &Imports,
    module_bindings: &HashSet<String>,
    span: &SpanIndex<'_>,
) -> Hotspot
Expand description

Analyze one function-unit into an owned Hotspot.

ยงGather โ†’ Fold

  1. gather: drive each detector over the own body to collect Vec<Effect>.
  2. fold: compute own_score, max_class, function-level confidence (weakest-link min over per-effect confidences, plus 0.8 synthetic when there are unresolved awaited calls), and await_count / async_boundary.

Adding a detector is a one-line addition to the gather step (in [gather]).