microsoft / vscode-css-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 836 units with 8,426 lines of code in units (80.4% of code).
    • 1 very long units (154 lines of code)
    • 13 long units (891 lines of code)
    • 79 medium size units (2,338 lines of code)
    • 170 small units (2,469 lines of code)
    • 573 very small units (2,574 lines of code)
1% | 10% | 27% | 29% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts1% | 10% | 27% | 29% | 30%
js0% | 0% | 0% | 92% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/services4% | 16% | 29% | 25% | 23%
src/parser0% | 6% | 25% | 31% | 37%
src/languageFacts0% | 14% | 44% | 28% | 13%
src0% | 0% | 40% | 50% | 8%
src/utils0% | 0% | 33% | 14% | 51%
build0% | 0% | 0% | 92% | 7%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private visitRuleSet()
in src/services/lint.ts
154 57 1
function computeFoldingRanges()
in src/services/cssFolding.ts
92 23 1
protected scanNext()
in src/parser/cssScanner.ts
83 26 1
public doComplete()
in src/services/cssCompletion.ts
83 29 4
export function toElement()
in src/services/selectorPrinting.ts
82 25 2
public getCompletionsForSelector()
in src/services/cssCompletion.ts
73 15 3
public getCompletionsForDeclarationValue()
in src/services/cssCompletion.ts
70 19 2
69 19 1
export function getColorValue()
in src/languageFacts/colors.ts
66 31 1
done: while()
in src/parser/cssParser.ts
60 23 1
done: while()
in src/parser/cssParser.ts
58 25 1
public _parseForward()
in src/parser/scssParser.ts
52 22 0
private getPropertyProposals()
in src/services/cssCompletion.ts
52 14 2
public _tryParseMixinReference()
in src/parser/lessParser.ts
51 17 1
48 16 1
public _parseMediaFeature()
in src/parser/cssParser.ts
47 17 0
public findDocumentSymbols()
in src/services/cssNavigation.ts
45 11 2
public visitNode()
in src/parser/cssSymbolScope.ts
44 15 1
public _parseUse()
in src/parser/scssParser.ts
44 18 0
public _parseMixinReference()
in src/parser/scssParser.ts
41 15 0