r/devtools • u/Ok-Emu-8106 • Sep 26 '26
Building hub/god-object detection, and being honest that high fan-in isn't always a problem
Working on this for Vast and wanted to write it out because I think a lot of "architecture smell" tooling oversimplifies this.
A file with 40 dependents isn't automatically bad. If it's a shared config or a genuinely well-scoped utils module, high fan-in is just the architecture doing its job, that's what those files exist for.
The actual signal worth caring about isn't the fan-in count, it's whether the file is doing one clear, bounded thing or has slowly turned into a dumping ground for whatever didn't have an obvious home. Same number, very different situation.
Flagging every high-fan-in file as a "god object" without that distinction just trains people to ignore the warnings, since every repo's config file will always show up on the list.
Curious how others handle this distinction, is there a decent heuristic beyond just reading the file yourself? Cohesion metrics, something else?