aws-samples / aws-shield-advanced-rapid-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 41 units with 1,236 lines of code in units (23.9% of code).
    • 2 very long units (263 lines of code)
    • 6 long units (393 lines of code)
    • 16 medium size units (453 lines of code)
    • 5 small units (76 lines of code)
    • 12 very small units (51 lines of code)
21% | 31% | 36% | 6% | 4%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py21% | 31% | 36% | 6% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
shield87% | 0% | 12% | 0% | 0%
fms28% | 33% | 33% | 2% | <1%
route530% | 43% | 56% | 0% | 0%
utility0% | 34% | 34% | 18% | 13%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in code/shield/enableConfigure/lambda/index.py
145 23 2
def lambda_handler()
in code/fms/fms-policy-waf-generator/lambda/index.py
118 18 2
def lambda_handler()
in code/fms/fms-mimic-shield-protect-global-accelerator/lambda/index.py
72 18 2
def lambda_handler()
in code/fms/fms-mimic-shield-protect-route53-hosted-zones/lambda/index.py
68 18 2
def source_ip_calculate()
in code/utility/generate_waf_logs.py
68 10 3
def lambda_handler()
in code/route53/route53-associate-shield-protection/lambda/index.py
67 15 2
def cfn_stack_manage()
in code/route53/cloudfront-config-proactive-engagement/lambda/remediate/cfn_stack_manage.py
64 5 4
def simulate_user()
in code/utility/get_fms_waf_policy.py
54 18 17
def simulate_user()
in code/utility/generate_waf_logs.py
50 16 17
def lambda_handler()
in code/route53/cloudfront-config-proactive-engagement/lambda/remediate/index.py
48 9 2
def lambda_handler()
in code/route53/cloudfront-config-proactive-engagement/lambda/check-compliance/index.py
39 5 2
def cloudfront_details()
in code/route53/cloudfront-config-proactive-engagement/lambda/remediate/resource_details.py
33 4 1
def generate_rule_match_data()
in code/utility/generate_waf_logs.py
29 10 4
def tag_check()
in code/fms/fms-mimic-shield-protect-global-accelerator/lambda/tag_check.py
25 22 2
def tag_check()
in code/fms/fms-mimic-shield-protect-route53-hosted-zones/lambda/tag_check.py
25 22 2
def tag_check()
in code/route53/cloudfront-config-proactive-engagement/lambda/check-compliance/tag_check.py
25 22 2
def send()
in code/fms/fms-policy-waf-generator/lambda/cfnresponse.py
23 3 6
def send()
in code/fms/fms-mimic-shield-protect-global-accelerator/lambda/cfnresponse.py
23 3 6
def send()
in code/fms/fms-mimic-shield-protect-route53-hosted-zones/lambda/cfnresponse.py
23 3 6
def write_to_log()
in code/utility/generate_waf_logs.py
23 4 2