Linux / Drivers / Extcon
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 243 units with 6,204 lines of code in units (68.6% of code).
    • 4 very long units (582 lines of code)
    • 25 long units (1,878 lines of code)
    • 70 medium size units (2,359 lines of code)
    • 50 small units (746 lines of code)
    • 94 very small units (639 lines of code)
9% | 30% | 38% | 12% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c9% | 30% | 38% | 12% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT9% | 30% | 38% | 12% | 10%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
167 34 1
167 30 1
145 25 1
103 41 2
97 17 2
95 20 1
93 13 1
92 17 1
91 40 1
90 18 1
86 14 1
82 10 1
82 18 1
79 19 1
78 13 1
78 10 3
77 11 3
75 39 1
73 12 1
70 10 2
68 37 1
67 39 1
65 11 1
63 15 1
59 36 1
57 11 1
55 10 2
55 10 1
51 22 1
50 7 2
50 8 1
49 8 1
49 8 2
49 12 4
49 11 3
49 11 1
48 16 2
47 11 1
46 17 1
45 10 4
45 8 2
42 10 1
42 9 1
40 9 4
39 18 2
39 6 1
39 7 3
39 5 3
39 7 4
38 9 2