facebookexperimental / resctl-demo
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 662 units with 14,781 lines of code in units (47.5% of code).
    • 17 very long units (2,781 lines of code)
    • 50 long units (3,403 lines of code)
    • 149 medium size units (4,730 lines of code)
    • 152 small units (2,192 lines of code)
    • 294 very small units (1,675 lines of code)
18% | 23% | 32% | 14% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs20% | 24% | 31% | 13% | 10%
py0% | 5% | 38% | 34% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
rd-agent/src18% | 20% | 32% | 17% | 11%
resctl-demo/src26% | 22% | 32% | 9% | 8%
resctl-bench/src12% | 36% | 25% | 13% | 10%
resctl-bench-intf/src67% | 0% | 27% | 4% | <1%
rd-hashd/src20% | 13% | 37% | 17% | 10%
rd-agent-intf/src29% | 0% | 31% | 17% | 21%
rd-util/src0% | 0% | 57% | 25% | 17%
rd-hashd-intf/src0% | 0% | 70% | 0% | 29%
rd-util0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
358 51 1
222 18 5
213 13 2
201 47 1
178 16 0
163 29 2
162 8 1
161 1 0
156 17 1
135 21 2
134 19 2
131 4 4
120 2 0
116 20 3
115 8 0
113 21 0
103 18 3
98 23 3
94 14 4
91 10 7
90 11 3
90 14 3
87 20 1
87 15 1
85 10 6
84 14 3
83 10 1
82 8 3
79 7 2
76 4 1
74 8 2
74 6 2
74 11 0
73 11 1
72 24 1
70 6 1
70 9 1
69 7 2
68 5 5
68 12 1
67 6 3
65 2 6
65 1 0
63 5 2
63 12 4
61 6 5
61 6 3
60 8 1
59 2 3
59 17 3