microsoft / cognitive-services-speech-sdk-js
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 1,324 units with 10,696 lines of code in units (61.6% of code).
    • 8 very long units (1,334 lines of code)
    • 10 long units (744 lines of code)
    • 66 medium size units (2,153 lines of code)
    • 137 small units (1,973 lines of code)
    • 1,103 very small units (4,492 lines of code)
12% | 6% | 20% | 18% | 41%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts12% | 5% | 20% | 18% | 42%
js0% | 89% | 0% | 0% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/common.speech18% | 12% | 27% | 14% | 27%
src/sdk/Audio30% | 0% | 19% | 20% | 29%
src/common.speech/Transcription19% | 7% | 13% | 15% | 43%
src/sdk5% | 0% | 10% | 21% | 62%
ROOT0% | 100% | 0% | 0% | 0%
src/sdk/Transcription0% | 6% | 28% | 32% | 32%
ci0% | 91% | 0% | 0% | 8%
src/common.browser0% | 8% | 32% | 25% | 32%
src/common0% | 0% | 21% | 5% | 73%
src/common.speech/ServiceMessages0% | 0% | 8% | 4% | 87%
src/audioworklet0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static fromSpeechSynthesisOutputFormatString()
in src/sdk/Audio/AudioOutputFormat.ts
390 36 1
private async receiveConversationMessageOverride()
in src/common.speech/Transcription/ConversationServiceAdapter.ts
215 47 0
public buildSsml()
in src/sdk/SpeechSynthesizer.ts
136 4 1
protected async receiveMessage()
in src/common.speech/SynthesisAdapterBase.ts
135 35 0
protected async processTypeSpecificMessages()
in src/common.speech/TranslationServiceRecognizer.ts
134 31 1
protected async processTypeSpecificMessages()
in src/common.speech/IntentServiceRecognizer.ts
120 22 1
protected async processTypeSpecificMessages()
in src/common.speech/SpeechServiceRecognizer.ts
102 17 1
protected async processTypeSpecificMessages()
in src/common.speech/TranscriptionServiceRecognizer.ts
102 16 1
protected async processTypeSpecificMessages()
in src/common.speech/DialogServiceAdapter.ts
100 19 1
private receiveDialogMessageOverride()
in src/common.speech/DialogServiceAdapter.ts
97 25 0
(function ()()
in gulpfile.js
94 1 1
public createOrJoin()
in src/common.speech/Transcription/ConversationManager.ts
84 16 4
protected async receiveMessage()
in src/common.speech/ServiceRecognizerBase.ts
79 23 0
public joinConversationAsync()
in src/sdk/Transcription/ConversationTranslator.ts
66 12 5
protected async sendAudio()
in src/common.speech/ServiceRecognizerBase.ts
60 17 1
(function ()()
in ci/version.js
57 25 1
private getSpeechRegionFromIntentRegion()
in src/common.speech/IntentConnectionFactory.ts
54 37 1
private static async GetResponseFromCache()
in src/common.browser/CertChecks.ts
53 11 3
public constructor()
in src/common.speech/ServiceRecognizerBase.ts
50 14 5
public constructor()
in src/common.browser/WebsocketConnection.ts
47 14 7