gograph_godobj
Scores Go structs on method, field, and call counts to flag God Object candidates exceeding configurable thresholds. Use during architecture reviews to identify monolithic structs needing decomposition.
Instructions
Detect God Object anti-pattern candidates by scoring structs on method count, field count, and outgoing call count. Requires .gograph/graph.json — run gograph build . first. Read-only; no side effects. Thresholds: methods (default: 5), fields (default: 8), calls (default: 15); top limits results (default: 10). A struct must exceed all three thresholds to be flagged. WHEN TO USE: During architecture reviews to find monolithic structs that should be decomposed. NOT TO USE: For general struct layout inspection (use gograph_fields); for single-function complexity (use gograph_complexity). RETURNS: Ranked list of candidates with method, field, and call counts; empty when no structs exceed all thresholds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| calls | No | Minimum outgoing call count (default: 15) | |
| fields | No | Minimum field count (default: 8) | |
| methods | No | Minimum method count (default: 5) | |
| top | No | Maximum results to return (default: 10) |