facebook / facebook-ios-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 3,160 units with 42,613 lines of code in units (42.5% of code).
    • 8 very long units (1,100 lines of code)
    • 44 long units (2,855 lines of code)
    • 475 medium size units (13,458 lines of code)
    • 967 small units (14,352 lines of code)
    • 1,666 very small units (10,848 lines of code)
2% | 6% | 31% | 33% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift2% | 6% | 31% | 33% | 25%
hpp0% | 17% | 18% | 54% | 10%
py0% | 0% | 56% | 7% | 35%
h0% | 0% | 22% | 21% | 56%
m0% | 0% | 7% | 35% | 56%
rb0% | 0% | 0% | 45% | 54%
mm0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
FBSDKCoreKit2% | 6% | 30% | 34% | 26%
FBSDKLoginKit5% | 6% | 39% | 24% | 23%
FBAEMKit3% | 18% | 44% | 24% | 9%
FBSDKGamingServicesKit0% | 3% | 22% | 47% | 27%
FBSDKShareKit0% | 2% | 26% | 27% | 42%
scripts0% | 0% | 39% | 19% | 41%
FBSDKCoreKit_Basics0% | 0% | 0% | 23% | 76%
testing0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
FBSDKTVOSKit0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
255 12 23
155 1 0
131 3 0
116 7 4
114 1 0
112 1 0
110 1 0
107 1 0
99 1 0
96 1 0
93 1 0
92 1 0
87 1 0
85 1 0
85 1 0
83 1 0
82 1 1
77 6 3
75 1 0
73 1 0
73 1 0
71 1 0
69 1 3
69 1 0
69 1 0
64 1 0
64 1 0
62 1 0
61 2 3
60 1 0
59 1 0
58 1 0
56 1 0
56 2 6
55 1 0
54 1 0
53 1 0
53 1 0
53 1 0
53 1 0
53 1 0
52 1 0
52 1 0
51 1 4
51 1 0
51 1 0
51 1 0
51 1 0
51 1 0
51 1 0