aws-samples / automated-iot-fleet-provisioning-by-claim
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 42 units with 436 lines of code in units (41.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (107 lines of code)
    • 14 small units (211 lines of code)
    • 24 very small units (118 lines of code)
0% | 0% | 24% | 48% | 27%
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% | 24% | 48% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
SubTemplates/IoT/Lambdas/provision_device0% | 0% | 41% | 38% | 20%
SubTemplates/IoT/Lambdas/provision_device/client0% | 0% | 17% | 45% | 37%
SubTemplates/IoT/Lambdas/cert_rotation_monitor0% | 0% | 0% | 77% | 22%
SubTemplates/IoT/Lambdas/cert_rotation_hook0% | 0% | 0% | 89% | 10%
SubTemplates/IoT/Lambdas/bootstrap_generator0% | 0% | 0% | 76% | 23%
SubTemplates/IoT/Lambdas/provision_device/client/utils0% | 0% | 0% | 0% | 100%
SubTemplates/IoT/Lambdas/provision_hook0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def handler()
in SubTemplates/IoT/Lambdas/provision_device/app.py
33 4 2
def send()
in SubTemplates/IoT/Lambdas/provision_device/cfnresponse.py
26 3 6
def clearBootstrapPolicy()
in SubTemplates/IoT/Lambdas/provision_device/app.py
24 4 0
def __init__()
in SubTemplates/IoT/Lambdas/provision_device/client/provisioning_handler.py
24 4 2
def createModelBootstraps()
in SubTemplates/IoT/Lambdas/bootstrap_generator/app.py
20 3 1
def on_message_callback()
in SubTemplates/IoT/Lambdas/provision_device/client/provisioning_handler.py
20 6 2
def createBootstrapPolicy()
in SubTemplates/IoT/Lambdas/provision_device/app.py
19 1 0
def core_connect()
in SubTemplates/IoT/Lambdas/provision_device/client/provisioning_handler.py
17 2 1
def createClient()
in SubTemplates/IoT/Lambdas/provision_device/app.py
16 3 2
def createModelBootstraps()
in SubTemplates/IoT/Lambdas/provision_device/app.py
16 2 0
def deactivate_cert()
in SubTemplates/IoT/Lambdas/cert_rotation_monitor/app.py
15 5 1
def deactivate_cert()
in SubTemplates/IoT/Lambdas/cert_rotation_hook/app.py
14 5 1
def createTemplate()
in SubTemplates/IoT/Lambdas/provision_device/app.py
14 1 3
def handler()
in SubTemplates/IoT/Lambdas/cert_rotation_monitor/app.py
13 3 2
def assemble_certificates()
in SubTemplates/IoT/Lambdas/provision_device/client/provisioning_handler.py
13 1 2
def handler()
in SubTemplates/IoT/Lambdas/cert_rotation_hook/app.py
12 2 2
def createProductionPolicy()
in SubTemplates/IoT/Lambdas/provision_device/app.py
11 1 0
def cert_validation_test()
in SubTemplates/IoT/Lambdas/provision_device/client/provisioning_handler.py
11 1 1
def run_provisioning()
in SubTemplates/IoT/Lambdas/provision_device/client/main.py
10 4 1
def register_thing()
in SubTemplates/IoT/Lambdas/provision_device/client/provisioning_handler.py
9 2 3