Skip to main content

find_god_objects

Find types that combine high size with high coupling — 'god classes' that violate single-responsibility and become refactoring nightmares. Sharper signal than find_large_classes alone: a 1000-line internal helper used only by its own namespace is not flagged, but a 200-line class called from 15 different namespaces is. Two axes: size (lines/members/fields) and coupling (incoming/outgoing namespace counts). A type qualifies when it crosses ALL THREE size thresholds AND at least one coupling threshold — keeps DTOs (high field count only) and dispatchers (high member count only) off the list. Defaults: lines >= 300, members >= 15, fields >= 10, incoming-namespaces >= 5, outgoing-namespaces >= 5. Each threshold is independently configurable. BCL namespaces (System., Microsoft.) excluded from outgoing count. Test projects, generated code, interfaces, and nested types are skipped. Sort: total axes exceeded DESC, then line count DESC.

Parameters

ParameterTypeRequiredDescription
projectstringOptional: restrict to a single project by name (case-insensitive).
minLinesintMin lines for size axis. Default 300.
minMembersintMin member count for size axis. Default 15.
minFieldsintMin field count for size axis. Default 10.
minIncomingNamespacesintMin incoming-namespace count for coupling axis. Default 5.
minOutgoingNamespacesintMin outgoing-namespace count for coupling axis. Default 5.