microsoft / xterm.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 584 units with 7,028 lines of code in units (62.0% of code).
    • 3 very long units (516 lines of code)
    • 14 long units (1,010 lines of code)
    • 63 medium size units (1,948 lines of code)
    • 107 small units (1,533 lines of code)
    • 397 very small units (2,021 lines of code)
7% | 14% | 27% | 21% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts7% | 14% | 27% | 21% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/core100% | 0% | 0% | 0% | 0%
src6% | 17% | 26% | 22% | 26%
src/renderer0% | 16% | 34% | 22% | 26%
src/shared0% | 76% | 0% | 17% | 6%
src/addons0% | 0% | 45% | 16% | 38%
src/ui0% | 0% | 26% | 25% | 47%
src/common0% | 0% | 29% | 27% | 43%
src/handlers0% | 0% | 16% | 37% | 46%
src/utils0% | 0% | 0% | 100% | 0%
src/public0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function evaluateKeyboardEvent()
in src/core/input/Keyboard.ts
280 106 4
public setOption()
in src/Terminal.ts
131 47 2
private _getWordAt()
in src/SelectionManager.ts
105 37 5
public charAttributes()
in src/InputHandler.ts
94 37 1
public print()
in src/InputHandler.ts
89 25 3
public open()
in src/Terminal.ts
86 4 1
public setMode()
in src/InputHandler.ts
83 27 2
public resetMode()
in src/InputHandler.ts
79 28 2
private _forEachCell()
in src/renderer/TextRenderLayer.ts
77 14 12
public bindMouse()
in src/Terminal.ts
76 21 0
export function generateStaticCharAtlasTexture()
in src/shared/atlas/CharAtlasGenerator.ts
70 11 3
public createRow()
in src/renderer/dom/DomRendererRowFactory.ts
67 17 6
function sendEvent()
in src/Terminal.ts
62 17 3
public resize()
in src/Buffer.ts
61 18 2
public setTheme()
in src/renderer/dom/DomRenderer.ts
60 3 1
public getJoinedCharacters()
in src/renderer/CharacterJoinerRegistry.ts
55 10 1
private _render()
in src/renderer/CursorRenderLayer.ts
51 15 2
protected _findInLine()
in src/addons/search/SearchHelper.ts
48 15 3
private _addLink()
in src/Linkifier.ts
46 6 5
private _setup()
in src/Terminal.ts
45 11 0