Linux / Drivers / Xen
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 1,009 units with 18,076 lines of code in units (78.9% of code).
    • 6 very long units (690 lines of code)
    • 41 long units (2,715 lines of code)
    • 243 medium size units (7,629 lines of code)
    • 286 small units (4,254 lines of code)
    • 433 very small units (2,788 lines of code)
3% | 15% | 42% | 23% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c3% | 15% | 42% | 23% | 14%
h0% | 0% | 0% | 25% | 74%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT5% | 16% | 41% | 23% | 13%
xen-pciback4% | 17% | 52% | 17% | 7%
xenbus0% | 12% | 40% | 28% | 19%
events0% | 6% | 32% | 28% | 32%
xenfs0% | 0% | 45% | 7% | 47%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
134 30 3
130 20 2
118 16 3
103 19 1
103 20 2
102 27 3
99 20 2
99 17 1
91 23 2
89 20 1
88 13 1
80 14 1
79 20 2
78 12 3
77 23 1
73 18 2
72 14 3
70 15 2
69 10 2
69 13 3
69 13 1
68 28 4
68 16 1
68 10 3
64 18 1
64 20 2
63 12 2
60 13 4
60 12 3
60 9 1
60 11 1
59 10 1
58 13 4
57 23 2
57 6 1
57 8 4
57 12 2
55 11 2
55 9 1
54 8 1
54 14 4
54 11 1
53 10 4
53 7 2
53 10 1
51 10 1
51 6 1
50 8 1
50 8 1
49 6 1