microsoft / TiltInteractionForMobileVisualization
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 195 units with 3,643 lines of code in units (60.4% of code).
    • 6 very long units (1,121 lines of code)
    • 10 long units (772 lines of code)
    • 22 medium size units (658 lines of code)
    • 36 small units (521 lines of code)
    • 121 very small units (571 lines of code)
30% | 21% | 18% | 14% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js30% | 21% | 18% | 14% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src44% | 23% | 15% | 8% | 7%
public7% | 17% | 20% | 24% | 30%
ROOT0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
395 85 0
function sandbox()
in src/sandbox.js
174 9 0
function displayYear()
in src/chart.js
156 28 1
function position()
in src/chart.js
152 45 1
function tiltHandler()
in src/index.js
143 33 1
function connectItem()
in public/bubblesets.js
101 32 3
100 18 0
this.createOutline = function()
in public/bubblesets.js
92 15 3
function redraw()
in src/countrySelector.js
87 25 0
79 10 0
function carousel()
in src/carousel.js
76 6 1
function doMarch()
in public/bubblesets.js
73 27 2
function rerouteLine()
in public/bubblesets.js
73 26 4
function position()
in src/carousel.js
72 8 1
function y_selector()
in src/chart.js
60 2 0
function x_selector()
in src/chart.js
60 2 0
function repeat()
in src/chart.js
40 9 0
function loadData()
in src/sandbox.js
38 2 0
function getRectDistSq()
in public/bubblesets.js
37 10 3
function toggleAnimate()
in src/sandbox.js
37 3 0