facebookexperimental / MIRAI
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 1,124 units with 18,026 lines of code in units (50.1% of code).
    • 34 very long units (7,004 lines of code)
    • 46 long units (3,393 lines of code)
    • 95 medium size units (3,007 lines of code)
    • 119 small units (1,804 lines of code)
    • 830 very small units (2,818 lines of code)
38% | 18% | 16% | 10% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs43% | 21% | 18% | 9% | 6%
h0% | 0% | 1% | 10% | 88%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
checker/src44% | 21% | 18% | 10% | 5%
include0% | 0% | 1% | 10% | 88%
standard_contracts/src0% | 0% | 0% | 4% | 95%
checker0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
577 271 2
559 116 2
436 22 3
355 25 2
331 88 3
314 3 2
277 22 3
232 9 4
230 51 2
212 28 1
203 2 2
196 4 3
192 4 2
171 38 2
169 32 2
169 23 5
165 17 2
160 11 2
157 4 2
150 9 2
149 18 5
149 5 2
147 34 2
136 16 1
132 4 1
130 19 5
129 22 3
120 1 3
114 4 1
113 24 2
112 16 6
111 11 3
105 9 4
102 12 2
100 17 1
99 7 3
99 12 3
99 21 2
92 11 2
92 9 1
91 6 4
91 5 2
90 13 2
89 8 1
89 8 1
88 4 2
87 19 2
86 14 2
85 12 0
84 21 2