microsoft / sarif-vscode-extension
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 86 units with 1,172 lines of code in units (40.1% of code).
    • 2 very long units (215 lines of code)
    • 3 long units (167 lines of code)
    • 10 medium size units (301 lines of code)
    • 17 small units (256 lines of code)
    • 54 very small units (233 lines of code)
18% | 14% | 25% | 21% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts12% | 18% | 30% | 20% | 18%
tsx38% | 0% | 9% | 27% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/extension17% | 25% | 25% | 19% | 12%
src/panel27% | 0% | 22% | 19% | 30%
src/shared0% | 0% | 34% | 37% | 27%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public async show()
in src/extension/panel.ts
113 15 0
render()
in src/panel/details.tsx
102 10 0
public async translateArtifactToLocal()
in src/extension/uriRebaser.ts
59 17 1
function activateDecorations()
in src/extension/index.ts
54 7 2
export async function update()
in src/extension/update.ts
54 12 0
export function augmentLog()
in src/shared/index.ts
50 8 2
constructor()
in src/panel/indexStore.ts
35 6 2
export async function activate()
in src/extension/index.ts
32 5 1
export async function loadLogs()
in src/extension/loadLogs.ts
32 6 2
export function regionToSelection()
in src/extension/regionToSelection.ts
32 6 2
function activateDiagnostics()
in src/extension/index.ts
29 3 3
render()
in src/panel/widgets.tsx
25 4 0
function activateVirtualDocuments()
in src/extension/index.ts
23 5 2
protected get filter()
in src/panel/resultTableStore.ts
22 5 0
export function detectUpgrade()
in src/extension/loadLogs.ts
21 9 3
function getHttpsProxyAgent()
in src/extension/update.ts
20 10 0
render()
in src/panel/widgets.tsx
20 8 0
render()
in src/panel/widgets.tsx
19 2 0
19 5 3
export function tryFastUpgradeLog()
in src/extension/loadLogs.ts
18 6 1