microsoft / cordova-simulate
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 431 units with 4,500 lines of code in units (28.1% of code).
    • 1 very long units (128 lines of code)
    • 6 long units (397 lines of code)
    • 51 medium size units (1,379 lines of code)
    • 85 small units (1,211 lines of code)
    • 288 very small units (1,385 lines of code)
2% | 8% | 30% | 26% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js2% | 8% | 30% | 26% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/sim-host15% | 8% | 17% | 21% | 37%
src/server0% | 12% | 34% | 22% | 29%
src/app-host0% | 30% | 20% | 29% | 18%
src/modules0% | 0% | 28% | 39% | 32%
tools/i18n0% | 0% | 45% | 23% | 31%
src/plugins0% | 0% | 32% | 50% | 17%
src0% | 0% | 89% | 0% | 10%
src/platforms0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function initialize()
in src/sim-host/ui/custom-elements.js
128 1 1
function setCordovaAndInitialize()
in src/app-host/app-host.js
88 17 1
module.exports.initialize = function()
in src/sim-host/protocol/socket.js
69 10 2
66 5 4
63 10 1
58 11 0
53 11 1
48 6 2
39 6 0
function _simulateTouchEvent()
in src/app-host/touch-events.js
38 8 2
LiveReload.prototype._onFileChanged = function()
in src/server/live-reload/live-reload.js
38 4 2
function updateLanguageXlfJson()
in tools/i18n/update.js
36 10 2
validateArgumentType: function()
in src/modules/utils.js
35 11 5
function hideDialog()
in src/modules/sim-host/dialog.js
33 8 1
copy: function()
in src/modules/utils.js
33 14 1
33 4 2
function compareArrays()
in src/server/utils/jsUtils.js
33 10 3
initialize: function()
in src/sim-host/ui/custom-elements.js
33 14 0
33 6 2
32 6 0