microsoft / parallel-prettier
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 15 units with 211 lines of code in units (66.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (128 lines of code)
    • 3 small units (47 lines of code)
    • 7 very small units (36 lines of code)
0% | 0% | 60% | 22% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 0% | 60% | 22% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 0% | 60% | 22% | 17%
Alternative Visuals
Longest Units
Top 15 longest units
Unit# linesMcCabe index# params
function runFormatting()
in src/worker.ts
39 5 2
23 4 1
function startMaster()
in src/index.ts
22 1 0
public format()
in src/worker-pool.ts
22 2 1
22 3 0
public update()
in src/progress-reporter.ts
19 6 1
private spawnWorker()
in src/worker-pool.ts
15 3 0
function runGlobs()
in src/master.ts
13 2 2
public complete()
in src/progress-reporter.ts
10 4 0
7 2 1
constructor()
in src/progress-reporter.ts
5 2 2
private getMessage()
in src/progress-reporter.ts
5 2 0
constructor()
in src/worker-pool.ts
3 1 1
public get maxSize()
in src/worker-pool.ts
3 1 0
private sortWorkers()
in src/worker-pool.ts
3 1 0