aws-samples / simple-game-studio-on-aws
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 10 units with 657 lines of code in units (66.5% of code).
    • 2 very long units (277 lines of code)
    • 4 long units (290 lines of code)
    • 2 medium size units (66 lines of code)
    • 1 small units (20 lines of code)
    • 1 very small units (4 lines of code)
42% | 44% | 10% | 3% | <1%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts42% | 44% | 10% | 3% | <1%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/constructs48% | 42% | 9% | 0% | 0%
lib/constructs/vcs54% | 45% | 0% | 0% | 0%
lib/stacks0% | 48% | 30% | 18% | 3%
Alternative Visuals
Longest Units
Top 10 longest units
Unit# linesMcCabe index# params
constructor()
in lib/constructs/jenkins.ts
175 3 3
constructor()
in lib/constructs/vcs/svn.ts
102 1 3
constructor()
in lib/constructs/workstation.ts
95 2 3
constructor()
in lib/constructs/vcs/perforce.ts
86 1 3
constructor()
in lib/constructs/backup.ts
56 1 2
constructor()
in lib/stacks/setup-stack.ts
53 1 3
constructor()
in lib/constructs/simple-ad.ts
33 1 3
constructor()
in lib/stacks/vcs-stack.ts
33 2 3
constructor()
in lib/stacks/cicd-stack.ts
20 1 3
constructor()
in lib/stacks/workstation-stack.ts
4 1 3