aws-samples / baseline-environment-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 42 units with 3,912 lines of code in units (81.8% of code).
    • 13 very long units (2,951 lines of code)
    • 7 long units (500 lines of code)
    • 6 medium size units (247 lines of code)
    • 10 small units (169 lines of code)
    • 6 very small units (45 lines of code)
75% | 12% | 6% | 4% | 1%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts76% | 12% | 6% | 3% | 1%
py0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
usecases/guest-webapp-sample/lib78% | 15% | 3% | 1% | <1%
usecases/guest-apiapp-sample/lib81% | 0% | 12% | 5% | 1%
usecases/base-standalone/lib65% | 22% | 6% | 2% | 2%
usecases/base-ct-guest/lib85% | 10% | 0% | 3% | 0%
tools/cicd/lib0% | 0% | 100% | 0% | 0%
usecases/guest-apiapp-sample/lambda0% | 0% | 0% | 100% | 0%
usecases/base-ct-audit/lib0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in usecases/guest-webapp-sample/lib/blea-dashboard-stack.ts
708 1 3
constructor()
in usecases/guest-apiapp-sample/lib/blea-lambda-python-stack.ts
273 1 3
constructor()
in usecases/guest-apiapp-sample/lib/blea-lambda-nodejs-stack.ts
265 1 3
constructor()
in usecases/base-standalone/lib/blea-iam-stack.ts
235 1 3
constructor()
in usecases/base-ct-guest/lib/blea-iam-stack.ts
235 1 3
constructor()
in usecases/base-standalone/lib/blea-security-alarm-stack.ts
218 1 3
constructor()
in usecases/base-ct-guest/lib/blea-security-alarm-stack.ts
218 1 3
constructor()
in usecases/guest-webapp-sample/lib/blea-ecsapp-stack.ts
191 1 3
constructor()
in usecases/guest-webapp-sample/lib/blea-frontend-ssl-stack.ts
137 1 3
constructor()
in usecases/guest-webapp-sample/lib/blea-asgapp-stack.ts
124 1 3
constructor()
in usecases/guest-webapp-sample/lib/blea-vpc-stack.ts
118 1 3
constructor()
in usecases/guest-webapp-sample/lib/blea-ec2app-stack.ts
117 2 3
constructor()
in usecases/guest-webapp-sample/lib/blea-frontend-simple-stack.ts
112 1 3
constructor()
in usecases/guest-webapp-sample/lib/blea-waf-stack.ts
96 1 3
constructor()
in usecases/base-standalone/lib/blea-trail-stack.ts
96 1 3
constructor()
in usecases/guest-webapp-sample/lib/blea-build-container-stack.ts
73 1 3
constructor()
in usecases/guest-webapp-sample/lib/blea-canary-stack.ts
61 1 3
constructor()
in usecases/guest-webapp-sample/lib/blea-db-aurora-pg-stack.ts
60 1 3
constructor()
in usecases/base-standalone/lib/blea-config-rules-stack.ts
57 1 3
constructor()
in usecases/base-ct-guest/lib/blea-config-rules-stack.ts
57 1 3