facebookexperimental / libunifex
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 1,328 units with 9,067 lines of code in units (40.5% of code).
    • 0 very long units (0 lines of code)
    • 8 long units (501 lines of code)
    • 47 medium size units (1,303 lines of code)
    • 154 small units (2,142 lines of code)
    • 1,119 very small units (5,121 lines of code)
0% | 5% | 14% | 23% | 56%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp0% | 26% | 22% | 30% | 19%
hpp0% | 1% | 12% | 22% | 63%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/linux0% | 46% | 4% | 25% | 24%
include/unifex0% | 2% | 10% | 19% | 67%
source/win320% | 23% | 32% | 26% | 16%
include/unifex/linux0% | 0% | 20% | 33% | 46%
source0% | 0% | 42% | 43% | 13%
include/unifex/win320% | 0% | 24% | 28% | 46%
include/unifex/detail0% | 0% | 14% | 44% | 41%
include/unifex/win32/detail0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
96 18 1
72 10 0
60 16 1
57 10 0
56 12 0
55 12 0
53 8 0
52 14 0
44 7 1
44 7 1
40 9 0
40 9 0
36 8 2
35 2 0
34 3 1
33 5 1
33 5 1
33 8 2
32 24 1
32 24 1
32 6 0
31 6 1
30 17 0
30 3 1
29 9 0
28 3 0
27 3 0
27 5 1
27 2 1
26 5 1
26 6 2
25 4 1
25 6 1
25 5 0
25 5 1
25 5 1
25 5 0
24 5 2
24 6 1
24 6 1
24 7 1
24 5 0
23 4 0
23 4 0
23 6 2
22 9 2
22 6 1
22 7 1
22 7 1
22 3 0