aws-samples / sagemaker-ml-workflow-with-apache-airflow
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 7 units with 168 lines of code in units (11.2% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (128 lines of code)
    • 0 medium size units (0 lines of code)
    • 1 small units (17 lines of code)
    • 4 very small units (23 lines of code)
0% | 76% | 0% | 10% | 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% | 76% | 0% | 10% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/pipeline0% | 82% | 0% | 10% | 7%
src0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 7 longest units
Unit# linesMcCabe index# params
def preprocess()
in src/pipeline/preprocess.py
73 3 5
def prepare()
in src/pipeline/prepare.py
55 6 6
def convert_sparse_matrix()
in src/pipeline/prepare.py
17 3 4
def is_hpo_enabled()
in src/dag_ml_pipeline_amazon_video_reviews.py
8 4 0
def save_as_protobuf()
in src/pipeline/prepare.py
7 1 4
def chunk()
in src/pipeline/prepare.py
4 2 2
def get_sagemaker_role_arn()
in src/dag_ml_pipeline_amazon_video_reviews.py
4 1 2