microsoft / charticulator
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 2,063 units with 49,282 lines of code in units (40.3% of code).
    • 89 very long units (15,095 lines of code)
    • 157 long units (10,986 lines of code)
    • 370 medium size units (11,749 lines of code)
    • 395 small units (5,873 lines of code)
    • 1,052 very small units (5,579 lines of code)
30% | 22% | 23% | 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
ts30% | 19% | 25% | 12% | 12%
tsx31% | 26% | 21% | 10% | 9%
js0% | 0% | 40% | 22% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/app34% | 22% | 21% | 11% | 10%
src/core26% | 22% | 27% | 12% | 11%
src/worker0% | 54% | 23% | 6% | 16%
src/container0% | 0% | 24% | 41% | 34%
ROOT0% | 0% | 37% | 21% | 40%
src0% | 0% | 0% | 100% | 0%
src/fabric-icons0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export default function()
in src/app/stores/action_handlers/chart.ts
379 53 1
public renderLine()
in src/core/prototypes/plot_segments/axis.ts
373 77 5
export function renderGraphicalElementSVG()
in src/app/renderer/index.tsx
366 56 2
export default function()
in src/app/stores/action_handlers/document.ts
359 33 1
export function buildAxisWidgets()
in src/core/prototypes/plot_segments/axis.ts
348 20 6
private renderMarkPlaceholders()
in src/app/views/canvas/editing_link.tsx
307 23 0
private renderCurrentAttributeMapping()
in src/app/views/panels/widgets/fluent_mapping_editor.tsx
303 26 0
private getDefaultAnchor()
in src/app/views/panels/link_creator.tsx
300 35 7
public bindDataToAxis()
in src/app/stores/app_store.ts
297 70 1
public render()
in src/app/views/panels/widgets/fluentui_value_editor.tsx
286 29 0
public render()
in src/app/views/panels/legend_creator.tsx
269 17 0
public buildSublayoutWidgets()
in src/core/prototypes/plot_segments/region_2d/base.ts
247 16 1
public setMissedSortProperties()
in src/app/stores/migrator.ts
246 56 1
public render()
in src/app/views/panels/scales_panel.tsx
242 18 0
public build()
in src/app/template/index.ts
233 50 0
public renderInferences()
in src/app/views/file_view/export_view.tsx
229 15 0
export default function()
in src/app/stores/action_handlers/mark.ts
225 39 1
public renderPolar()
in src/app/views/canvas/handles/gap_ratio.tsx
222 9 0
public getGraphics()
in src/core/prototypes/marks/textbox.ts
222 32 4
export default function()
in src/app/stores/action_handlers/glyph.ts
209 26 1