aws-samples / aws-reinforce2019-ppe-detection-demo
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 21 units with 195 lines of code in units (33.2% 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)
    • 0 simple units (0 lines of code)
    • 21 very simple units (195 lines of code)
0% | 0% | 0% | 0% | 100%
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% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/lambda0% | 0% | 0% | 0% | 100%
src0% | 0% | 0% | 0% | 100%
src/iot0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def detect_ppe()
in src/webcam_client.py
19 5 2
def lambda_handler()
in src/lambda/detection_function.py
15 5 2
def annotate_frame()
in src/webcam_client.py
13 4 2
def play_controlled_alarm()
in src/iot/subscribe.py
6 3 0
def get_label()
in src/lambda/detection_function.py
8 3 2
def annotate_img()
in src/lambda/notification_function.py
15 3 2
def lambda_handler()
in src/lambda/notification_function.py
19 3 2
def customCallback()
in src/iot/subscribe.py
9 2 3
def is_compliant()
in src/lambda/detection_function.py
6 2 1
def resize_bbox()
in src/webcam_client.py
7 1 2
def draw_bounding_box()
in src/webcam_client.py
4 1 5
def draw_label()
in src/webcam_client.py
9 1 6
def invoke_notifications()
in src/lambda/detection_function.py
10 1 4
def iot_publish()
in src/lambda/detection_function.py
9 1 2
def detect_labels()
in src/lambda/detection_function.py
6 1 1
def build_filename()
in src/lambda/notification_function.py
3 1 2
def resize_bbox()
in src/lambda/notification_function.py
8 1 2
def draw_bounding_box()
in src/lambda/notification_function.py
4 1 3
def upload_img_to_s3()
in src/lambda/notification_function.py
8 1 2
def upload_response_to_s3()
in src/lambda/notification_function.py
6 1 2