aws-samples / aws-ai-solution-kit
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 81 units with 1,983 lines of code in units (87.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 11 simple units (338 lines of code)
    • 70 very simple units (1,645 lines of code)
0% | 0% | 0% | 17% | 82%
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% | 0% | 29% | 70%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/infer-ocr/src0% | 0% | 0% | 28% | 71%
source/super-resolution-gpu/container0% | 0% | 0% | 55% | 44%
source/super-resolution-inf1/container0% | 0% | 0% | 55% | 44%
source/lib/s3_to_efs0% | 0% | 0% | 39% | 60%
source/lib0% | 0% | 0% | 0% | 100%
source/super-resolution-gpu0% | 0% | 0% | 0% | 100%
source/super-resolution-inf10% | 0% | 0% | 0% | 100%
source/infer-ocr0% | 0% | 0% | 0% | 100%
source/human-seg/src0% | 0% | 0% | 0% | 100%
source/super-resolution/src0% | 0% | 0% | 0% | 100%
source/porn-image0% | 0% | 0% | 0% | 100%
source/super-resolution0% | 0% | 0% | 0% | 100%
source/porn-image/src0% | 0% | 0% | 0% | 100%
source/human-seg0% | 0% | 0% | 0% | 100%
source/lib/custom_resource0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in source/lib/s3_to_efs/s3_to_efs.py
18 10 2
def decode()
in source/infer-ocr/src/postprocess/rec_postprocess.py
23 9 4
def __call__()
in source/infer-ocr/src/imaug/operators.py
21 8 2
def resize_image_type0()
in source/infer-ocr/src/imaug/operators.py
33 8 2
def __call__()
in source/infer-ocr/src/main.py
33 8 2
def __init__()
in source/infer-ocr/src/postprocess/rec_postprocess.py
35 7 4
def boxes_from_bitmap()
in source/infer-ocr/src/postprocess/db_postprocess.py
37 7 5
def __call__()
in source/super-resolution-gpu/container/model/predictor.py
50 7 3
def __call__()
in source/super-resolution-inf1/container/model/predictor.py
50 7 3
def __init__()
in source/infer-ocr/src/imaug/operators.py
9 6 6
def __call__()
in source/infer-ocr/src/main.py
29 6 2
def __call__()
in source/infer-ocr/src/infer_ocr_app.py
21 5 2
def lambda_handler()
in source/infer-ocr/src/infer_ocr_app.py
48 5 2
def create_operators()
in source/infer-ocr/src/imaug/__init__.py
13 5 2
def lambda_handler()
in source/super-resolution/src/super_resolution_app.py
45 5 2
def lambda_handler()
in source/porn-image/src/porn_image_app.py
40 4 2
def lambda_handler()
in source/human-seg/src/human_seg_app.py
52 4 2
def sorted_boxes()
in source/infer-ocr/src/infer_ocr_app.py
11 4 1
def transform()
in source/infer-ocr/src/imaug/__init__.py
8 4 2
def __init__()
in source/infer-ocr/src/imaug/operators.py
15 4 2