microsoft / typescript-tslint-plugin
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 72 units with 762 lines of code in units (73.7% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (123 lines of code)
    • 7 medium size units (204 lines of code)
    • 15 small units (211 lines of code)
    • 48 very small units (224 lines of code)
0% | 16% | 26% | 27% | 29%
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% | 26% | 27% | 29%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 15% | 33% | 26% | 24%
src/runner0% | 16% | 18% | 29% | 36%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
69 20 1
public runTsLint()
in src/runner/index.ts
54 10 3
37 8 7
public decorate()
in src/plugin.ts
33 4 1
private getConfiguration()
in src/runner/index.ts
30 7 4
private loadLibrary()
in src/runner/index.ts
29 8 2
public setProject()
in src/settings.ts
28 6 2
26 4 3
21 6 3
public constructor()
in src/plugin.ts
19 1 5
18 5 3
17 2 2
16 5 1
private makeDiagnostic()
in src/plugin.ts
15 2 2
private getTsLintPaths()
in src/runner/index.ts
15 5 2
public ensureWatching()
in src/configFileWatcher.ts
14 4 1
create()
in src/index.ts
14 3 1
14 2 2
13 5 1
12 4 3