facebook / chisel
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 566 units with 4,483 lines of code in units (86.5% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (243 lines of code)
    • 39 medium size units (1,214 lines of code)
    • 83 small units (1,219 lines of code)
    • 440 very small units (1,807 lines of code)
0% | 5% | 27% | 27% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 4% | 27% | 27% | 41%
mm0% | 27% | 27% | 24% | 21%
c0% | 0% | 0% | 52% | 48%
m0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
commands0% | 5% | 26% | 24% | 43%
Chisel/Chisel0% | 24% | 23% | 25% | 27%
ROOT0% | 0% | 29% | 41% | 29%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
75 12 3
65 19 2
52 11 3
51 16 3
48 26 3
46 2 1
44 12 1
43 1 1
42 13 2
40 12 2
39 1 1
37 6 4
37 5 1
35 12 2
35 1 1
35 12 2
34 2 3
34 6 3
34 6 1
33 8 1
32 5 1
31 11 2
31 14 3
30 1 1
30 6 2
29 10 4
28 2 3
27 11 1
27 1 1
26 3 3
26 6 3
25 1 5
25 4 3
25 5 1
25 1 5
25 8 1
24 5 2
23 7 0
23 8 1
22 1 0
22 1 3
21 1 3
21 5 3
20 4 1
20 4 1
20 1 3
20 1 1
20 5 3
20 5 2
20 4 1