facebookexperimental / reverie
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 606 units with 6,288 lines of code in units (27.6% of code).
    • 2 very long units (208 lines of code)
    • 10 long units (580 lines of code)
    • 53 medium size units (1,564 lines of code)
    • 116 small units (1,762 lines of code)
    • 425 very small units (2,174 lines of code)
3% | 9% | 24% | 28% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs3% | 9% | 24% | 28% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
reverie-ptrace/src6% | 10% | 34% | 25% | 22%
reverie-process/src0% | 6% | 20% | 34% | 38%
reverie-examples0% | 46% | 0% | 10% | 42%
reverie-syscalls/src0% | 3% | 11% | 27% | 56%
reverie-util/src0% | 43% | 0% | 41% | 15%
reverie/src0% | 0% | 9% | 21% | 68%
reverie-examples/strace0% | 0% | 0% | 100% | 0%
reverie-examples/chrome-trace0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
105 4 2
103 6 1
71 15 1
68 1 1
63 5 4
59 8 1
57 1 1
56 3 0
53 5 1
51 6 1
51 5 1
51 1 0
50 1 2
50 2 2
48 4 0
47 6 0
47 6 1
43 5 1
43 3 0
43 9 1
38 1 0
38 1 0
36 5 2
35 11 2
34 6 1
33 1 1
33 4 4
32 2 0
32 2 0
30 7 1
30 2 4
29 4 1
28 2 1
28 1 0
28 2 4
27 1 2
27 2 1
27 1 1
26 1 3
26 2 0
26 1 4
25 2 1
25 10 2
25 3 3
25 1 1
24 4 2
24 1 0
24 5 0
24 2 3
24 2 3