aws-samples / amazon-mwaa-workflow-demo
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 461 lines of code in units (60.3% of code).
    • 1 very long units (241 lines of code)
    • 1 long units (54 lines of code)
    • 3 medium size units (77 lines of code)
    • 3 small units (50 lines of code)
    • 8 very small units (39 lines of code)
52% | 11% | 16% | 10% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py52% | 11% | 16% | 10% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk_mwaa_blogpost73% | 16% | 8% | 0% | <1%
post_scripts0% | 0% | 38% | 47% | 14%
assets/mwaa_dags/dags/custom0% | 0% | 77% | 0% | 22%
assets/mwaa_dags/dags/scripts0% | 0% | 0% | 100% | 0%
assets/spark_scripts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 16 longest units
Unit# linesMcCabe index# params
def __init__()
in cdk_mwaa_blogpost/IAMStack.py
241 1 5
def __init__()
in cdk_mwaa_blogpost/DataLakeStack.py
54 2 4
def __init__()
in cdk_mwaa_blogpost/VPCStack.py
29 1 4
def execute()
in assets/mwaa_dags/dags/custom/glue_trigger_crawler_operator.py
24 6 2
def clean_vpc_sg()
in post_scripts/CleanUpScript.py
24 5 1
def download_dataset()
in assets/mwaa_dags/dags/scripts/mwaa_blogpost_data_pipeline.py
20 4 1
def main()
in post_scripts/CleanUpScript.py
18 10 0
def main()
in post_scripts/CreateMWAAVariables.py
12 5 0
def parse_arguments()
in assets/spark_scripts/SparkScript01.py
8 1 0
def main()
in assets/spark_scripts/SparkScript01.py
7 1 0
def __init__()
in assets/mwaa_dags/dags/custom/glue_trigger_crawler_operator.py
7 1 0
def transform_data()
in assets/spark_scripts/SparkScript01.py
6 1 3
def clean_mwaa_buckets()
in post_scripts/CleanUpScript.py
5 2 1
def replace_underscore()
in post_scripts/CreateMWAAVariables.py
2 1 1
def replace_underscore()
in post_scripts/CleanUpScript.py
2 1 1
def get_buckets()
in cdk_mwaa_blogpost/DataLakeStack.py
2 1 1