microsoft / xterm.js
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 584 units with 7,028 lines of code in units (62.0% of code).
    • 1 very complex units (280 lines of code)
    • 5 complex units (492 lines of code)
    • 28 medium complex units (1,158 lines of code)
    • 44 simple units (1,136 lines of code)
    • 506 very simple units (3,962 lines of code)
3% | 7% | 16% | 16% | 56%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
ts3% | 7% | 16% | 16% | 56%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/core100% | 0% | 0% | 0% | 0%
src0% | 13% | 19% | 16% | 50%
src/renderer0% | 0% | 15% | 15% | 69%
src/shared0% | 0% | 76% | 0% | 23%
src/addons0% | 0% | 11% | 21% | 67%
src/ui0% | 0% | 18% | 12% | 68%
src/common0% | 0% | 0% | 29% | 70%
src/handlers0% | 0% | 0% | 23% | 76%
src/utils0% | 0% | 0% | 100% | 0%
src/public0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex 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
public charAttributes()
in src/InputHandler.ts
94 37 1
private _getWordAt()
in src/SelectionManager.ts
105 37 5
public resetMode()
in src/InputHandler.ts
79 28 2
public setMode()
in src/InputHandler.ts
83 27 2
public print()
in src/InputHandler.ts
89 25 3
public bindMouse()
in src/Terminal.ts
76 21 0
function getButton()
in src/Terminal.ts
43 20 1
function isWideBMP()
in src/CharWidth.ts
14 19 1
public resize()
in src/Buffer.ts
61 18 2
function sendEvent()
in src/Terminal.ts
62 17 3
public createRow()
in src/renderer/dom/DomRendererRowFactory.ts
67 17 6
private _onMouseMove()
in src/SelectionManager.ts
37 15 1
protected _findInLine()
in src/addons/search/SearchHelper.ts
48 15 3
private _render()
in src/renderer/CursorRenderLayer.ts
51 15 2
private _forEachCell()
in src/renderer/TextRenderLayer.ts
77 14 12
43 13 4
protected _keyPress()
in src/Terminal.ts
27 13 1
export function configEquals()
in src/renderer/atlas/CharAtlasUtils.ts
18 13 2