novifinancial / librabft_simulator
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 154 units with 1,811 lines of code in units (38.4% of code).
    • 1 very long units (161 lines of code)
    • 5 long units (363 lines of code)
    • 17 medium size units (510 lines of code)
    • 15 small units (222 lines of code)
    • 116 very small units (555 lines of code)
8% | 20% | 28% | 12% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs9% | 20% | 27% | 12% | 30%
py0% | 0% | 86% | 0% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
librabft-v2/src14% | 21% | 38% | 12% | 12%
bft-lib/src0% | 16% | 19% | 13% | 50%
node/src0% | 66% | 0% | 17% | 16%
network/src0% | 0% | 0% | 36% | 63%
bft-driver/src0% | 0% | 0% | 0% | 100%
crypto/src0% | 0% | 0% | 0% | 100%
mempool/src0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
161 4 3
100 1 0
86 8 3
71 11 4
53 11 3
53 2 1
50 10 6
40 1 1
38 2 0
37 3 2
34 5 1
31 4 2
30 1 6
29 2 3
28 2 2
25 1 3
25 3 3
25 6 4
25 6 1
25 3 3
24 4 2
23 3 4
21 2 2
20 2 4
20 1 2
19 4 2
18 3 2
15 5 2
14 1 4
14 1 6
14 2 3
14 1 2
14 2 2
13 2 2
13 1 3
12 1 2
11 2 2
11 4 2
10 1 6
10 2 2
10 1 0
10 1 6
10 1 4
10 2 1
9 1 2
9 1 2
9 2 1
9 1 3
9 1 1
8 1 1