microsoft / PSRule-vscode
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 36 units with 367 lines of code in units (53.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (59 lines of code)
    • 3 medium size units (104 lines of code)
    • 4 small units (56 lines of code)
    • 28 very small units (148 lines of code)
0% | 16% | 28% | 15% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 16% | 28% | 15% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 16% | 28% | 15% | 40%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private checkExtension()
in src/extension.ts
59 9 1
private createTask()
in src/tasks.ts
41 3 9
function getCmd()
in src/tasks.ts
37 15 0
26 4 1
public get info()
in src/extension.ts
16 3 0
public resolveTask()
in src/tasks.ts
15 1 1
14 4 0
public dispose()
in src/extension.ts
11 4 0
static configure()
in src/configuration.ts
10 2 1
10 2 1
private loadSettings()
in src/configuration.ts
8 1 0
private write()
in src/logger.ts
8 2 3
public activate()
in src/extension.ts
7 1 1
public configure()
in src/powershell.ts
7 1 1
private getExtension()
in src/powershell.ts
7 1 0
public register()
in src/tasks.ts
7 1 0
private async exists()
in src/tasks.ts
7 1 1
public get()
in src/configuration.ts
6 2 0
private onConfigurationChanged()
in src/configuration.ts
6 2 1
constructor()
in src/powershell.ts
6 3 0