awslabs / compliant-framework-for-federal-and-dod-workloads-in-aws-govcloud-us
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 119 units with 3,379 lines of code in units (24.5% of code).
    • 3 very long units (438 lines of code)
    • 13 long units (947 lines of code)
    • 40 medium size units (1,317 lines of code)
    • 32 small units (478 lines of code)
    • 31 very small units (199 lines of code)
12% | 28% | 38% | 14% | 5%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py19% | 13% | 43% | 15% | 7%
ts7% | 40% | 34% | 12% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/repositories/compliant-framework-central-pipeline12% | 39% | 31% | 10% | 6%
source/lib17% | 49% | 29% | 1% | <1%
source/repositories93% | 0% | 0% | 0% | 6%
source/lib/account-vending-machine0% | 0% | 52% | 42% | 4%
source/lambda/avm_invite_govcloud_account0% | 0% | 87% | 12% | 0%
source/lambda/invite_accounts0% | 0% | 100% | 0% | 0%
source/lambda/avm_create_govcloud_account0% | 0% | 66% | 33% | 0%
source/lambda/avm_move_account0% | 0% | 76% | 18% | 5%
source/lambda/avm_get_ou0% | 0% | 59% | 20% | 20%
source/lambda/execute_state_machine0% | 0% | 100% | 0% | 0%
source/lib/solution-helper0% | 0% | 69% | 30% | 0%
deployment/framework-nuke0% | 0% | 28% | 53% | 18%
source/lambda/create_accounts0% | 0% | 67% | 32% | 0%
source/lambda/initialize_organization0% | 0% | 50% | 28% | 20%
source/lambda/solution_helper0% | 0% | 77% | 0% | 22%
source/lambda/verify_govcloud_api_keys0% | 0% | 0% | 100% | 0%
source/lambda/verify_sns_subscription0% | 0% | 0% | 100% | 0%
source/lambda/notify_success0% | 0% | 0% | 0% | 100%
source/lambda/notify_failure0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in source/repositories/compliant-framework-central-pipeline/lambda/create_update_stack/index.py
184 24 2
private configureParameterMetadata()
in source/lib/compliant-framework-stack.ts
132 1 0
def get_config()
in source/repositories/create_config.py
122 1 0
private addStepFunctionInitializeOrganization()
in source/lib/compliant-framework-stack.ts
99 1 0
private getSecurityBaselineActions()
in source/repositories/compliant-framework-central-pipeline/lib/environment-pipeline-stack.ts
99 7 0
private updateGrants()
in source/repositories/compliant-framework-central-pipeline/lib/environment-pipeline-stack.ts
88 2 0
def lambda_handler()
in source/repositories/compliant-framework-central-pipeline/lambda/stack_set_action/index.py
85 3 2
private addStepFunction()
in source/lib/compliant-framework-stack.ts
74 2 0
def lambda_handler()
in source/repositories/compliant-framework-central-pipeline/lambda/security_hub_invite_members/index.py
70 12 2
private addStepFunctionDeployFramework()
in source/lib/compliant-framework-stack.ts
68 1 0
private addStepFunctionCreateAccounts()
in source/lib/compliant-framework-stack.ts
67 1 0
private getFederationSupportActions()
in source/repositories/compliant-framework-central-pipeline/lib/environment-pipeline-stack.ts
67 3 0
private getInitializeCoreAccountsActions()
in source/repositories/compliant-framework-central-pipeline/lib/core-pipeline-stack.ts
63 2 0
private addStepFunctionInviteAccounts()
in source/lib/compliant-framework-stack.ts
58 1 0
private createPipeline()
in source/repositories/compliant-framework-central-pipeline/lib/environment-pipeline-stack.ts
57 4 0
def lambda_handler()
in source/repositories/compliant-framework-central-pipeline/lambda/copy_codecommit_repositories_to_s3/index.py
52 10 2
def lambda_handler()
in source/repositories/compliant-framework-central-pipeline/lambda/expand_s3_sources/index.py
49 6 2
private addStepFunctionNotifySuccess()
in source/lib/compliant-framework-stack.ts
45 1 2
private addStepFunctionNotifyFailure()
in source/lib/compliant-framework-stack.ts
45 1 2
private getInitializeOrganizationalUnitsActions()
in source/repositories/compliant-framework-central-pipeline/lib/environment-pipeline-stack.ts
45 11 0