fbsamples / original-coast-clothing
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 64 units with 1,114 lines of code in units (75.2% of code).
    • 1 very long units (157 lines of code)
    • 1 long units (93 lines of code)
    • 15 medium size units (459 lines of code)
    • 13 small units (215 lines of code)
    • 34 very small units (190 lines of code)
14% | 8% | 41% | 19% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js14% | 8% | 41% | 19% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
services14% | 8% | 41% | 18% | 17%
ROOT0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
handlePayload()
in services/curation.js
157 19 1
handlePayload()
in services/care.js
93 6 1
handlePayload()
in services/receive.js
50 13 1
handleTextMessage()
in services/receive.js
43 8 0
static handlePayload()
in services/order.js
41 5 1
handleMessage()
in services/receive.js
35 10 0
getMenuItems()
in services/profile.js
33 2 1
static async callSubscriptionsAPI()
in services/graph-api.js
33 3 1
static async postPersonaAPI()
in services/graph-api.js
27 3 2
genCurationResponse()
in services/curation.js
27 2 1
static async callSubscribedApps()
in services/graph-api.js
26 3 1
async setPersonas()
in services/profile.js
25 4 0
handlePrivateReply()
in services/receive.js
25 1 2
static async getUserProfile()
in services/graph-api.js
24 3 1
sendMessage()
in services/receive.js
24 3 2
static genAgentRating()
in services/survey.js
23 1 1
static handlePayload()
in services/survey.js
23 5 1
20 3 1
get newPersonas()
in services/config.js
20 1 0
static genGenericTemplate()
in services/response.js
19 1 4