microsoft / vscode-azure-iot-toolkit
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 436 units with 4,544 lines of code in units (18.6% of code).
    • 1 very long units (152 lines of code)
    • 7 long units (514 lines of code)
    • 52 medium size units (1,485 lines of code)
    • 61 small units (904 lines of code)
    • 315 very small units (1,489 lines of code)
3% | 11% | 32% | 19% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts4% | 11% | 33% | 18% | 32%
js0% | 12% | 22% | 29% | 35%
cs0% | 0% | 77% | 0% | 22%
py0% | 0% | 81% | 0% | 18%
go0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src5% | 14% | 33% | 18% | 29%
resources/simulator0% | 34% | 26% | 20% | 18%
src/simulatorwebview0% | 0% | 48% | 37% | 13%
src/Nodes0% | 0% | 27% | 10% | 62%
resources/code-template0% | 0% | 52% | 22% | 25%
external_lib/dummy-json0% | 0% | 24% | 27% | 48%
resources/welcome0% | 0% | 0% | 66% | 33%
src/Model0% | 0% | 0% | 0% | 100%
src/providers0% | 0% | 0% | 0% | 100%
src/Utility0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function activate()
in src/extension.ts
152 18 1
public async createIoTHub()
in src/iotHubResourceExplorer.ts
100 11 3
data()
in resources/simulator/main.js
95 9 0
75 20 4
private async deployAtScale()
in src/iotEdgeExplorer.ts
70 15 2
public async launch()
in src/simulator.ts
63 7 1
57 9 5
public async generateCode()
in src/codeManager.ts
54 7 1
private async sendD2C()
in src/simulatorwebview/localserver.ts
46 6 3
private async getDeploymentJson()
in src/iotEdgeExplorer.ts
41 10 1
async send()
in resources/simulator/main.js
40 5 0
public async getChildren()
in src/Nodes/TwinNode.ts
40 10 2
private invokeDirectMethod()
in src/iotHubDirectMethodExplorer.ts
39 7 3
38 3 1
37 8 1
async getPersistedInputs()
in resources/simulator/main.js
35 13 0
private done()
in src/deviceExplorer.ts
35 9 7
private initRouter()
in src/simulatorwebview/localserver.ts
35 1 0
35 4 3
public async getChildren()
in src/Nodes/ModuleLabelNode.ts
34 6 2