Linux / Block
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,929 units with 29,533 lines of code in units (73.4% of code).
    • 7 very long units (790 lines of code)
    • 71 long units (4,721 lines of code)
    • 327 medium size units (10,008 lines of code)
    • 533 small units (7,823 lines of code)
    • 991 very small units (6,191 lines of code)
2% | 15% | 33% | 26% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c2% | 16% | 34% | 26% | 19%
h0% | 0% | 2% | 14% | 82%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT2% | 12% | 32% | 29% | 22%
partitions3% | 41% | 41% | 7% | 5%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
125 11 2
120 26 1
118 22 1
112 30 4
109 26 4
104 24 3
102 32 4
99 13 3
99 25 4
98 24 1
96 23 1
94 16 1
94 14 1
94 19 3
93 24 1
90 15 4
87 15 4
85 11 1
84 35 1
83 20 1
81 38 5
80 16 3
79 23 4
79 24 3
76 17 1
72 18 3
71 14 4
71 14 2
70 8 1
69 4 2
68 12 1
68 21 3
67 19 2
67 14 4
67 27 5
66 14 3
66 16 1
64 14 1
63 12 3
62 10 1
61 14 3
61 19 4
61 15 3
60 15 3
60 1 1
60 27 2
59 10 1
59 19 1
58 11 1
58 13 2