microsoft / SandDance
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 755 units with 13,765 lines of code in units (64.2% of code).
    • 17 very long units (3,088 lines of code)
    • 37 long units (2,572 lines of code)
    • 100 medium size units (3,163 lines of code)
    • 182 small units (2,606 lines of code)
    • 419 very small units (2,336 lines of code)
22% | 18% | 22% | 18% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx35% | 16% | 20% | 13% | 13%
ts15% | 20% | 23% | 21% | 18%
py0% | 0% | 35% | 38% | 25%
js0% | 0% | 0% | 41% | 58%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/sanddance-explorer41% | 14% | 18% | 13% | 11%
packages/sanddance-specs29% | 26% | 19% | 13% | 10%
packages/sanddance0% | 15% | 28% | 30% | 24%
packages/sanddance-app0% | 33% | 31% | 10% | 24%
packages/powerbi0% | 35% | 27% | 18% | 18%
packages/vega-deck.gl0% | 13% | 22% | 25% | 37%
python/jupyter-widget0% | 0% | 37% | 36% | 26%
packages/sanddance-embed0% | 0% | 100% | 0% | 0%
extensions/azdata-sanddance0% | 0% | 54% | 36% | 8%
extensions/common-frontend0% | 0% | 52% | 29% | 18%
packages/chart-recommender0% | 0% | 37% | 44% | 17%
packages/search-expression0% | 0% | 17% | 48% | 34%
extensions/vscode-sanddance0% | 0% | 95% | 0% | 4%
extensions/common-backend0% | 0% | 41% | 39% | 19%
packages/sanddance-react0% | 0% | 0% | 54% | 45%
scripts0% | 0% | 0% | 35% | 64%
packages/sanddance-vue0% | 0% | 0% | 20% | 80%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function _Explorer()
in packages/sanddance-explorer/src/explorer.tsx
426 69 1
function load()
in packages/sanddance-explorer/src/palettes/sequentialMultiHue.tsx
323 1 0
function load()
in packages/sanddance-explorer/src/palettes/categorical.tsx
233 1 0
function load()
in packages/sanddance-explorer/src/palettes/diverging.tsx
203 1 0
public build()
in packages/sanddance-specs/src/layouts/wrap.ts
183 6 0
export default function()
in packages/sanddance-specs/src/charts/density.ts
169 13 1
export default function()
in packages/sanddance-specs/src/charts/barchartH.ts
166 11 1
export default function()
in packages/sanddance-specs/src/charts/barchartV.ts
165 11 1
public build()
in packages/sanddance-specs/src/layouts/scatter.ts
164 13 0
public build()
in packages/sanddance-specs/src/specBuilder.ts
155 12 0
public build()
in packages/sanddance-specs/src/layouts/cross.ts
154 3 0
public build()
in packages/sanddance-specs/src/layouts/stack.ts
150 1 0
const exportTypes:()
in packages/sanddance-explorer/src/controls/dataExporter.tsx
135 10 2
render()
in packages/sanddance-explorer/src/dialogs/snapshots.tsx
123 7 0
function load()
in packages/sanddance-explorer/src/palettes/sequentialSingleHue.tsx
123 1 0
public updateViewerOptions()
in packages/sanddance-explorer/src/explorer.tsx
114 30 1
public changeColumnMapping()
in packages/sanddance-explorer/src/explorer.tsx
102 22 3
render()
in packages/sanddance-explorer/src/explorer.tsx
98 19 0
render()
in packages/sanddance-app/src/dataSourcePicker.tsx
94 7 0
render()
in packages/sanddance-explorer/src/dialogs/search.tsx
92 6 0