facebookincubator / velox
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 7,446 units with 84,711 lines of code in units (60.6% of code).
    • 29 very long units (3,751 lines of code)
    • 168 long units (11,405 lines of code)
    • 907 medium size units (28,138 lines of code)
    • 1,208 small units (17,553 lines of code)
    • 5,134 very small units (23,864 lines of code)
4% | 13% | 33% | 20% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp5% | 17% | 38% | 21% | 17%
h2% | 6% | 23% | 19% | 47%
py2% | 11% | 36% | 20% | 29%
c0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
velox/dwio5% | 16% | 32% | 20% | 24%
velox/functions3% | 15% | 40% | 19% | 22%
velox/exec5% | 8% | 38% | 26% | 22%
velox/experimental10% | 9% | 26% | 24% | 29%
velox/expression7% | 18% | 24% | 16% | 32%
velox/common2% | 6% | 28% | 21% | 40%
velox/substrait22% | 35% | 12% | 9% | 18%
build/fbcode_builder2% | 11% | 36% | 22% | 28%
velox/vector2% | 15% | 29% | 20% | 32%
velox/connectors12% | 5% | 21% | 30% | 29%
velox/type2% | 18% | 18% | 18% | 42%
velox/duckdb0% | 21% | 37% | 19% | 22%
velox/serializers0% | 17% | 59% | 9% | 12%
scripts0% | 12% | 48% | 4% | 33%
velox/parse0% | 12% | 26% | 21% | 39%
velox/row0% | 3% | 48% | 19% | 27%
velox/buffer0% | 16% | 13% | 21% | 48%
velox/benchmarks0% | 0% | 46% | 11% | 42%
velox/core0% | 0% | 3% | 27% | 68%
velox/codegen0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
206 28 10
202 45 4
165 41 3
153 38 2
146 1 1
146 27 3
139 48 0
138 22 6
137 21 2
130 11 1
129 16 1
129 35 6
128 13 3
120 11 8
120 24 6
120 38 1
119 26 3
118 23 2
114 10 1
113 22 1
113 22 3
113 15 6
112 29 0
111 7 5
111 26 4
107 13 5
105 26 0
105 10 5
102 28 4
100 16 2
97 18 5
95 12 3
95 23 3
95 6 5
94 18 5
94 19 6
94 17 1
93 19 6
92 18 3
92 28 3
92 14 3
91 38 5
89 13 1
89 18 3
89 15 5
87 20 4
87 25 3
87 7 0
87 24 8
85 13 6