Linux / Drivers / Android
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 158 units with 5,384 lines of code in units (73.1% of code).
    • 6 very long units (1,916 lines of code)
    • 20 long units (1,191 lines of code)
    • 43 medium size units (1,356 lines of code)
    • 41 small units (597 lines of code)
    • 48 very small units (324 lines of code)
35% | 22% | 25% | 11% | 6%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c35% | 22% | 25% | 11% | 5%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT35% | 22% | 25% | 11% | 6%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
705 94 5
420 76 5
359 91 6
188 42 3
138 24 5
106 23 4
92 11 3
72 10 1
70 9 2
68 8 3
66 6 1
63 11 4
61 12 2
60 12 2
56 11 3
56 5 2
56 7 1
55 8 1
53 4 2
53 9 1
53 20 3
52 7 5
52 11 8
51 6 4
51 9 4
51 10 2
48 7 3
47 5 2
46 15 5
46 6 2
46 6 2
45 6 2
45 4 2
44 7 2
44 15 4
44 6 8
43 8 5
42 15 3
36 6 3
35 6 2
35 8 3
34 6 7
32 4 6
32 8 4
29 7 2
29 5 2
29 4 2
28 7 2
28 4 1
28 9 2