microsoft / roosterjs
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 813 units with 10,987 lines of code in units (63.1% of code).
    • 1 very long units (125 lines of code)
    • 16 long units (983 lines of code)
    • 151 medium size units (4,669 lines of code)
    • 184 small units (2,756 lines of code)
    • 461 very small units (2,454 lines of code)
1% | 8% | 42% | 25% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts1% | 8% | 43% | 24% | 22%
js0% | 21% | 30% | 33% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/roosterjs-editor-dom3% | 7% | 45% | 23% | 20%
packages/roosterjs-editor-plugins0% | 10% | 44% | 24% | 20%
tools/buildTools0% | 24% | 30% | 29% | 15%
packages/roosterjs-editor-api0% | 10% | 48% | 24% | 15%
packages/roosterjs-editor-core0% | 0% | 31% | 27% | 41%
tools0% | 0% | 32% | 62% | 4%
packages/roosterjs0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
edit()
in packages/roosterjs-editor-dom/lib/table/VTable.ts
125 32 1
async function buildDemoSite()
in tools/buildTools/buildDemo.js
91 2 0
private onKeyUpDomEvent()
in packages/roosterjs-editor-plugins/lib/plugins/Picker/PickerPlugin.ts
74 18 1
function output()
in tools/buildTools/dts.js
71 21 4
export default function createVListFromRegion()
in packages/roosterjs-editor-dom/lib/list/createVListFromRegion.ts
65 15 3
function adjustInsertPositionForStructuredNode()
in packages/roosterjs-editor-dom/lib/edit/adjustInsertPosition.ts
62 26 4
onPluginEvent()
in packages/roosterjs-editor-plugins/lib/plugins/ImageEdit/ImageEdit.ts
62 27 1
private processNode()
in packages/roosterjs-editor-dom/lib/htmlSanitizer/HtmlSanitizer.ts
61 23 3
const adjustSteps:()
in packages/roosterjs-editor-dom/lib/edit/adjustInsertPosition.ts
60 10 4
export default function insertEntity()
in packages/roosterjs-editor-api/lib/format/insertEntity.ts
57 13 6
private onKeyDownEvent()
in packages/roosterjs-editor-plugins/lib/plugins/Picker/PickerPlugin.ts
57 22 1
function clearInlineFormat()
in packages/roosterjs-editor-api/lib/format/clearFormat.ts
56 14 1
private handleMouseDownEvent()
in packages/roosterjs-editor-plugins/lib/plugins/TableCellSelection/TableCellSelection.ts
56 12 1
public onPluginEvent()
in packages/roosterjs-editor-plugins/lib/plugins/HyperLink/HyperLink.ts
55 24 1
private prepareSelection()
in packages/roosterjs-editor-plugins/lib/plugins/TableCellSelection/TableCellSelection.ts
53 11 0
public onPluginEvent()
in packages/roosterjs-editor-plugins/lib/plugins/Picker/PickerPlugin.ts
52 17 1
export default function applyTextStyle()
in packages/roosterjs-editor-dom/lib/inlineElements/applyTextStyle.ts
51 15 3
export default function replaceWithNode()
in packages/roosterjs-editor-api/lib/format/replaceWithNode.ts
50 10 5
export default function applyInlineStyle()
in packages/roosterjs-editor-api/lib/utils/applyInlineStyle.ts
50 16 3
function cacheGetNeighborEntityElement()
in packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/entityFeatures.ts
49 15 5