aws-samples / policy-as-code
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 53 units with 1,126 lines of code in units (42.8% of code).
    • 1 very long units (257 lines of code)
    • 6 long units (405 lines of code)
    • 4 medium size units (133 lines of code)
    • 11 small units (174 lines of code)
    • 31 very small units (157 lines of code)
22% | 35% | 11% | 15% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts82% | 17% | 0% | 0% | 0%
py0% | 42% | 16% | 21% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk/ide/lib82% | 17% | 0% | 0% | 0%
cdk/cicd0% | 98% | 0% | 0% | 1%
terraform/cicd0% | 98% | 0% | 0% | 1%
cdk/app/awsconfig0% | 26% | 18% | 20% | 34%
cdk/app0% | 0% | 100% | 0% | 0%
cdk/ide/lambda_functions0% | 0% | 21% | 47% | 31%
utils0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in cdk/ide/lib/ide-stack.ts
257 1 3
def __init__()
in cdk/cicd/Pipeline.py
77 1 5
def __init__()
in terraform/cicd/Base.py
76 3 5
def lambda_handler()
in cdk/app/awsconfig/S3_block_public_access.py
74 25 2
def __init__()
in terraform/cicd/Pipeline.py
62 1 5
def __init__()
in cdk/cicd/Base.py
61 3 5
constructor()
in cdk/ide/lib/cluster-stack.ts
55 1 3
def __init__()
in cdk/app/s3_deployment.py
43 4 4
def start_instance()
in cdk/ide/lambda_functions/c9DiskResize/lambda_function.py
37 7 1
def clean_up_old_evaluations()
in cdk/app/awsconfig/S3_block_public_access.py
28 8 2
def evaluate_compliance()
in cdk/app/awsconfig/S3_block_public_access.py
25 10 4
def main()
in utils/s3_force_delete.py
20 4 0
def poll_create()
in cdk/ide/lambda_functions/c9bootstrap/lambda_function.py
18 6 2
def create()
in cdk/ide/lambda_functions/c9DiskResize/lambda_function.py
18 4 2
def run_process()
in cdk/app/awsconfig/S3_block_public_access.py
18 3 1
def get_assume_role_credentials()
in cdk/app/awsconfig/S3_block_public_access.py
17 5 2
def create()
in cdk/ide/lambda_functions/c9bootstrap/lambda_function.py
16 4 2
def create()
in cdk/ide/lambda_functions/c9InstanceProfile/lambda_function.py
16 3 2
def poll_create()
in cdk/ide/lambda_functions/c9DiskResize/lambda_function.py
16 6 2
def convert_api_configuration()
in cdk/app/awsconfig/S3_block_public_access.py
13 5 1