microsoft / vscode-html-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 720 units with 8,488 lines of code in units (74.1% of code).
    • 3 very long units (717 lines of code)
    • 12 long units (797 lines of code)
    • 61 medium size units (1,890 lines of code)
    • 185 small units (2,693 lines of code)
    • 459 very small units (2,391 lines of code)
8% | 9% | 22% | 31% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js8% | 6% | 22% | 31% | 31%
ts8% | 17% | 21% | 32% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/beautify/esm8% | 6% | 22% | 30% | 31%
src/beautify8% | 6% | 21% | 31% | 32%
src/parser42% | 19% | 4% | 13% | 20%
src/services0% | 20% | 27% | 35% | 16%
build0% | 0% | 33% | 56% | 10%
src/languageFacts0% | 0% | 36% | 31% | 32%
src0% | 0% | 81% | 0% | 18%
src/utils0% | 0% | 0% | 60% | 39%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Beautifier.prototype.beautify = function()
in src/beautify/beautify-css.js
252 89 0
Beautifier.prototype.beautify = function()
in src/beautify/esm/beautify-css.js
252 89 0
function internalScan()
in src/parser/htmlScanner.ts
213 63 0
export function parse()
in src/parser/htmlParser.ts
96 24 1
export function getFoldingRanges()
in src/services/htmlFolding.ts
81 26 2
72 40 5
Beautifier.prototype._set_tag_position = function()
in src/beautify/esm/beautify-html.js
72 40 5
documentation: localize()
in src/services/htmlCompletion.ts
66 31 2
function limitRanges()
in src/services/htmlFolding.ts
65 20 2
64 23 3
58 24 4
Beautifier.prototype._handle_inside_tag = function()
in src/beautify/esm/beautify-html.js
58 24 4
57 23 3
export function findDocumentLinks()
in src/services/htmlLinks.ts
57 19 2
function getAttributeLevelRanges()
in src/services/htmlSelectionRange.ts
51 14 3
function collectAttributeNameSuggestions()
in src/services/htmlCompletion.ts
50 12 2
var TagOpenParserToken = function()
in src/beautify/beautify-html.js
49 16 2
var TagOpenParserToken = function()
in src/beautify/esm/beautify-html.js
49 16 2
47 29 0
47 29 0