aws-samples / aws-reinforce2019-ppe-detection-demo
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 21 units with 195 lines of code in units (33.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 6 small units (92 lines of code)
    • 15 very small units (103 lines of code)
0% | 0% | 0% | 47% | 52%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 0% | 47% | 52%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/lambda0% | 0% | 0% | 46% | 53%
src0% | 0% | 0% | 61% | 38%
src/iot0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def detect_ppe()
in src/webcam_client.py
19 5 2
def lambda_handler()
in src/lambda/notification_function.py
19 3 2
def lambda_handler()
in src/lambda/detection_function.py
15 5 2
def annotate_img()
in src/lambda/notification_function.py
15 3 2
def annotate_frame()
in src/webcam_client.py
13 4 2
def send_notification()
in src/lambda/notification_function.py
11 1 3
def invoke_notifications()
in src/lambda/detection_function.py
10 1 4
def customCallback()
in src/iot/subscribe.py
9 2 3
def draw_label()
in src/webcam_client.py
9 1 6
def iot_publish()
in src/lambda/detection_function.py
9 1 2
def get_label()
in src/lambda/detection_function.py
8 3 2
def resize_bbox()
in src/lambda/notification_function.py
8 1 2
def upload_img_to_s3()
in src/lambda/notification_function.py
8 1 2
def resize_bbox()
in src/webcam_client.py
7 1 2
def play_controlled_alarm()
in src/iot/subscribe.py
6 3 0
def detect_labels()
in src/lambda/detection_function.py
6 1 1
def is_compliant()
in src/lambda/detection_function.py
6 2 1
def upload_response_to_s3()
in src/lambda/notification_function.py
6 1 2
def draw_bounding_box()
in src/webcam_client.py
4 1 5
def draw_bounding_box()
in src/lambda/notification_function.py
4 1 3