aws-samples / aws-bootstrap-kit-examples
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 68 units with 1,671 lines of code in units (34.8% of code).
    • 4 very long units (456 lines of code)
    • 6 long units (516 lines of code)
    • 8 medium size units (276 lines of code)
    • 15 small units (230 lines of code)
    • 35 very small units (193 lines of code)
27% | 30% | 16% | 13% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts33% | 37% | 17% | 6% | 4%
java0% | 0% | 48% | 23% | 27%
tsx0% | 0% | 0% | 67% | 32%
js0% | 0% | 0% | 26% | 73%
php0% | 0% | 0% | 100% | 0%
m0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
4-containerized-service/cdk59% | 34% | 0% | 5% | 0%
5-unicornPics/backend35% | 0% | 47% | 13% | 2%
3-landing-page-cicd/cdk50% | 43% | 0% | 0% | 6%
2-landing-page/cdk100% | 0% | 0% | 0% | 0%
4-landing-page-with-feedback-api/infrastructure0% | 52% | 40% | 0% | 7%
per-stage-dns/lib0% | 76% | 0% | 13% | 10%
5-unicornPics/loadtesting0% | 97% | 0% | 0% | 3%
1-SDLC-organization/lib0% | 93% | 0% | 0% | 6%
5-unicornPics/mobileapp0% | 0% | 23% | 23% | 52%
4-landing-page-with-feedback-api/ui0% | 0% | 0% | 80% | 20%
5-unicornPics/webapp0% | 0% | 0% | 54% | 45%
4-containerized-service/php-fpm0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/4-containerized-service/cdk/lib/infrastructure-stack.ts
127 1 3
constructor()
in source/5-unicornPics/backend/lib/postsService/posts-service.ts
123 1 3
constructor()
in source/2-landing-page/cdk/lib/landing-page-stack.ts
103 4 3
constructor()
in source/3-landing-page-cicd/cdk/lib/landing-page-stack.ts
103 4 3
constructor()
in source/4-landing-page-with-feedback-api/infrastructure/lib/cicd-pipeline-stack.ts
97 13 3
constructor()
in source/per-stage-dns/lib/cicd-pipeline-stack.ts
97 13 3
constructor()
in source/5-unicornPics/loadtesting/lib/loadtesting.ts
97 1 3
constructor()
in source/3-landing-page-cicd/cdk/lib/cicd-stack.ts
89 12 3
constructor()
in source/4-containerized-service/cdk/lib/pipeline-stack.ts
74 5 3
constructor()
in source/1-SDLC-organization/lib/cicd-stack.ts
62 1 3
constructor()
in source/5-unicornPics/backend/lib/common/monitoring.ts
49 1 3
constructor()
in source/5-unicornPics/backend/lib/frontend/frontend.ts
43 1 2
constructor()
in source/5-unicornPics/backend/lib/frontend/frontend-config.ts
40 1 3
public static void initializeFlipper()
in source/5-unicornPics/mobileapp/android/app/src/debug/java/com/activateacademymobileapp/ReactNativeFlipper.java
39 3 2
constructor()
in source/5-unicornPics/backend/lib/common/auth.ts
31 1 2
constructor()
in source/4-landing-page-with-feedback-api/infrastructure/lib/surveyService/survey-service-stack.ts
29 1 3
constructor()
in source/4-landing-page-with-feedback-api/infrastructure/lib/frontend/frontend-config.ts
23 1 3
constructor()
in source/4-landing-page-with-feedback-api/infrastructure/lib/infrastructure-stack.ts
22 1 3
static async uploadFile()
in source/5-unicornPics/webapp/src/Api.tsx
19 1 1
private static void initializeFlipper()
in source/5-unicornPics/mobileapp/android/app/src/main/java/com/activateacademymobileapp/MainApplication.java
19 6 2