Linux / Drivers / Macintosh
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 485 units with 9,541 lines of code in units (59.0% of code).
    • 4 very long units (500 lines of code)
    • 31 long units (1,817 lines of code)
    • 136 medium size units (4,294 lines of code)
    • 110 small units (1,649 lines of code)
    • 204 very small units (1,281 lines of code)
5% | 19% | 45% | 17% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c5% | 19% | 45% | 17% | 13%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT5% | 19% | 45% | 17% | 12%
ams0% | 10% | 42% | 19% | 27%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
145 20 2
141 34 2
111 21 2
103 19 1
78 13 1
75 15 2
71 18 2
65 18 2
65 12 1
64 17 1
63 15 1
63 10 1
62 12 1
59 12 1
59 16 1
59 11 1
59 16 1
59 7 1
57 7 1
57 7 1
56 12 1
55 17 1
55 11 2
55 14 1
55 14 4
55 12 1
54 12 1
53 8 1
53 13 3
53 14 1
52 13 4
52 14 4
52 8 1
51 9 2
51 21 1
49 10 1
49 19 1
49 14 4
49 6 1
49 14 1
48 8 1
47 14 2
45 4 4
45 8 1
45 6 1
44 10 1
44 18 1
43 7 1
43 10 3
42 14 1