The vector
<A, B, C> is reported alongside the magnitude |ABC| = sqrt(A² + B² + C²).
What mehen emits
How to read it
There is no universal threshold, but Fitzpatrick’s original paper proposed:
The Ruby community adopted ABC widely via
rubocop-rubycop/rubycritic, which uses
<A, B, C> and a magnitude threshold of 17 by default for methods.
Per-language increments
Each language analyzer maps its statement and expression node kinds onto the three buckets. The canonical mapping:- Assignments:
=,+=,−=,*=,/=,%=,<<=,>>=,&=,|=,^=, prefix/postfix++/−−, parameter default values where applicable. - Branches: function calls, method calls, constructors,
super(...)calls, and dynamic dispatch. - Conditions:
if,else if,case/when, ternary,&&/||, equality and ordering operators, exception handlers (catch,rescue,except).
References
- Fitzpatrick, J. (1997). Applying the ABC Metric to C, C++, and Java. C++ Report, June 1997. Author archive (PDF).
- RuboCop:
Metrics/AbcSizecop documentation — production-grade Ruby implementation with documented thresholds.
See also
- Cyclomatic complexity — counts branches/conditions differently.
- LOC family — orthogonal size measure.