aws-samples / reinvent2021-tsa-bot
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 90 units with 1,650 lines of code in units (80.6% of code).
    • 3 very long units (612 lines of code)
    • 0 long units (0 lines of code)
    • 18 medium size units (504 lines of code)
    • 21 small units (290 lines of code)
    • 48 very small units (244 lines of code)
37% | 0% | 30% | 17% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py34% | 0% | 33% | 16% | 15%
js67% | 0% | 0% | 29% | 2%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
TSA-demo/TSA_mecha67% | 0% | 21% | 3% | 7%
cloudformation-templates/lib67% | 0% | 0% | 29% | 2%
TSA-demo/TSA_voice_assistant0% | 0% | 45% | 30% | 24%
TSA-demo/TSA_rekognition0% | 0% | 45% | 26% | 28%
TSA-demo/TSA_flight_status0% | 0% | 45% | 32% | 21%
cloudformation-templates/cdk.out/asset.34e613cbed9fe6d92140a799a0714c454ff967fe816d79cb9e5cef24fdb8ad220% | 0% | 48% | 30% | 21%
cloudformation-templates/resources/Lambda/update-flight-LasVegasdeparture0% | 0% | 48% | 30% | 21%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def getTFminiData()
in TSA-demo/TSA_mecha/finalflow-mqtt-dev-local.py
257 44 0
def getTFminiData()
in TSA-demo/TSA_mecha/finalflow-mqtt-dev-rasp.py
254 45 0
constructor()
in cloudformation-templates/lib/tsabot_service.js
101 1 2
def initialAvaIntroServo()
in TSA-demo/TSA_mecha/servo_actions_local.py
39 8 1
def initialAvaIntroServo()
in TSA-demo/TSA_mecha/servo_actions.py
39 8 1
def mqtt_subscribe()
in TSA-demo/TSA_rekognition/iot_sub_reko.py
38 7 0
def record_phrase()
in TSA-demo/TSA_voice_assistant/raspberry_voice_assistant_local.py
37 17 0
def record_phrase()
in TSA-demo/TSA_voice_assistant/raspberry_voice_assistant.py
37 16 0
def word()
in TSA-demo/TSA_voice_assistant/raspberry_voice_assistant_local.py
31 8 0
def word()
in TSA-demo/TSA_voice_assistant/raspberry_voice_assistant.py
31 8 0
def loadflights()
in cloudformation-templates/cdk.out/asset.34e613cbed9fe6d92140a799a0714c454ff967fe816d79cb9e5cef24fdb8ad22/flight.py
25 4 2
def loadflights()
in cloudformation-templates/resources/Lambda/update-flight-LasVegasdeparture/flight.py
25 4 2
def loadflights()
in TSA-demo/TSA_flight_status/flight.py
25 4 2
def main()
in TSA-demo/TSA_voice_assistant/raspberry_voice_assistant_local.py
24 8 0
def main()
in TSA-demo/TSA_voice_assistant/raspberry_voice_assistant.py
24 8 0
def wavmaker()
in TSA-demo/TSA_voice_assistant/waver.py
23 3 1
def detect_labels_local_file()
in TSA-demo/TSA_rekognition/detect_labels_image.py
22 5 1
def myNameisAvaServo()
in TSA-demo/TSA_mecha/servo_actions_local.py
21 2 1
def avagoodbye()
in TSA-demo/TSA_mecha/servo_actions_local.py
21 2 1
def myNameisAvaServo()
in TSA-demo/TSA_mecha/servo_actions.py
21 2 1