microsoft / gather
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 175 units with 1,876 lines of code in units (58.2% of code).
    • 2 very long units (209 lines of code)
    • 3 long units (196 lines of code)
    • 16 medium size units (491 lines of code)
    • 24 small units (326 lines of code)
    • 130 very small units (654 lines of code)
11% | 10% | 26% | 17% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts11% | 10% | 26% | 17% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/overlay16% | 0% | 31% | 23% | 28%
src/widgets/history41% | 26% | 25% | 0% | 6%
src/widgets/revision0% | 58% | 22% | 0% | 18%
src/main0% | 21% | 17% | 36% | 25%
src/persistence0% | 0% | 68% | 0% | 31%
src/widgets/slicedcell0% | 0% | 38% | 29% | 31%
src/util0% | 0% | 54% | 29% | 16%
src/model0% | 0% | 0% | 8% | 91%
src/widgets/codeversion0% | 0% | 0% | 48% | 51%
src/widgets/notification0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
onModelChange()
in src/overlay/gather-markers.ts
106 24 3
export function computeTextDiff()
in src/widgets/history/diff.ts
103 24 2
constructor()
in src/widgets/revision/widget.ts
74 9 1
export function buildHistoryModel()
in src/widgets/history/compute.ts
67 7 4
function activateExtension()
in src/main/main.ts
55 1 5
export function getCellsJsonForSlice()
in src/main/gather-actions.ts
45 11 2
constructor()
in src/widgets/slicedcell/widget.ts
42 6 1
function _loadExecutionFromJson()
in src/persistence/load.ts
39 11 1
function addLines()
in src/widgets/history/diff.ts
36 6 4
export function initToolbar()
in src/overlay/toolbar.ts
34 2 3
export function log()
in src/util/log.ts
34 10 2
highlightDependencies()
in src/overlay/gather-markers.ts
32 5 1
attachSliceWidgets()
in src/overlay/revision-browser.ts
32 4 1
private createButton()
in src/widgets/revision/widget.ts
29 1 3
constructor()
in src/widgets/history/widget.ts
28 3 1
highlightDef()
in src/overlay/gather-markers.ts
27 3 1
handleClick()
in src/overlay/gather-markers.ts
25 7 1
highlightOutput()
in src/overlay/gather-markers.ts
24 4 1
export function storeHistory()
in src/persistence/store.ts
22 2 2
private _registerCell()
in src/overlay/cell-listener.ts
21 6 1