aws-samples / amazon-sagemaker-edge-defect-detection-computer-vision
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 67 units with 1,361 lines of code in units (54.6% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (244 lines of code)
    • 9 simple units (407 lines of code)
    • 56 very simple units (710 lines of code)
0% | 0% | 17% | 29% | 52%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 0% | 17% | 29% | 52%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/cloud/pipelines/image_classification0% | 0% | 80% | 0% | 19%
src/edge0% | 0% | 13% | 65% | 21%
src/cloud/pipelines/semantic_segmentation0% | 0% | 0% | 42% | 57%
setup/lambda-custom-resource0% | 0% | 0% | 56% | 43%
src/edge/app0% | 0% | 0% | 20% | 79%
src/cloud/pipelines0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_pipeline()
in src/cloud/pipelines/image_classification/pipeline.py
222 15 5
def load_model()
in src/edge/run.py
22 11 2
26 10 2
def get_pipeline()
in src/cloud/pipelines/semantic_segmentation/pipeline.py
131 9 5
def __on_message__()
in src/edge/app/ota.py
25 9 4
23 8 2
def homepage()
in src/edge/run.py
37 7 0
def setup_agent()
in setup/lambda-custom-resource/prepare_dev_package_cr.py
58 7 2
def __process_job__()
in src/edge/app/ota.py
40 6 3
def download_config()
in src/edge/install.py
23 6 1
def prepare_device_package()
in setup/lambda-custom-resource/prepare_dev_package_cr.py
44 6 2
def augment_data()
in src/cloud/pipelines/semantic_segmentation/preprocessing.py
56 5 2
def predict()
in src/edge/app/edgeagentclient.py
25 5 4
def lambda_handler()
in setup/lambda-custom-resource/prepare_dev_package_cr.py
31 5 2
def main()
in src/cloud/pipelines/get_pipeline_definition.py
39 4 0
def main()
in src/cloud/pipelines/run_pipeline.py
64 4 0
def get_model_from_name()
in src/edge/run.py
7 4 2
def get_square_image()
in src/cloud/pipelines/semantic_segmentation/preprocessing.py
12 3 4
def get_square_image()
in src/cloud/pipelines/image_classification/preprocessing.py
13 3 1
def get_square_image()
in src/edge/run.py
13 3 1