microsoft / vscode-iot-workbench
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 1,602 units with 26,315 lines of code in units (83.0% of code).
    • 8 very long units (2,709 lines of code)
    • 54 long units (3,695 lines of code)
    • 304 medium size units (9,586 lines of code)
    • 409 small units (5,975 lines of code)
    • 827 very small units (4,350 lines of code)
10% | 14% | 36% | 22% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js11% | 13% | 35% | 21% | 18%
ts7% | 15% | 39% | 24% | 13%
c0% | 79% | 0% | 14% | 6%
ino0% | 0% | 0% | 92% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
assets/modelRepository11% | 13% | 35% | 21% | 18%
views11% | 13% | 35% | 21% | 17%
src16% | 12% | 34% | 28% | 8%
src/Models8% | 20% | 37% | 20% | 13%
src/DigitalTwin0% | 13% | 43% | 27% | 16%
resources/templates0% | 35% | 0% | 57% | 6%
scripts/mdLinkChecker0% | 0% | 87% | 9% | 2%
src/common0% | 0% | 31% | 0% | 69%
scripts0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
(function(global, factory)()
in assets/modelRepository/vue.js
947 95 2
946 93 2
227 4 1
private static async _getARMParameters()
in src/Models/AzureUtility.ts
129 32 2
private flushDeviceConfig()
in src/Models/AZ3166Device.ts
124 22 2
function initDigitalTwin()
in src/extension.ts
120 1 2
function updateChildren()
in assets/modelRepository/vue.js
108 19 5
108 19 5
async configDeviceSettings()
in src/Models/RaspberryPiDevice.ts
100 19 0
function hydrate()
in assets/modelRepository/vue.js
98 34 4
function hydrate()
in views/vue.js
98 34 4
function parseFilters()
in assets/modelRepository/vue.js
96 38 1
96 38 1
function processAttrs()
in assets/modelRepository/vue.js
85 22 1
85 22 1
async InitializeProject()
in src/projectInitializer.ts
84 12 3
private flushDeviceConfigUnixAndMac()
in src/Models/AZ3166Device.ts
83 12 2
function _createElement()
in assets/modelRepository/vue.js
79 25 5
79 25 5
render: function render()
in assets/modelRepository/vue.js
78 29 1