aws-samples / aws-integrations-for-cloudknox
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 55 units with 1,016 lines of code in units (52.4% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (208 lines of code)
    • 16 medium size units (467 lines of code)
    • 15 small units (203 lines of code)
    • 21 very small units (138 lines of code)
0% | 20% | 45% | 19% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 20% | 45% | 19% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
aws-cloudknox-config/configrule0% | 36% | 23% | 16% | 23%
aws-cloudknox-controltower/lambda0% | 47% | 44% | 7% | 0%
aws-cloudknox-config/ssm0% | 0% | 65% | 24% | 9%
aws-cloudknox-config/lambda0% | 0% | 65% | 24% | 9%
aws-cloudknox-config/document0% | 0% | 59% | 28% | 11%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def evaluate_compliance()
in aws-cloudknox-config/configrule/CLOUDKNOX_PCI.py
70 16 3
def lambda_handler()
in aws-cloudknox-config/configrule/CLOUDKNOX_PCI.py
69 25 2
def lambda_handler()
in aws-cloudknox-controltower/lambda/CloudKnox_TriggerLifecycleEvent.py
69 14 2
def get_cloudknox_remediation_policies()
in aws-cloudknox-config/document/ck_right_size.py
42 3 3
def get_cloudknox_remediation_policies()
in aws-cloudknox-config/ssm/CloudKnox_IAMRightsize.py
42 3 3
def get_cloudknox_remediation_policies()
in aws-cloudknox-config/lambda/CloudKnox_IAMRightsize.py
42 3 3
def add_cloudknox_account()
in aws-cloudknox-controltower/lambda/CloudKnox_TriggerLifecycleEvent.py
34 2 8
def retrievePCI()
in aws-cloudknox-config/configrule/CLOUDKNOX_PCI.py
33 1 7
def get_access_token()
in aws-cloudknox-controltower/lambda/CloudKnox_TriggerLifecycleEvent.py
30 2 6
def clean_up_old_evaluations()
in aws-cloudknox-config/configrule/CLOUDKNOX_PCI.py
28 8 2
def clean_unused_iam_policies()
in aws-cloudknox-config/document/ck_right_size.py
27 8 3
def clean_unused_iam_policies()
in aws-cloudknox-config/ssm/CloudKnox_IAMRightsize.py
27 8 3
def getAccessToken()
in aws-cloudknox-config/configrule/CLOUDKNOX_PCI.py
27 1 6
def clean_unused_iam_policies()
in aws-cloudknox-config/lambda/CloudKnox_IAMRightsize.py
27 8 3
def get_access_token()
in aws-cloudknox-config/document/ck_right_size.py
22 2 1
def get_access_token()
in aws-cloudknox-config/ssm/CloudKnox_IAMRightsize.py
22 2 1
def get_access_token()
in aws-cloudknox-config/lambda/CloudKnox_IAMRightsize.py
22 2 1
def lambda_handler()
in aws-cloudknox-config/ssm/CloudKnox_IAMRightsize.py
21 2 2
def lambda_handler()
in aws-cloudknox-config/lambda/CloudKnox_IAMRightsize.py
21 2 2
def handler()
in aws-cloudknox-config/document/ck_right_size.py
18 2 2