microsoft / tiny-calc
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 364 units with 4,081 lines of code in units (39.9% of code).
    • 0 very long units (0 lines of code)
    • 7 long units (553 lines of code)
    • 46 medium size units (1,334 lines of code)
    • 78 small units (1,161 lines of code)
    • 233 very small units (1,033 lines of code)
0% | 13% | 32% | 28% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 14% | 31% | 27% | 26%
js0% | 0% | 46% | 41% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/core/micro0% | 18% | 34% | 25% | 21%
packages/core/nano0% | 17% | 32% | 25% | 23%
common/scripts0% | 0% | 46% | 41% | 11%
experimental/graph/src0% | 0% | 32% | 20% | 47%
packages/common/datastructures0% | 0% | 22% | 30% | 46%
experimental/graph/bench0% | 0% | 41% | 48% | 10%
experimental/tree/src0% | 0% | 0% | 42% | 57%
experimental/tree/bench0% | 0% | 0% | 70% | 29%
packages/common/scheduler0% | 0% | 0% | 68% | 31%
packages/common/binary0% | 0% | 0% | 0% | 100%
packages/types/es0% | 0% | 0% | 0% | 100%
packages/types/type-utils0% | 0% | 0% | 0% | 100%
common/config/rush0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function scan()
in packages/core/nano/src/parser.ts
97 38 0
function rebuild()
in packages/core/micro/src/sheetlet.ts
96 32 2
function partitionNode()
in packages/core/micro/src/adjust-tree/delete.ts
95 40 6
function parseCellRef()
in packages/core/micro/src/formula.ts
72 35 1
function extractSegmentRange()
in packages/core/micro/src/permutation/index.ts
67 15 3
export function evaluate()
in packages/core/nano/src/interpreter.ts
64 22 5
function insertLeaf()
in packages/core/micro/src/adjust-tree/node.ts
62 7 5
function compileAST()
in packages/core/nano/src/compiler.ts
49 14 1
function deleteLeafRange()
in packages/core/micro/src/adjust-tree/delete.ts
47 7 4
export function forEachCellInColumns()
in packages/core/micro/src/matrix.ts
43 13 6
function _resolvePackageVersion()
in common/scripts/install-run.js
42 7 3
cellsChanged()
in packages/core/micro/src/sheetlet.ts
42 14 4
function installAndRun()
in common/scripts/install-run.js
38 5 4
export function validateNode()
in packages/core/micro/src/adjust-tree/validity.ts
38 7 4
function getItemFromRL()
in packages/core/micro/src/permutation/index.ts
37 7 3
indexOf()
in packages/core/micro/src/permutation/index.ts
36 9 1
export function ensureBalancedChildInNode()
in packages/core/micro/src/adjust-tree/node.ts
35 6 3
getPermutation()
in packages/core/micro/src/permutation/index.ts
35 9 1
function parseArgumentList()
in packages/core/nano/src/parser.ts
35 10 0
function reparent()
in packages/core/micro/src/adjust-tree/delete.ts
33 9 4