Linux / Drivers / Vdpa
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 482 units with 6,746 lines of code in units (79.0% of code).
    • 3 very long units (369 lines of code)
    • 14 long units (870 lines of code)
    • 71 medium size units (2,157 lines of code)
    • 113 small units (1,585 lines of code)
    • 281 very small units (1,765 lines of code)
5% | 12% | 31% | 23% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c5% | 12% | 32% | 23% | 25%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
vdpa_user10% | 13% | 28% | 23% | 24%
mlx54% | 14% | 40% | 22% | 18%
vdpa_sim14% | 7% | 16% | 25% | 35%
ifcvf0% | 17% | 20% | 26% | 35%
virtio_pci0% | 18% | 20% | 18% | 42%
ROOT0% | 9% | 41% | 21% | 27%
alibaba0% | 0% | 35% | 24% | 40%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
148 30 3
116 22 3
105 15 2
77 13 8
75 7 1
71 14 2
64 9 3
64 9 3
62 9 2
61 9 2
61 6 3
60 12 3
59 5 2
57 9 1
56 13 1
52 10 2
51 9 2
50 10 3
50 8 1
49 7 2
48 5 1
47 6 3
47 9 1
46 5 1
45 5 3
44 4 5
43 5 1
43 6 1
41 10 2
40 4 3
39 8 5
38 7 2
38 4 1
38 7 2
37 7 2
36 6 1
36 7 2
35 5 1
35 2 1
33 3 2
32 4 2
32 7 2
31 3 3
31 5 2
31 8 2
31 4 2
29 3 3
28 3 5
28 3 2
27 6 2