awslabs / aws-bootstrap-kit
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 40 units with 1,160 lines of code in units (72.5% of code).
    • 1 very long units (146 lines of code)
    • 3 long units (227 lines of code)
    • 21 medium size units (687 lines of code)
    • 3 small units (42 lines of code)
    • 12 very small units (58 lines of code)
12% | 19% | 59% | 3% | 5%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts12% | 19% | 59% | 3% | 4%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/aws-bootstrap-kit/lib19% | 29% | 46% | 2% | 2%
source/aws-bootstrap-kit/lib/dns0% | 0% | 89% | 0% | 10%
source/aws-bootstrap-kit/lib/account-handler0% | 0% | 100% | 0% | 0%
cicd/lib0% | 0% | 100% | 0% | 0%
source/aws-bootstrap-kit/lib/validate-email-handler0% | 0% | 61% | 38% | 0%
integTests/validateEmailTest/lib0% | 0% | 0% | 100% | 0%
source/aws-bootstrap-kit0% | 0% | 0% | 0% | 100%
integTests/secureRootUserTest/lib0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/aws-bootstrap-kit/lib/organization-trail.ts
146 2 3
constructor()
in source/aws-bootstrap-kit/lib/account.ts
97 4 3
constructor()
in source/aws-bootstrap-kit/lib/organization.ts
75 1 2
constructor()
in source/aws-bootstrap-kit/lib/aws-config-recorder.ts
55 1 2
constructor()
in source/aws-bootstrap-kit/lib/organizational-unit.ts
46 1 3
export async function onEventHandler()
in source/aws-bootstrap-kit/lib/dns/delegation-record-handler/index.ts
42 6 1
private constructor()
in source/aws-bootstrap-kit/lib/account-provider.ts
40 1 2
export async function isCompleteHandler()
in source/aws-bootstrap-kit/lib/account-handler/index.ts
40 8 1
constructor()
in cicd/lib/cicd-stack.ts
39 1 3
private createOrganizationTree()
in source/aws-bootstrap-kit/lib/aws-organizations-stack.ts
38 6 3
async function changeRecord()
in source/aws-bootstrap-kit/lib/dns/delegation-record-handler/index.ts
37 2 1
constructor()
in source/aws-bootstrap-kit/lib/secure-root-user.ts
35 1 3
constructor()
in source/aws-bootstrap-kit/lib/validate-email-provider.ts
35 2 3
private addNotCompliancyNotificationMechanism()
in source/aws-bootstrap-kit/lib/secure-root-user.ts
34 1 4
constructor()
in source/aws-bootstrap-kit/lib/dns.ts
34 5 3
registerAsDelegatedAdministrator()
in source/aws-bootstrap-kit/lib/account.ts
33 1 2
constructor()
in source/aws-bootstrap-kit/lib/aws-organizations-stack.ts
31 5 3
private enableAWSServiceAccess()
in source/aws-bootstrap-kit/lib/organization.ts
31 1 1
export async function onEventHandler()
in source/aws-bootstrap-kit/lib/account-handler/index.ts
30 5 1
constructor()
in source/aws-bootstrap-kit/lib/dns/cross-account-zone-delegation-record-provider.ts
26 2 3