fbsamples / messenger-platform-samples
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 37 units with 742 lines of code in units (60.2% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (132 lines of code)
    • 10 medium size units (273 lines of code)
    • 15 small units (243 lines of code)
    • 10 very small units (94 lines of code)
0% | 17% | 36% | 32% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 17% | 36% | 32% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
node0% | 28% | 31% | 26% | 13%
quick-start0% | 0% | 85% | 0% | 14%
handover_protocol/utils0% | 0% | 41% | 26% | 31%
inter-page/marketing-bot0% | 0% | 54% | 45% | 0%
webview0% | 0% | 35% | 65% | 0%
inter-page/support-bot0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
74 18 1
58 1 1
45 1 1
function handleMessage()
in quick-start/app.js
36 3 2
30 1 1
28 1 1
function call()
in handover_protocol/utils/api.js
25 7 3
function processComments()
in inter-page/marketing-bot/app.js
24 5 1
22 4 1
function callSendAPI()
in webview/app.js
21 2 2
function callSendAPI()
in quick-start/app.js
21 2 2
21 1 1
function handleMessage()
in webview/app.js
20 3 2
function callSendAPI()
in inter-page/support-bot/app.js
20 2 2
function callSendAPI()
in inter-page/marketing-bot/app.js
20 2 2
19 1 1
function sendQuickReply()
in handover_protocol/utils/quick-reply.js
16 1 4
16 3 3
16 1 1
16 1 1