awslabs / ec2-spot-workshops
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 291 lines of code in units (3.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (83 lines of code)
    • 3 medium size units (103 lines of code)
    • 5 small units (67 lines of code)
    • 7 very small units (38 lines of code)
0% | 28% | 35% | 23% | 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% | 28% | 35% | 23% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
workshops/ec2-auto-scaling-with-multiple-instance-types-and-purchase-options0% | 100% | 0% | 0% | 0%
content/rendering-with-batch0% | 0% | 40% | 47% | 12%
workshops/ecs-spot-capacity-providers0% | 0% | 68% | 0% | 31%
Alternative Visuals
Longest Units
Top 16 longest units
Unit# linesMcCabe index# params
def __init__()
in workshops/ec2-auto-scaling-with-multiple-instance-types-and-purchase-options/cdk/app.py
83 1 3
def index()
in workshops/ecs-spot-capacity-providers/webapp/app.py
46 3 0
def read_blend_rend_chunk()
in content/rendering-with-batch/batch/batch.files/job_submission.py
31 9 1
def parse_arguments()
in content/rendering-with-batch/batch/batch.files/job_submission.py
26 2 0
def submit_stitching_job()
in content/rendering-with-batch/batch/batch.files/job_submission.py
16 2 1
def submit_rendering_job()
in content/rendering-with-batch/batch/batch.files/job_submission.py
14 3 2
def show_execution_attempts()
in content/rendering-with-batch/rendering-with-batch.files/verifying_resilience.py
14 4 1
def build_job_kwargs()
in content/rendering-with-batch/batch/batch.files/job_submission.py
12 1 2
def get_jobs_in_array()
in content/rendering-with-batch/rendering-with-batch.files/verifying_resilience.py
11 4 1
def get_number_of_frames()
in content/rendering-with-batch/batch/batch.files/job_submission.py
8 2 1
def getInstanceLifecycle()
in workshops/ecs-spot-capacity-providers/webapp/app.py
8 2 2
def exit_gracefully()
in workshops/ecs-spot-capacity-providers/webapp/app.py
6 3 3
def calculate_array_job_size()
in content/rendering-with-batch/batch/batch.files/job_submission.py
5 2 0
def download_blender_file_from_s3()
in content/rendering-with-batch/batch/batch.files/job_submission.py
4 1 0
def checkSpotTermination()
in workshops/ecs-spot-capacity-providers/webapp/app.py
4 1 0
def __init__()
in workshops/ecs-spot-capacity-providers/webapp/app.py
3 1 1