awslabs / sagemaker-handwritten-text-recognition
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 87 units with 1,371 lines of code in units (48.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (98 lines of code)
    • 7 simple units (214 lines of code)
    • 78 very simple units (1,059 lines of code)
0% | 0% | 7% | 15% | 77%
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% | 7% | 15% | 77%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sagemaker/src0% | 0% | 8% | 17% | 73%
deployment/solution-assistant/src0% | 0% | 0% | 0% | 100%
sagemaker/ground_truth/post-label0% | 0% | 0% | 0% | 100%
deployment/string-functions/src0% | 0% | 0% | 0% | 100%
sagemaker/ground_truth/pre-label0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def run_epoch()
in sagemaker/src/word_and_line_segmentation.py
55 13 7
def run_epoch()
in sagemaker/src/handwriting_line_recognition.py
43 12 7
def decode()
in sagemaker/src/utils.py
19 10 1
def draw_box()
in sagemaker/src/utils.py
29 10 4
def decode()
in sagemaker/src/handwriting_line_recognition.py
17 9 1
def _read_annotations()
in sagemaker/src/htr_dataset.py
23 8 3
def __getitem__()
in sagemaker/src/htr_dataset.py
43 7 2
def resize_image()
in sagemaker/src/utils.py
46 7 3
def _read_line_annotation()
in sagemaker/src/htr_dataset.py
37 6 2
def __init__()
in sagemaker/src/word_and_line_segmentation.py
12 5 4
def _convert_bb_list_to_max_bb()
in sagemaker/src/htr_dataset.py
11 5 2
def lambda_handler()
in sagemaker/ground_truth/post-label/lambda_function.py
38 4 2
def ssd_forward()
in sagemaker/src/word_and_line_segmentation.py
17 4 2
def draw_boxes_on_image()
in sagemaker/src/utils.py
32 4 3
def transform()
in sagemaker/src/handwriting_line_recognition.py
20 4 3
def run_word_segmentation_net()
in sagemaker/src/run_inference.py
37 4 6
def crop_images()
in sagemaker/src/run_inference.py
14 4 2
def on_create()
in deployment/string-functions/src/lambda.py
11 3 2
def delete_sagemaker_endpoint()
in deployment/solution-assistant/src/lambda.py
17 3 1
def delete_sagemaker_endpoint_config()
in deployment/solution-assistant/src/lambda.py
19 3 1