facebook / instant-articles-builder
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 217 units with 2,827 lines of code in units (44.2% of code).
    • 1 very long units (105 lines of code)
    • 5 long units (378 lines of code)
    • 30 medium size units (925 lines of code)
    • 49 small units (713 lines of code)
    • 132 very small units (706 lines of code)
3% | 13% | 32% | 25% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js3% | 14% | 31% | 25% | 24%
php0% | 0% | 60% | 13% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/js/components14% | 23% | 26% | 16% | 18%
src/js0% | 11% | 33% | 27% | 27%
website/core0% | 90% | 0% | 0% | 10%
src/js/webview0% | 10% | 51% | 23% | 15%
src/js/utils0% | 0% | 26% | 57% | 15%
webserver0% | 0% | 60% | 13% | 25%
website/pages/en0% | 0% | 41% | 14% | 43%
src/js/models0% | 0% | 0% | 47% | 52%
src/js/data0% | 0% | 0% | 0% | 100%
src/js/containers0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
105 4 0
93 1 0
85 13 0
72 2 0
72 1 0
56 14 3
47 16 2
47 1 1
45 5 0
44 3 0
40 1 1
38 5 1
36 8 1
34 1 1
33 3 4
33 5 1
32 1 0
32 1 1
31 2 0
31 5 2
30 15 1
30 2 0
29 7 3
28 1 0
27 4 4
25 6 2
25 3 0
24 7 3
24 8 1
24 4 0
24 3 0
24 1 5
23 2 3
22 6 3
22 1 2
21 1 1
19 5 2
19 5 1
19 8 1
19 3 0
19 5 0
18 2 1
18 5 2
18 1 1
17 4 4
17 3 3
17 4 1
16 4 3
16 5 1
16 3 2