aws-samples / amazon-sagemaker-edge-defect-detection-computer-vision
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 67 units with 1,361 lines of code in units (54.6% of code).
    • 2 very long units (353 lines of code)
    • 3 long units (178 lines of code)
    • 15 medium size units (434 lines of code)
    • 15 small units (198 lines of code)
    • 32 very small units (198 lines of code)
25% | 13% | 31% | 14% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py25% | 13% | 31% | 14% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/cloud/pipelines/image_classification80% | 0% | 0% | 10% | 9%
src/cloud/pipelines/semantic_segmentation42% | 18% | 6% | 7% | 23%
src/cloud/pipelines0% | 58% | 35% | 0% | 5%
setup/lambda-custom-resource0% | 32% | 67% | 0% | 0%
src/edge0% | 0% | 78% | 7% | 13%
src/edge/app0% | 0% | 37% | 41% | 21%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_pipeline()
in src/cloud/pipelines/image_classification/pipeline.py
222 15 5
def get_pipeline()
in src/cloud/pipelines/semantic_segmentation/pipeline.py
131 9 5
def main()
in src/cloud/pipelines/run_pipeline.py
64 4 0
def setup_agent()
in setup/lambda-custom-resource/prepare_dev_package_cr.py
58 7 2
def augment_data()
in src/cloud/pipelines/semantic_segmentation/preprocessing.py
56 5 2
def prepare_device_package()
in setup/lambda-custom-resource/prepare_dev_package_cr.py
44 6 2
def __process_job__()
in src/edge/app/ota.py
40 6 3
def main()
in src/cloud/pipelines/get_pipeline_definition.py
39 4 0
def homepage()
in src/edge/run.py
37 7 0
def lambda_handler()
in setup/lambda-custom-resource/prepare_dev_package_cr.py
31 5 2
def __init__()
in src/edge/app/ota.py
30 3 8
26 10 2
def __on_message__()
in src/edge/app/ota.py
25 9 4
def predict()
in src/edge/app/edgeagentclient.py
25 5 4
def cfn_cleanup()
in setup/lambda-custom-resource/prepare_dev_package_cr.py
25 1 0
23 8 2
def download_config()
in src/edge/install.py
23 6 1
def send_response()
in setup/lambda-custom-resource/prepare_dev_package_cr.py
23 2 4
def load_model()
in src/edge/run.py
22 11 2
def model()
in src/cloud/pipelines/semantic_segmentation/train_tf.py
21 2 0