microsoft / vscode-languageserver-node
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,402 units with 13,681 lines of code in units (67.7% of code).
    • 6 very long units (1,205 lines of code)
    • 16 long units (1,086 lines of code)
    • 120 medium size units (3,580 lines of code)
    • 188 small units (2,722 lines of code)
    • 1,072 very small units (5,088 lines of code)
8% | 7% | 26% | 19% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts8% | 7% | 26% | 19% | 37%
js0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
client/src6% | 10% | 25% | 20% | 36%
jsonrpc/src14% | 2% | 27% | 19% | 35%
server/src15% | 9% | 29% | 12% | 32%
types/src0% | 0% | 20% | 28% | 51%
protocol/src0% | 0% | 25% | 5% | 68%
testbed/client0% | 0% | 93% | 0% | 6%
textDocument/src0% | 0% | 31% | 26% | 41%
testbed/server0% | 0% | 21% | 65% | 13%
build/npm0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function createMessageConnection()
in jsonrpc/src/common/connection.ts
345 62 4
protected createMessageTransports()
in client/src/node/main.ts
225 81 1
export function createConnection()
in server/src/common/server.ts
213 38 1
export function createConverter()
in client/src/common/protocolConverter.ts
200 1 3
public start()
in client/src/common/client.ts
112 22 0
public listen()
in server/src/common/proposed.notebooks.ts
110 30 1
private createProvider()
in client/src/common/proposed.diagnostic.ts
95 14 0
protected registerLanguageProvider()
in client/src/common/semanticTokens.ts
92 15 1
constructor()
in client/src/common/proposed.diagnostic.ts
74 23 3
export function resolve()
in server/src/node/files.ts
73 9 5
function _createConnection()
in server/src/node/main.ts
71 19 4
protected registerLanguageProvider()
in client/src/common/client.ts
70 12 1
public constructor()
in client/src/common/client.ts
69 8 3
private doInitialize()
in client/src/common/client.ts
67 14 2
triggerKind: asSignatureHelpTriggerKind()
in client/src/common/codeConverter.ts
67 17 1
function handleNotification()
in jsonrpc/src/common/connection.ts
64 23 1
protected registerLanguageProvider()
in client/src/common/client.ts
61 9 1
function asCompletionItem()
in client/src/common/codeConverter.ts
60 33 2
private cellStructureChanged()
in client/src/common/proposed.notebooks.ts
60 16 2
private async pullAsync()
in client/src/common/proposed.diagnostic.ts
55 17 1