module Rigor::ModuleGraph::Stats

Computes per-namespace dependency metrics over an edge list.

Five numbers per namespace:

+nodes+:: number of distinct constants in the namespace +fan_out+:: edges whose +from+ is in the namespace and +to+ is outside it +fan_in+:: edges whose +to+ is in the namespace and +from+ is outside it +internal+:: edges where both endpoints sit in the namespace +total+:: +fan_out+ + +internal+ — every edge originating in the namespace

Grouping is by top-level namespace by default (+Billing::Invoice+ → +Billing+). Pass +depth: N+ for a deeper split (+Billing::Invoice::Line+ at depth 2 →+Billing::Invoice+). Names without enough segments at the requested depth bucket under the special label +“(top-level)”+ so they stay visible in the report.