microsoft / tsyringe
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 64 units with 799 lines of code in units (72.6% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 11 medium size units (363 lines of code)
    • 15 small units (216 lines of code)
    • 38 very small units (220 lines of code)
0% | 0% | 45% | 27% | 27%
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% | 45% | 27% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 0% | 54% | 25% | 20%
src/decorators0% | 0% | 38% | 21% | 40%
src/factories0% | 0% | 0% | 100% | 0%
src/providers0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public registerSingleton()
in src/dependency-container.ts
46 6 2
private resolveRegistration()
in src/dependency-container.ts
43 13 2
constructor()
in src/decorators/auto-injectable.ts
42 7 1
public registerSingleton()
in src/dependency-container.ts
42 6 2
public registerSingleton()
in src/dependency-container.ts
38 6 2
private resolveParams()
in src/dependency-container.ts
31 7 2
public register()
in src/dependency-container.ts
27 1 2
public resolve()
in src/dependency-container.ts
25 5 2
public createChildContainer()
in src/dependency-container.ts
24 4 0
public register()
in src/dependency-container.ts
23 1 2
public resolveAll()
in src/dependency-container.ts
22 4 2
private construct()
in src/dependency-container.ts
20 6 2
export default function predicateAwareClassFactory()
in src/factories/predicate-aware-class-factory.ts
20 4 1
public register()
in src/dependency-container.ts
19 1 3
private executePostResolutionInterceptor()
in src/dependency-container.ts
18 4 3
private executePreResolutionInterceptor()
in src/dependency-container.ts
15 4 2
public register()
in src/dependency-container.ts
14 1 3
function injectAllWithTransform()
in src/decorators/inject-all-with-transform.ts
13 1 3
public registerType()
in src/dependency-container.ts
13 2 2
public clearInstances()
in src/dependency-container.ts
13 2 0