arXiv:2610.32466cs.SEOct 2026

Manuscript Offprint

arXiv:2610.32466

Complexity concentration as a god-class and god-method detector: a pre-registered test of a scale-free outlier rule against tool definitions and human labels

Daniel Sagenschneider

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

God-class and god-method detectors mark concentrated complexity with a raw-scale threshold, a constant fitted on a corpus and re-fitted when the population moves. This paper pre-registers a test of a rule with no raw-scale constant: a unit is a god unit when its complexity is a robust outlier for its own codebase, a modified z-score of 3.5 or more. On 445 repositories in ten languages, 171 of them Java, and the 492 Java repositories of MLCQ, the rule is scored against PMD's GodClass, MLCQ's reviewers and two further definitions, with signal and cutoff chosen on half the repositories and read on the rest. LLM-written code may gather its complexity differently, the case for a detector that needs no re-fitting; the first question is whether one can match the scale of existing human-written code. The verdict is inconclusive on both populations, by different arms. The rule ranks PMD's god classes from the per-file maximum of cognitive complexity at per-repository AUCs of 0.916 and 0.908. On the main run it is, at its default, non-inferior within the margin to a cutoff tuned on the same population on recovery, and flags about twice as many non-god classes; on MLCQ it flags about as many and falls short of the margin on pooled recovery. Pooled, the raw value ranks god classes better than the per-repository score, and a cutoff carried between the populations lost almost nothing: both are human-written code on one scale, so the test is of matching that scale, not of surviving a shift. The rule's extra flags are small classes, just over half holding a method at PMD's own method-level threshold; its misses are large classes whose complexity is spread over many methods. Two readers of the source did not agree on what the extra flags are. Concentration finds where the complexity is; whether that place is a god unit is a question about coupling, which a registered follow-on study takes up.

1 Introduction

A god class is a class that does too much. Riel named the heuristic [27], Fowler catalogued the smell as Large Class and its method-level twin as Long Method [13], and Lanza and Marinescu turned the judgement into a detection strategy, a conjunction of metric thresholds [17, 21]. Every threshold-based detector in use follows that template, and the thresholds are constants on a raw scale: a weighted method count of 47, a cyclomatic complexity of 14, a cognitive complexity of 15, fifty lines. The constants are frozen percentiles of a corpus [17, 1, 12, 26], and a constant derived from a corpus is a statement about that corpus. It has to be re-derived when the population moves, and there is evidence that it may be moving: projects that adopted an LLM coding agent showed a persistent rise in complexity [14], and on a fixed assignment LLM-generated projects gathered their complexity into fewer classes, which the threshold-based detectors missed [31]. A detector whose constant is fitted to the codebase in front of it would then be worth having, but agent-written code is not yet available at the scale a pre-registered test needs, so the first step, and this paper's question, is whether such a detector can match the single scale of existing human-written code at all.

The alternative is a rule whose constant lives on a standardised axis. Standardise every unit by its own repository's median and median absolute deviation and flag the units whose modified z-score is 3.5 or more, Iglewicz and Hoaglin's rule [16]. The 3.5 is still a constant, but the scale it is applied to, the median and the MAD, is fitted on the codebase at the time of use and carries no corpus: the rule is scale-free, not constant-free. The question arose in a companion study [28], which found the amount of complexity an AI agent produced on a fixed task steady across architectures and instructions while its placement moved by factors of three to ten. Placement, not amount, was what a design decided, and that turned attention from the level of a unit's complexity to its concentration. The claim this paper tests is that a scale-free relative outlier in a per-unit complexity measure that is not size recovers the classes and methods that tuned, absolute-threshold definitions mark, and that human reviewers mark, without a raw-scale constant.

The claim was pre-registered: the primary estimand, the decision rule and its margins, the families a signal may be chosen from, the sample seed and the bootstrap were committed and tagged before the confirmatory sample was drawn. The design is tilted against the claim: every tool oracle is itself an absolute threshold, and the competitor is a cutoff tuned on the explore half of the same population, which is the right competitor for the first step, since matching a tuned constant on its own population is the bar a scale-free rule must clear before a shifted population is worth testing. The paper has three findings.

  1. The verdict is inconclusive on both populations, by different arms. Against PMD's GodClass on 171 Java repositories and again on MLCQ's 492, the per-file maximum of cognitive complexity ranks god classes at per-repository AUCs of 0.916 and 0.908. On the main run the rule at its default is non-inferior to a cutoff tuned on the same population on both MCC arms, flags about twice as many non-god classes, and the false-positive arm does not resolve; on MLCQ it flags about as many as the cutoff but falls short of the margin on pooled MCC. Every point estimate is on the cutoff's side, tuning the rule's own constant changes neither verdict, and at method level the rule is inferior.

  2. The two populations sit on one raw scale, so the first step is well posed. Pooled, the raw value of the signal ranks god classes better than its per-repository standardised score, by a resolved difference on both populations, and a cutoff tuned on one population and carried to the other lost almost nothing. Both are code written largely by people, so the test here is of matching their scale, not of surviving a shift.

  3. The errors have a shape. The rule's extra flags are small, mostly uncoupled classes, just over half holding a method at PMD's own method-level threshold; its misses are large classes whose complexity is spread over many moderate methods. Against MLCQ's reviewers no detector agrees with the Blob verdicts beyond an MCC of about 0.24, and on Long Method the relative rule has the highest point estimate of the detectors tried. A blinded reading of the extra flags by the author and by a language model did not agree on what they are, and agreed on one question only, whether the class works on other objects' data. Whether a concentration of complexity is a god unit is a coupling question, which a follow-on study, registered before these numbers existed, takes up.

References (32)