novifinancial / winterfell
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 537 units with 5,737 lines of code in units (41.8% of code).
    • 3 very long units (332 lines of code)
    • 7 long units (430 lines of code)
    • 60 medium size units (1,787 lines of code)
    • 92 small units (1,348 lines of code)
    • 375 very small units (1,840 lines of code)
5% | 7% | 31% | 23% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs5% | 7% | 31% | 23% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
air/src19% | 6% | 44% | 12% | 17%
prover/src16% | 0% | 59% | 15% | 9%
math/src0% | 9% | 21% | 24% | 44%
fri/src0% | 24% | 12% | 44% | 19%
verifier/src0% | 68% | 0% | 15% | 16%
crypto/src0% | 0% | 30% | 30% | 39%
math/benches0% | 0% | 77% | 9% | 12%
crypto/benches0% | 0% | 0% | 100% | 0%
utils/core0% | 0% | 0% | 34% | 65%
fri/benches0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
121 2 0
110 1 2
101 1 0
72 7 0
65 6 4
65 12 1
64 3 3
56 1 0
56 1 0
52 1 0
46 1 0
45 5 2
44 6 1
44 1 0
41 1 2
41 3 4
39 1 0
39 1 0
39 10 1
39 1 0
38 1 3
37 2 0
34 5 2
34 1 0
34 1 0
34 2 2
33 1 0
33 3 0
33 1 0
32 1 0
32 1 0
32 5 2
32 1 0
32 3 2
31 6 1
31 6 1
31 3 0
30 1 0
30 2 1
30 3 0
30 1 3
28 3 3
28 3 2
28 2 4
27 4 1
27 4 1
26 1 0
25 1 0
25 1 0
24 1 0