facebook / facebook-ruby-business-sdk
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 255 units with 2,548 lines of code in units (11.1% of code).
    • 1 very long units (121 lines of code)
    • 6 long units (403 lines of code)
    • 23 medium size units (727 lines of code)
    • 28 small units (376 lines of code)
    • 197 very small units (921 lines of code)
4% | 15% | 28% | 14% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rb4% | 15% | 28% | 14% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/facebook_ads/ad_objects/server_side7% | 25% | 34% | 14% | 17%
lib/facebook_ads0% | 0% | 14% | 19% | 66%
lib/facebook_ads/ad_objects/helpers0% | 0% | 75% | 0% | 24%
lib/facebook_ads/field_types0% | 0% | 32% | 0% | 67%
lib/facebook_ads/batch_api0% | 0% | 0% | 32% | 67%
lib/facebook_ads/helpers0% | 0% | 0% | 18% | 81%
lib/facebook_ads/videos0% | 0% | 0% | 0% | 100%
spec0% | 0% | 0% | 0% | 100%
lib0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
121 35 0
92 35 1
73 24 0
73 24 0
61 16 0
53 19 1
51 16 0
46 15 0
46 19 2
45 12 0
40 12 0
38 7 0
37 13 1
37 12 0
34 6 0
33 12 1
32 16 2
31 10 0
30 9 0
28 10 1
28 9 0
28 9 0
27 25 1
27 1 0
26 9 8
25 2 0
25 4 0
22 6 1
21 7 1
21 6 2
19 17 1
19 1 0
18 3 0
18 4 0
15 6 1
15 13 1
15 6 2
15 5 1
14 4 1
13 11 1
13 1 0
13 5 1
13 4 0
13 7 0
13 2 0
13 6 1
13 4 2
12 1 0
12 3 1
12 4 3