microsoft / chart-parts
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 581 units with 13,595 lines of code in units (81.7% of code).
    • 40 very long units (7,253 lines of code)
    • 23 long units (1,700 lines of code)
    • 53 medium size units (1,581 lines of code)
    • 106 small units (1,519 lines of code)
    • 359 very small units (1,542 lines of code)
53% | 12% | 11% | 11% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts57% | 11% | 9% | 10% | 11%
tsx0% | 32% | 35% | 21% | 10%
js0% | 0% | 95% | 0% | 4%
java0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/api-builder72% | 9% | 6% | 5% | 6%
packages/util-shapes47% | 13% | 12% | 20% | 6%
packages/docs-site0% | 56% | 12% | 21% | 9%
packages/docs-examples0% | 39% | 51% | 9% | 0%
packages/renderer-react-native-svg0% | 95% | 0% | 0% | 4%
packages/renderer-react-svg0% | 76% | 0% | 14% | 9%
packages/charts0% | 13% | 58% | 18% | 10%
packages/processing-vsvg0% | 0% | 56% | 26% | 16%
packages/docs-examples-mobile0% | 0% | 67% | 0% | 32%
packages/util-transform0% | 0% | 11% | 27% | 60%
packages/util-scales0% | 0% | 9% | 49% | 40%
packages/api-react0% | 0% | 43% | 45% | 11%
packages/processing-scenegraph0% | 0% | 22% | 12% | 65%
packages/processing-orchestrator0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
256 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
252 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
248 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
244 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
240 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
236 2 2
export function renderPath()
in packages/util-shapes/src/render.ts
235 30 5
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
232 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
228 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
224 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
220 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
216 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
212 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
208 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
204 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
200 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
196 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
192 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
188 2 2
public encode()
in packages/api-builder/src/api/MarkBuilder.ts
184 2 2