aws-samples / aws-service-control-policies-deployment
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 16 units with 368 lines of code in units (86.4% of code).
    • 1 very long units (129 lines of code)
    • 2 long units (116 lines of code)
    • 3 medium size units (81 lines of code)
    • 0 small units (0 lines of code)
    • 10 very small units (42 lines of code)
35% | 31% | 22% | 0% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts57% | 29% | 13% | 0% | 0%
py0% | 35% | 35% | 0% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib57% | 29% | 13% | 0% | 0%
lib/custom_resources0% | 35% | 35% | 0% | 28%
Alternative Visuals
Longest Units
Top 16 longest units
Unit# linesMcCabe index# params
constructor()
in lib/setup-builder-account-stack.ts
129 1 3
constructor()
in lib/setup-member-account-stack.ts
65 1 3
def create_or_attach_scps()
in lib/custom_resources/create_and_attach_scp.py
51 9 3
def handler()
in lib/custom_resources/create_and_attach_scp.py
31 4 2
constructor()
in lib/setup-org-management-stack.ts
29 1 3
def get_current_policies()
in lib/custom_resources/create_and_attach_scp.py
21 7 1
def create_policies()
in lib/custom_resources/create_and_attach_scp.py
7 2 1
def attach_policies()
in lib/custom_resources/create_and_attach_scp.py
7 2 1
def assume_role()
in lib/custom_resources/create_and_attach_scp.py
6 1 2
def get_org_role()
in lib/custom_resources/create_and_attach_scp.py
4 1 0
def get_dict_from_key()
in lib/custom_resources/create_and_attach_scp.py
4 1 2
def get_policy()
in lib/custom_resources/create_and_attach_scp.py
3 1 2
def get_user_params()
in lib/custom_resources/create_and_attach_scp.py
3 1 1
def get_s3_bucket_name()
in lib/custom_resources/create_and_attach_scp.py
3 1 1
def get_action_name()
in lib/custom_resources/create_and_attach_scp.py
3 1 1
def get_job_id()
in lib/custom_resources/create_and_attach_scp.py
2 1 1