microsoft / vscode-json-languageservice
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 170 units with 3,676 lines of code in units (105.4% of code).
    • 3 very long units (369 lines of code)
    • 10 long units (755 lines of code)
    • 44 medium size units (1,518 lines of code)
    • 41 small units (610 lines of code)
    • 72 very small units (424 lines of code)
10% | 20% | 41% | 16% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts10% | 20% | 41% | 15% | 11%
js0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/services11% | 20% | 40% | 15% | 12%
src/utils0% | 31% | 41% | 18% | 8%
src0% | 0% | 100% | 0% | 0%
src/example0% | 0% | 100% | 0% | 0%
build0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public doComplete()
in src/services/jsonCompletion.ts
149 51 3
public resolveSchemaContent()
in src/services/jsonSchemaService.ts
112 27 2
export function getFoldingRanges()
in src/services/jsonFolding.ts
108 41 2
export function createRegex()
in src/utils/glob.ts
91 45 4
public findDocumentSymbols2()
in src/services/jsonDocumentSymbols.ts
82 24 3
public doHover()
in src/services/jsonHover.ts
80 31 3
private getInsertTextForProperty()
in src/services/jsonCompletion.ts
75 28 4
private getValueCompletions()
in src/services/jsonCompletion.ts
74 36 7
private addDefaultValueCompletions()
in src/services/jsonCompletion.ts
74 16 4
public doValidation()
in src/services/jsonValidation.ts
71 25 4
private getPropertyCompletions()
in src/services/jsonCompletion.ts
70 28 6
private getSchemaLessValueCompletions()
in src/services/jsonCompletion.ts
69 30 5
public findDocumentSymbols()
in src/services/jsonDocumentSymbols.ts
69 24 3
export function getLanguageService()
in src/jsonLanguageService.ts
49 5 1
private traverseNodes()
in src/services/jsonSchemaService.ts
49 15 2
export function equals()
in src/utils/objects.ts
49 18 2
id: localize()
in src/services/configuration.ts
48 2 2
$schema: localize()
in src/services/configuration.ts
47 2 2
title: localize()
in src/services/configuration.ts
46 2 2
description: localize()
in src/services/configuration.ts
45 2 2