facebook / kuduraft
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 6,472 units with 70,274 lines of code in units (46.4% of code).
    • 30 very long units (4,073 lines of code)
    • 110 long units (7,237 lines of code)
    • 706 medium size units (21,595 lines of code)
    • 1,152 small units (16,866 lines of code)
    • 4,474 very small units (20,503 lines of code)
5% | 10% | 30% | 24% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc7% | 11% | 33% | 24% | 22%
pl44% | 0% | 36% | 12% | 5%
h0% | 3% | 13% | 23% | 59%
py0% | 12% | 43% | 17% | 25%
c0% | 0% | 28% | 9% | 62%
js0% | 0% | 52% | 44% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/kudu/consensus13% | 10% | 30% | 23% | 21%
src/kudu/gutil5% | 4% | 21% | 24% | 44%
src/kudu/tools6% | 24% | 39% | 18% | 10%
src/kudu/fs14% | 13% | 27% | 18% | 26%
src/kudu/util1% | 6% | 27% | 27% | 37%
src/kudu/rpc3% | 11% | 33% | 23% | 28%
src/kudu/scripts20% | 0% | 41% | 14% | 23%
src/kudu/common0% | 35% | 42% | 13% | 8%
build-support/iwyu0% | 21% | 45% | 13% | 19%
src/kudu/security0% | 6% | 41% | 30% | 21%
src/kudu/server0% | 18% | 22% | 43% | 15%
build-support0% | 7% | 39% | 24% | 28%
src/kudu/tserver0% | 6% | 51% | 25% | 16%
src/kudu/thrift0% | 0% | 52% | 27% | 20%
src/kudu/experiments0% | 0% | 64% | 7% | 28%
src/kudu/clock0% | 0% | 24% | 39% | 36%
src/kudu/kserver0% | 0% | 64% | 21% | 13%
www0% | 0% | 52% | 44% | 4%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
199 34 3
176 32 0
173 37 3
168 46 0
167 66 5
166 55 5
159 33 5
155 22 2
155 28 1
152 26 6
152 23 3
150 43 5
134 28 2
131 23 0
130 42 3
128 31 0
127 22 2
127 26 2
124 9 7
121 15 2
118 27 12
111 21 3
111 27 7
108 13 2
108 11 2
107 26 3
105 35 1
105 5 3
103 18 2
103 20 1
100 49 7
99 19 1
99 20 0
97 29 0
94 12 1
92 19 0
91 1 1
90 23 3
87 19 5
86 1 0
86 1 0
86 26 1
85 5 1
85 14 2
84 19 1
82 17 1
82 15 4
81 19 3
80 6 3
79 14 2