microsoft / maker.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 803 units with 8,411 lines of code in units (76.0% of code).
    • 2 very long units (281 lines of code)
    • 9 long units (575 lines of code)
    • 70 medium size units (2,113 lines of code)
    • 173 small units (2,443 lines of code)
    • 549 very small units (2,999 lines of code)
3% | 6% | 25% | 29% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts3% | 6% | 25% | 28% | 36%
js0% | 30% | 21% | 32% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
maker.js/src/core2% | 3% | 25% | 28% | 39%
playground/src6% | 3% | 25% | 33% | 30%
maker.js/src/models0% | 34% | 32% | 19% | 13%
maker.js/debug0% | 31% | 22% | 33% | 13%
playground/src/worker0% | 0% | 0% | 37% | 62%
fonts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function toSVG()
in packages/maker.js/src/core/svg.ts
154 23 2
function populateParams()
in packages/playground/src/playground.ts
127 17 1
constructor()
in packages/maker.js/src/models/Ellipse.ts
75 18 1
constructor()
in packages/maker.js/src/core/paths.ts
72 18 1
constructor()
in packages/maker.js/src/models/BezierCurve.ts
72 13 1
export function setProcessedModel()
in packages/playground/src/playground.ts
66 19 2
export function fillet()
in packages/maker.js/src/core/fillet.ts
65 17 4
export function findChains()
in packages/maker.js/src/core/chain.ts
63 13 2
populateParams: function()
in packages/maker.js/debug/viewer.js
56 9 1
constructor()
in packages/maker.js/src/models/Dogbone.ts
55 8 5
function getLargestArc()
in packages/maker.js/src/models/BezierCurve.ts
51 10 4
export function boundingHexagon()
in packages/maker.js/src/core/measure.ts
50 10 1
onPath: function()
in packages/maker.js/src/core/chain.ts
48 12 1
function breakAlongForeignPath()
in packages/maker.js/src/core/combine.ts
48 13 3
export function toPDF()
in packages/maker.js/src/core/pdf.ts
47 4 3
export function mirror()
in packages/maker.js/src/core/model.ts
45 16 3
export function dogbone()
in packages/maker.js/src/core/fillet.ts
44 10 4
function swapBezierPathsWithSeeds()
in packages/maker.js/src/core/chain.ts
42 10 2
function walkRecursive()
in packages/maker.js/src/core/model.ts
42 16 5
function convertChainsTo2D()
in packages/maker.js/src/core/openjscad.ts
41 11 2