aws-samples / aws-control-tower-org-setup-sample
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 43 units with 425 lines of code in units (49.8% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (130 lines of code)
    • 14 small units (198 lines of code)
    • 24 very small units (97 lines of code)
0% | 0% | 30% | 46% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 30% | 46% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/org_setup/resources0% | 0% | 32% | 45% | 22%
src/org_setup0% | 0% | 0% | 67% | 32%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def enable_all_policy_types()
in src/org_setup/resources/organizations.py
30 7 1
def create_detector()
in src/org_setup/resources/guardduty.py
29 5 1
def get_ai_optout_policy()
in src/org_setup/resources/organizations.py
26 5 1
def attach_ai_optout_policy()
in src/org_setup/resources/organizations.py
24 5 1
def register_delegated_administrators()
in src/org_setup/resources/organizations.py
21 4 2
def handler()
in src/org_setup/lambda_handler.py
19 4 3
def associate_admin_account()
in src/org_setup/resources/fms.py
17 4 2
def enable_organization_admin_account()
in src/org_setup/resources/securityhub.py
15 3 2
def enable_organization_admin_account()
in src/org_setup/resources/macie.py
15 3 2
def enable_aws_organizations_access()
in src/org_setup/resources/servicecatalog.py
15 3 1
def enable_organization_admin_account()
in src/org_setup/resources/guardduty.py
15 3 2
def enable_all_features()
in src/org_setup/resources/organizations.py
14 3 1
def enable_aws_service_access()
in src/org_setup/resources/organizations.py
14 4 1
def create_org_analyzer()
in src/org_setup/resources/accessanalyzer.py
13 3 1
def create_finding_aggregator()
in src/org_setup/resources/securityhub.py
13 3 1
def create_members()
in src/org_setup/resources/macie.py
13 4 3
def list_accounts()
in src/org_setup/resources/organizations.py
13 5 1
def enable_macie()
in src/org_setup/resources/macie.py
11 3 1
def enable_sharing_with_aws_organization()
in src/org_setup/resources/ram.py
11 3 1
def list_roots()
in src/org_setup/resources/organizations.py
10 3 1