Linux / Drivers / Comedi
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 2,186 units with 48,623 lines of code in units (51.1% of code).
    • 32 very long units (4,269 lines of code)
    • 155 long units (10,344 lines of code)
    • 601 medium size units (18,932 lines of code)
    • 716 small units (10,520 lines of code)
    • 682 very small units (4,558 lines of code)
8% | 21% | 38% | 21% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c8% | 21% | 38% | 21% | 9%
py0% | 0% | 66% | 18% | 15%
h0% | 0% | 21% | 9% | 69%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
drivers8% | 21% | 39% | 21% | 9%
ROOT15% | 13% | 34% | 26% | 10%
kcomedilib0% | 0% | 54% | 37% | 7%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
286 43 3
223 38 2
176 65 3
169 37 4
157 43 2
156 28 2
155 41 2
153 22 1
148 36 3
140 32 2
139 23 2
130 21 2
128 37 2
127 23 3
122 32 3
121 22 2
120 16 2
116 36 3
115 17 2
115 27 4
112 13 2
111 27 3
109 21 3
107 19 3
106 17 2
106 18 2
106 33 4
105 17 2
105 32 4
103 30 2
102 20 2
101 10 2
100 19 2
98 30 4
96 10 2
95 11 2
95 10 2
95 14 2
93 18 4
92 15 2
91 22 3
91 24 2
89 23 3
88 15 2
88 20 2
87 13 2
87 9 2
86 14 2
86 9 1
85 8 2