pub struct ReactHookProfile {
pub state: u16,
pub effect: u16,
pub memo: u16,
pub callback: u16,
pub custom: u16,
pub max_effect_dep_arity: Option<u32>,
}Expand description
Per-component React hook profile derived from the cached hook_uses IR at
the health layer. Descriptive context that refines the bare
ComplexityViolation::react_hook_count headline with a per-kind breakdown
and the maximum useEffect dependency-array arity.
Attached only when at least one component-scope hook was attributed to the
function, so non-React findings stay byte-identical on the wire. The
per-kind counts cover hooks recorded by the React visitor (calls inside an
identified component); a use* call inside a plain helper function is
counted in react_hook_count but NOT here, so the breakdown can sum to LESS
than react_hook_count. react_hook_count remains the headline total; this
is an additive refinement.
Fields§
§state: u16useState call count attributed to this component.
effect: u16useEffect call count attributed to this component.
memo: u16useMemo call count attributed to this component.
callback: u16useCallback call count attributed to this component.
custom: u16Custom use* hook call count attributed to this component.
max_effect_dep_arity: Option<u32>Largest useEffect dependency-array arity over the attributed effects
that carry a literal deps array. None when no attributed useEffect
had a literal array (absent or non-literal deps; ADR-001 syntactic-only,
so absence does NOT mean “no coupling”).