Linux / Drivers / Scsi
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 11,536 units with 309,408 lines of code in units (41.4% of code).
    • 389 very long units (60,306 lines of code)
    • 1,131 long units (77,221 lines of code)
    • 3,218 medium size units (101,914 lines of code)
    • 3,048 small units (45,655 lines of code)
    • 3,750 very small units (24,312 lines of code)
19% | 24% | 32% | 14% | 7%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c19% | 25% | 33% | 14% | 7%
h9% | 2% | 12% | 19% | 54%
pl0% | 68% | 22% | 8% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT22% | 22% | 31% | 14% | 7%
qla2xxx24% | 29% | 29% | 11% | 5%
qla4xxx22% | 28% | 32% | 11% | 4%
aacraid33% | 23% | 27% | 9% | 5%
pm800135% | 24% | 24% | 11% | 3%
fnic27% | 16% | 31% | 16% | 7%
megaraid31% | 26% | 29% | 8% | 3%
bnx2fc26% | 28% | 30% | 11% | 3%
esas2r21% | 26% | 33% | 12% | 5%
qedf26% | 40% | 23% | 6% | 3%
hisi_sas16% | 25% | 30% | 18% | 9%
smartpqi16% | 23% | 35% | 14% | 10%
sym53c8xx_226% | 15% | 36% | 12% | 8%
aic94xx19% | 22% | 30% | 18% | 8%
be2iscsi16% | 33% | 36% | 10% | 2%
mpi3mr17% | 39% | 28% | 11% | 3%
libfc11% | 31% | 35% | 14% | 7%
qedi13% | 37% | 31% | 12% | 4%
arm14% | 27% | 33% | 15% | 9%
arcmsr15% | 29% | 33% | 17% | 3%
fcoe13% | 24% | 36% | 17% | 8%
isci7% | 18% | 32% | 27% | 14%
ufs4% | 15% | 43% | 21% | 15%
cxgbi13% | 24% | 35% | 18% | 7%
mvsas13% | 20% | 31% | 22% | 12%
ibmvscsi_tgt15% | 34% | 37% | 7% | 6%
ibmvscsi7% | 25% | 41% | 15% | 10%
bnx2i11% | 15% | 49% | 17% | 6%
cxlflash7% | 38% | 34% | 8% | 10%
lpfc12% | 32% | 34% | 14% | 6%
libsas7% | 17% | 40% | 24% | 9%
aic7xxx21% | 12% | 44% | 9% | 11%
pcmcia14% | 19% | 33% | 16% | 16%
bfa14% | 45% | 33% | 4% | 2%
device_handler11% | 11% | 57% | 13% | 5%
mpt3sas18% | 30% | 14% | 19% | 17%
csiostor0% | 29% | 35% | 22% | 12%
snic0% | 20% | 21% | 35% | 22%
elx0% | 21% | 36% | 18% | 22%
dpt0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
565 146 4
476 1 1
449 72 2
434 89 2
432 10 6
407 94 4
398 90 1
386 93 1
376 118 3
366 114 2
352 80 4
326 29 2
317 96 2
317 37 2
306 36 3
300 83 2
299 38 2
298 37 2
297 122 3
297 150 4
281 59 1
274 76 1
264 34 1
257 72 3
250 24 3
249 44 1
249 40 1
246 49 2
245 33 2
243 49 2
243 28 2
240 62 1
239 70 2
238 45 1
234 68 3
234 46 2
232 47 2
230 91 2
224 49 3
224 1 2
223 193 2
222 44 1
222 39 2
220 8 2
220 45 2
218 56 1
215 29 2
215 34 2
214 57 1
213 26 8