Linux / Drivers / S390
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 3,141 units with 63,005 lines of code in units (62.0% of code).
    • 30 very long units (4,016 lines of code)
    • 196 long units (12,866 lines of code)
    • 770 medium size units (24,152 lines of code)
    • 914 small units (13,783 lines of code)
    • 1,231 very small units (8,188 lines of code)
6% | 20% | 38% | 21% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c6% | 20% | 38% | 22% | 11%
h0% | 4% | 16% | 14% | 64%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
crypto21% | 24% | 31% | 13% | 8%
net5% | 23% | 38% | 19% | 12%
block7% | 25% | 33% | 21% | 12%
cio<1% | 15% | 37% | 29% | 16%
char0% | 15% | 42% | 24% | 17%
scsi0% | 13% | 49% | 23% | 12%
virtio0% | 14% | 57% | 22% | 5%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
416 105 3
166 13 6
163 46 3
155 28 2
144 30 4
139 17 6
138 16 2
135 16 3
135 29 9
132 21 1
130 31 2
130 16 12
126 11 9
126 11 6
122 16 6
122 24 1
120 16 3
119 16 6
116 14 4
116 17 12
115 18 2
112 13 5
108 20 8
107 29 3
106 18 11
105 32 4
105 15 3
104 27 2
103 37 4
101 12 2
100 26 7
99 19 1
99 12 1
97 18 2
96 18 1
95 14 1
94 31 5
94 29 2
94 15 2
93 37 7
91 21 3
91 27 3
90 43 7
90 12 2
90 27 1
89 22 7
88 13 3
87 18 4
87 19 3
86 15 3