Manuscript Offprint
arXiv:2611.01636What reviewers call a Long Method is a length: A pre-registered test of coupling divergence as a god-unit signal, and what it settled instead
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
A companion study found that a complexity outlier rule shows where complexity concentrates but cannot tell a god unit from a complex algorithm. This paper pre-registered a test of one way to tell them apart: weight a unit's complexity by its coupling divergence, the data it hands on minus the data it receives, so that a leaf is set aside. Coupling was measured by resolving every call in 520 MLCQ repositories, 500 fresh Java repositories and 73 Qualitas Corpus systems. The claim fails: the primary, the pooled MCC of the weighted form minus complexity alone against MLCQ's human Blob, is , no difference resolved and underpowered, and the resolved readings go against it. What the data settle is at method level. What MLCQ's reviewers call a Long Method is an absolute length: a constant of 26 lines or more, chosen on the explore half, reaches MCC 0.777 on the confirm half, over the best per-repository form; every reviewer with ten or more positives, on their non-leaf reviews, has a best cutoff between 17 and 34 lines; and nothing measured inside a method, its calls, variables, data flow or the cost of cutting it, refines the constant. The constant is a limit of human reading. The next form of the construct is the cost of bringing a long method under it, which is where the construct meets architecture.
1 Introduction
A companion study [15] tested a god-class and god-method detector with no raw-scale constant: a unit is flagged when its complexity is a robust outlier for its own codebase, a modified z-score of 3.5 or more on a scale fitted to that codebase [8]. The rule found where the complexity concentrates, and its extra flags were small classes doing the work they were written to do. The difference between a god unit and a complex algorithm, that study concluded, is in the coupling, and it named this study as the test.
The construct tested here is coupling divergence: what a unit hands on minus what it receives. A unit that receives more than it sends is a catchment, a leaf that processes what it is given, where the complexity of an algorithm belongs; one that sends more than it receives is a junction, and a unit that directs the data and also holds the logic is what people call a god unit. The pre-registered claim was that multiplying complexity by a factor that is zero for a catchment and grows with the divergence of a junction recovers god classes and methods better than complexity alone; its estimand, decision rule, sample and bootstrap were committed before any coupling had been measured on the confirmatory material.
The claim did not survive the test (Section 3). What the data settle instead is at method level: what MLCQ's reviewers call a Long Method is an absolute length, 26 lines or more, which a per-repository rule is the wrong model for and which nothing measured inside a method refines (Section 4). That constant is a limit of human reading, and the construct's next form is the cost of bringing a long method under it (Section 5). The full registered report is in the ancillary data.
Coupling as an ingredient of a god definition is old: Lanza and Marinescu's God Class conjoins a weighted method count, low cohesion and access to foreign data [10, 13], and Henry and Kafura's information flow multiplies length by fan-in times fan-out [7], where size was later found to predict as well [9, 5], which is why a size-only weighting is one of this paper's arms. Divergence differs from information flow in subtracting what comes in from what goes out; its construct, a sinew, data that reaches the code that needs it only by riding the call chain, descends from Yourdon and Constantine's tramp data [18]. In Tempero and Ralph's terms [16] the construct is the sinew and divergence one indicator of it; Arif, Kuutila and Ralph found in-coupling and out-coupling loading as separate constructs [2], which is why the outgoing side is read on its own. Absolute thresholds on length are older than the relative rule: Lanza and Marinescu's threshold tables [10] and Alves, Ypma and Visser's benchmark-derived thresholds [1] fix a constant from a corpus and apply it to every system, the model this paper's method-level result returns to.
The human oracle is MLCQ [11], professional developers' reviews of Java open-source classes and methods, with the companion study's strict-majority aggregation and its explore and confirm halves frozen before any repository was measured; classifiers trained on it reach a median MCC of about 0.51 for Blob and 0.81 for Long Method [12], a reference point since the rules here see no label. Fontana and colleagues' God Class instances on the Qualitas Corpus [3] are a second, balanced and extreme, human oracle.
3 The registered test and its result
The claim as registered. For a method with parameters, under the primary flow definition, and over its calls resolved to the repository's own sources, each passing arguments; a call to the JDK or a dependency counts for nothing. The divergence is ; a class's sums its methods' calls that leave the file and its the parameters of its externally callable methods. The divergence factor is , the product of an exemption and an amplification ; the outgoing factor and the size null , the class's number of methods, run beside it, each scored by the same rule on every unit of the repository, exempt units as zeros. The base signal was chosen on the MLCQ explore half by complexity alone, as the signal whose flags maximise the pooled MCC against human Blob. The estimand is the pooled MCC of minus , both by modified , against MLCQ human Blob over the reviewed classes of the confirm repositories, with a 95% percentile bootstrap over repositories (2,000 resamples, seed 12345): refines on a lower bound above 0, worse on an upper bound below 0, otherwise no difference resolved, and underpowered below a gate sized on the explore half. A consistency analysis then asked, for every oracle and signal family, whether the divergence factor () and the outgoing factor () improve on complexity alone, with four registered predictions and a verdict rule. The oracles are MLCQ's reviews on 520 measured repositories (2,334 reviewed classes with 254 Blobs, 2,430 reviewed methods with 276 Long Methods, both halves), five tool definitions on 500 fresh Java repositories, and Fontana's 420 God Class instances on 73 Qualitas Corpus systems. Coupling is a JavaParser measurer with its symbol solver, resolving against the repository's sources and the JDK with no build; 24.0% of confirm-half calls resolve to nothing, almost always a dependency's type, so reads low.
The result. Complexity alone chose nloc_max as X* (explore MCC 0.287); the gate asked for 72 confirm repositories with a reviewed Blob and the confirm half carries 66, so the primary is underpowered by the plan's rule whatever it reads. On the confirm half complexity alone reaches MCC 0.187 and the weighted form 0.146; the paired difference is -0.041 [-0.130, +0.054], verdict no difference resolved (underpowered). The hypothesised shape is inverted, recall up and precision down, and threshold-free the weighted form ranks Blobs worse than complexity alone (AUC 0.631 against 0.768, -0.137 [-0.195, -0.080]). Against the size null, a weighting by the number of methods that carries no coupling, the coupling factor is -0.091 [-0.175, -0.006]: the rival explanation the plan recorded, that a Blob is a big class with one complex method, beats the construct by a resolved margin. The exemption alone has support in the labels: among the units X* flags, a catchment is called a god unit less often by two of the three human oracles (MLCQ Long Method -0.304 [-0.541, -0.082]; Fontana supported; MLCQ Blob unresolved), but the amplification the factor adds costs more than the exemption gains. The construct's verdict by the registered rule is outgoing data only: the outgoing factor improves on complexity alone against human Blob in the peak and density families (ΔO +0.125 [+0.054, +0.195] and +0.151 [+0.076, +0.227]) while subtracting what comes in costs agreement in every family of every class-level oracle; read threshold-free, post hoc, even that gain is a flag rate on MLCQ. At method level the factor is -0.092 [-0.188, +0.010] against Long Method, and no secondary, sensitivity or tool oracle in the ancillary data changes this.
Deviations from the plan. The plan was amended ten times after registration, each amendment a commit stating what had been seen: eight before any confirm or seed-3 repository had been measured, the ninth after measurement but before any result had been read, and the tenth correcting a fault found after the confirmatory results had been read. The harness had attached a human oracle to a repository only when it held a positive unit, so repositories whose reviewed units are all negatives never entered the population; the fault was found after a confirmatory analysis had been read by the author. The fix has no free parameter; the explore-half choices and the analysis were made again by the registered procedure, the earlier files set aside with their digests. It restored 141 confirm repositories and 386 reviewed classes to the Blob population; on the set-aside analysis the primary read -0.075 [-0.191, +0.045], the same verdict. The gate was not met and MLCQ has no more repositories, so a difference of 0.10 could have been missed. The full account is in the ancillary data.
4 What the reviewers call a Long Method is a length
Everything in this section was computed after every oracle had been read, by scripts in the ancillary data with their outputs and digests; it is exploration and changes nothing above. The registered analysis had already shown that length ranks Long Methods best of every form, better than the registered cognitive signal, and that a gate on any internal call only zeroes the short trivial methods and so recalibrates the per-repository constant (percentile AUC against tokens +0.005 [-0.002, +0.013] on confirm).
What the reviewers judge. MLCQ keeps every review (Table 1). The share of non-leaf reviews calling a method a Long Method is 1.0% up to 10 lines, 24.3% at 11 to 25, 81.6% at 26 to 50 and 94.0% at 51 to 100: a step at about twenty-five lines. Each of the 10 reviewers with ten or more positives has, on their non-leaf reviews, a best length cutoff between 17 and 34 lines (median 21), an absolute constant carried from reviewer to reviewer, which is why a cutoff tuned on MLCQ beat the per-repository rule in the companion study and why no per-repository form here can reach it. At equal length a leaf is called a Long Method about as often as a non-leaf (80.0% against 81.6% at 26 to 50 lines; over all long methods -0.033 [-0.141, +0.045]). The exemption the labels supported above is narrower than the construct: among the methods cognitive complexity flags,
Table 1: Post hoc: MLCQ's 3,054 individual Long Method reviews by 26 reviewers on measured units (both halves), by the method's length and whether it is a leaf (no internal call): the share calling it a Long Method at any severity.
| Lines of the method | Leaf reviews | called Long Method | Non-leaf reviews | called Long Method |
|---|---|---|---|---|
| 1-10 | 770 | 0.4% | 823 | 1.0% |
| 11-25 | 230 | 17.4% | 571 | 24.3% |
| 26-50 | 80 | 80.0% | 365 | 81.6% |
| 51-100 | 17 | 94.1% | 151 | 94.0% |
| 101+ | 7 | 85.7% | 40 | 95.0% |
leaves are called Long Method less often (63.0% against 83.3%) at the same median length, so it is the branchy leaf reviewers decline to call a Long Method, not a leaf as such.
The constant, read once. The constant the reviews imply was read as the plan reads a cutoff: chosen on the explore half among 9 absolute cutoffs on lines, 10, 15, 20, 26, 30, 40, 50, 75 and 100, round numbers with the companion study's tuned cutoff among them, and read on the confirm half (202 repositories, 1,033 reviewed methods, 125 positives). On the explore half the cutoffs read 0.710 at 20, 0.715 at 26 and 0.681 at 30, so the cutoff chosen is 26 lines or more. On confirm it flags 131 methods with 103 hits, MCC 0.777 (precision 0.79, recall 0.82), +0.080 [+0.016, +0.145] over the best per-repository form, the registered rule on length gated on any internal call. The MCC is flat from 20 to 30 lines (0.761 at 20, 0.778 at 30) and has fallen by 40 (0.644), so the constant is a mid-twenties one rather than a sharp number.
What was tried against it. Two further post hoc readings on the same half asked whether anything inside a method refines that constant. The first scored 34 forms built from the method's variables (the live width a reader holds at a line, the counts of locals, parameters and fields, and the data flow from inputs to calls) by the same procedure; every one is resolved below length (34 of 34), the best at 0.673, −0.104 [−0.174, −0.035]. The second scored the cost of cutting a long method into pieces under the constant, the parameters and return values the pieces would exchange; its cheapest-seam form reaches 0.764, −0.013 [−0.043, +0.015] against the constant, and among the 130 long methods, the only ground it can gain, it ranks the 103 positives no better than length does (AUC 0.706 [0.588, 0.827] against 0.789 [0.693, 0.879], −0.083 [−0.199, +0.036]). Nothing in a long method's body, as these measures see it, says which of the methods length flags the reviewers passed.
5 Discussion
Where the construct fails. The factor was expected to raise precision by setting complex leaves aside, and what a unit receives was expected to matter as well as what it sends; neither is seen, and the exemption the labels do support is narrowed by the reviews to the branchy leaves complexity flags. A factor of is unbounded and, for a class, grows with the calls the class makes, so the weighted signal is dominated by the classes that call most whatever their complexity; and a class with a wide callable surface is one that other code uses, so subtracting its surface pushes the hubs people call Blobs towards the catchment side, the opposite of the construct's reading. Divergence as an indicator of the sinew fails convergent validity [16] against three human definitions of a god unit; and the human Blob is weakly predicted by anything (complexity alone 0.187, trained classifiers 0.51 [12]), so part of the ceiling is the oracle.
What a Long Method is. At method level the reviews settle more than the forms do. What MLCQ's reviewers label a Long Method is a method of 26 lines or more, leaf or not, each reviewer read on enough methods within a few lines of the others whatever the repository. The right detector for that label is a constant on length, which the companion study's tuned cutoff already reaches at 0.785 [15] and which reaches 0.777 here; the per-repository rule is the wrong model for it, and neither the registered construct nor anything read after it inside the method refines it. What remains to register is whether the branchy-leaf exemption the reviews show adds anything to the constant, and whether the per-repository rule has a place on code whose scale has moved, the purpose the plan stated and this data cannot test.
The next form of the sinew. The constant is a limit of human reading, which code that agents write and maintain need not respect, so the construct's next form at method level is not a detector but a cost: what it takes to bring a long method under the constant, counted as what the pieces must exchange across each seam. That cost depends on who calls the pieces. When the remainder calls them, every value that crosses is a parameter or the one return; when a framework calls them in sequence and supplies what each declares, a value handed on unchanged costs nothing. The difference between the two readings of the same cut is what the architecture buys on the seam, and it is the comparison to make between agent-written arms of one system under different frameworks. Prior tools rank extract-method candidates within a method [17, 6]; none takes the length cap as a constraint with a cost on the exchange under two calling conventions. That instrument is built and is to be read descriptively before any claim is registered for it.
6 Threats to validity
Divergence counts parameters and arguments, not what travels in them, and a class's inputs count the parameters of its callable methods, so a wide interface reads as receiving much, the likely failure of the sign. No oracle names a complex algorithm; every oracle names a god unit, so the title's question is answered from that side only. Unresolved calls make out a lower bound, and injected collaborators are invisible to static parsing. The study is Java only, and 50.8% of MLCQ's confirm half sits in ten owners. The primary is underpowered by its own gate, no secondary is corrected for multiplicity, and the bootstraps are coarse at the tails. The post hoc readings of Section 4 followed the constant onto the confirm half, so that half is a hold-out for the choice among the 9 cutoffs alone, and the grid itself was drawn after the reviews of both halves had been read. The plan's stated purpose, a definition that moves with the codebase as agent-maintained code changes what a normal level of complexity is, was not tested: no agent-written corpus with human labels exists at the scale a pre-registered test needs.
7 Conclusion
Weighting complexity by coupling divergence does not recover the units people call god units better than complexity alone; the primary resolves no difference and is underpowered, and the resolved readings go the other way. What the data settle is at method level: MLCQ's reviewers call a method a Long Method at 26 lines or more, leaf or not, a constant on length (MCC 0.777 on the confirm half) is the detector that matches them, and nothing read inside a method refines it. The constant is a limit of human reading; the form of sinew left to build is the cost of the cut.
Data availability. Every number here is produced by a script from the harness's analysis files, and the table is a generated fragment. The ancillary data holds the full registered report, the confirmatory analysis and the two set aside with their digests, the account of every deviation, the explore-half decisions, run records, pinned samples, converted labels, and the post hoc scripts with their outputs and digests; its README names every repository, commit and command.
Competing interests and funding
The author created and maintains OfficeFloor, a framework whose design rests on taking data off the control flow, from which the sinew construct comes; a positive result would have supported the framework's premise, and the result is negative. The population fault (Section 3) was found after the confirmatory results had been read; the fix is the one the plan's text dictates, and every headline reading before and after it is reported. The plan, seed, decision rule and gate were fixed before the data existed; a replication needs no cooperation from the author, whose companion study, sampler and measurer these are. The work received no external funding.
References
[1] T. L. Alves, C. Ypma and J. Visser, "Deriving metric thresholds from benchmark data," in Proc. 26th IEEE International Conference on Software Maintenance (ICSM), pp. 1–10, 2010.
[2] H. Arif, M. Kuutila and P. Ralph, "Assessing the construct validity of object-oriented, class-level code quality metrics," in Proc. ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM), 2026; arXiv:2609.20411.
[3] F. Arcelli Fontana, M. V. Mäntylä, M. Zanoni and A. Marino, "Comparing and experimenting machine learning techniques for code smell detection," Empirical Software Engineering, vol. 21, no. 3, pp. 1143–1191, 2016.
[4] G. A. Campbell, "Cognitive Complexity: a new way of measuring understandability," SonarSource white paper, 2018.
[5] K. El Emam, S. Benlarbi, N. Goel and S. N. Rai, "The confounding effect of class size on the validity of object-oriented metrics," IEEE Transactions on Software Engineering, vol. 27, no. 7, pp. 630–650, 2001.
[6] R. Haas and B. Hummel, "Deriving extract method refactoring suggestions for long methods," in Software Quality Days (SWQD 2016), LNBIP vol. 238, Springer, 2016, pp. 144–155.
[7] S. Henry and D. Kafura, "Software structure metrics based on information flow," IEEE Transactions on Software Engineering, vol. SE-7, no. 5, pp. 510–518, 1981.
[8] B. Iglewicz and D. C. Hoaglin, How to Detect and Handle Outliers. ASQC Quality Press, 1993.
[9] B. A. Kitchenham, L. M. Pickard and S. J. Linkman, "An evaluation of some design metrics," Software Engineering Journal, vol. 5, no. 1, pp. 50–58, 1990.
[10] M. Lanza and R. Marinescu, Object-Oriented Metrics in Practice. Springer, 2006.
[11] L. Madeyski and T. Lewowski, "MLCQ: Industry-relevant code smell data set," in Proc. 24th International Conference on Evaluation and Assessment in Software Engineering (EASE), pp. 342–347, 2020. Data set version 1.1, Zenodo record 3666840.
[12] L. Madeyski and T. Lewowski, "Detecting code smells using industry-relevant data," Information and Software Technology, vol. 155, 107112, 2023.
[13] R. Marinescu, "Detection strategies: metrics-based rules for detecting design flaws," in Proc. 20th IEEE International Conference on Software Maintenance (ICSM), pp. 350–359, 2004.
[14] T. J. McCabe, "A Complexity Measure," IEEE Transactions on Software Engineering, vol. SE-2, no. 4, pp. 308–320, 1976.
[15] D. Sagenschneider, "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," 2026. https://doi.org/10.5281/zenodo.23581333
[16] E. Tempero and P. Ralph, "Making software metrics useful," IEEE Computer, in press, 2026, doi:10.1109/MC.2026.3666634; arXiv:2603.16012.
[17] N. Tsantalis and A. Chatzigeorgiou, "Identification of extract method refactoring opportunities for the decomposition of methods," Journal of Systems and Software, vol. 84, no. 10, pp. 1757–1782, 2011.
[18] E. Yourdon and L. L. Constantine, Structured Design: Fundamentals of a Discipline of Computer Program and Systems Design. Prentice-Hall, 1979.