Linux / Drivers / Greybus
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 286 units with 5,079 lines of code in units (77.6% of code).
    • 1 very long units (155 lines of code)
    • 8 long units (464 lines of code)
    • 79 medium size units (2,304 lines of code)
    • 102 small units (1,525 lines of code)
    • 96 very small units (631 lines of code)
3% | 9% | 45% | 30% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c3% | 9% | 45% | 30% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT3% | 9% | 45% | 30% | 12%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
155 25 2
79 12 1
61 12 3
60 11 3
55 16 2
55 8 1
52 10 4
51 6 1
51 16 1
50 9 1
49 10 2
46 8 1
45 11 2
44 6 1
43 10 6
41 7 4
41 5 15
40 4 4
39 9 1
39 5 1
38 5 1
36 7 4
35 5 3
35 6 3
34 5 3
33 4 1
33 8 3
33 9 1
32 4 4
32 5 1
32 5 1
32 5 4
32 4 1
32 6 1
31 8 2
31 9 7
31 5 1
31 5 4
30 5 2
30 4 1
30 7 2
30 3 1
29 4 2
29 3 2
28 5 1
28 12 1
28 12 1
28 5 1
28 4 5
27 4 4