facebook / facebook-business-sdk-codegen
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 925 units with 7,566 lines of code in units (47.8% of code).
    • 2 very long units (316 lines of code)
    • 15 long units (1,002 lines of code)
    • 56 medium size units (1,647 lines of code)
    • 92 small units (1,303 lines of code)
    • 760 very small units (3,298 lines of code)
4% | 13% | 21% | 17% | 43%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js17% | 34% | 22% | 9% | 15%
java0% | 11% | 30% | 15% | 43%
py0% | 9% | 29% | 22% | 39%
php0% | 5% | 11% | 22% | 60%
rb0% | 0% | 19% | 15% | 65%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/processors33% | 46% | 13% | 1% | 4%
templates/java/src0% | 11% | 30% | 15% | 43%
templates/python/facebook_business0% | 9% | 29% | 22% | 39%
src/renderers0% | 59% | 32% | 0% | 7%
templates/php/src0% | 5% | 11% | 22% | 60%
templates/nodejs0% | 100% | 0% | 0% | 0%
templates/ruby/lib0% | 0% | 19% | 15% | 64%
templates/nodejs/src0% | 0% | 31% | 27% | 41%
src/loaders0% | 0% | 54% | 45% | 0%
src/common0% | 0% | 58% | 0% | 41%
templates/ruby/spec0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
175 39 2
141 26 2
94 20 2
85 26 4
78 21 2
74 14 5
74 17 3
70 19 2
69 9 7
69 17 1
61 4 5
60 30 3
60 8 5
53 6 1
52 13 2
52 19 1
51 12 1
50 12 2
47 14 1
46 6 3
44 4 1
44 17 1
43 26 4
38 13 3
38 16 2
38 7 0
37 7 0
36 19 3
36 8 2
35 4 2
34 6 0
34 4 3
34 6 0
33 10 1
32 11 3
32 9 0
32 16 2
32 8 2
31 13 1
30 6 1
28 5 6
28 5 1
28 5 3
27 4 0
27 7 1
27 6 2
27 4 1
26 6 1
26 12 2
26 6 1