microsoft / BotFramework-DirectLineJS
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 43 units with 688 lines of code in units (49.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (51 lines of code)
    • 12 medium size units (404 lines of code)
    • 8 small units (109 lines of code)
    • 22 very small units (124 lines of code)
0% | 7% | 58% | 15% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 7% | 60% | 13% | 18%
js0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 7% | 58% | 15% | 18%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in src/directLine.ts
51 18 1
43 2 1
private pollingGetActivity$()
in src/directLine.ts
43 4 0
private checkConnection()
in src/directLine.ts
42 11 1
private postMessageWithAttachments()
in src/directLineStreaming.ts
42 5 1
private startConversation()
in src/directLine.ts
35 6 0
private observableWebSocket()
in src/directLine.ts
34 9 0
32 4 0
async processRequest()
in src/directLineStreaming.ts
28 5 2
private refreshToken()
in src/directLine.ts
27 3 0
private async refreshToken()
in src/directLineStreaming.ts
27 7 2
postActivity()
in src/directLineStreaming.ts
26 7 1
postActivity()
in src/directLine.ts
25 7 1
19 3 1
constructor()
in src/directLineStreaming.ts
15 2 1
constructor()
in src/directLine.mock.ts
14 2 2
13 2 1
ajax: wrapAjaxWithRetry()
in src/directLine.ts
13 4 2
setUserId()
in src/directLine.ts
13 4 1
play()
in src/directLine.mock.ts
11 1 2