pytorch / botorch
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 895 units with 7,443 lines of code in units (34.0% of code).
    • 0 very long units (0 lines of code)
    • 15 long units (907 lines of code)
    • 51 medium size units (1,499 lines of code)
    • 113 small units (1,598 lines of code)
    • 716 very small units (3,439 lines of code)
0% | 12% | 20% | 21% | 46%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 8% | 20% | 22% | 48%
js0% | 68% | 13% | 7% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
botorch/models0% | 11% | 17% | 24% | 46%
botorch/acquisition0% | 9% | 17% | 24% | 48%
botorch/utils0% | 9% | 20% | 23% | 46%
website/core0% | 55% | 26% | 8% | 9%
website/pages0% | 88% | 0% | 0% | 11%
scripts0% | 22% | 63% | 5% | 8%
botorch/optim0% | 0% | 25% | 18% | 55%
botorch/sampling0% | 0% | 32% | 24% | 43%
botorch/generation0% | 0% | 26% | 13% | 60%
botorch/posteriors0% | 0% | 0% | 6% | 93%
website/static0% | 0% | 0% | 56% | 44%
botorch0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
71 12 1
70 15 2
67 4 0
66 2 1
65 5 0
65 15 2
65 17 4
60 11 3
58 15 3
58 13 1
55 2 0
54 16 2
51 3 0
51 2 3
51 22 1
48 9 5
48 13 2
44 8 1
44 7 2
44 28 1
41 10 2
40 9 4
39 6 4
38 1 0
36 3 2
36 12 2
35 7 1
33 11 3
33 10 3
32 5 5
31 7 2
31 3 2
31 8 3
30 7 2
30 4 2
28 9 2
28 2 1
27 13 1
27 9 3
27 10 1
27 6 1
27 4 3
27 9 2
26 15 2
26 4 1
26 3 1
26 5 2
26 4 2
25 7 2
25 7 2