aws-samples / aws-iot-device-provisioning-with-certificate-manager
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 40 units with 509 lines of code in units (46.2% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (61 lines of code)
    • 5 medium size units (140 lines of code)
    • 13 small units (194 lines of code)
    • 21 very small units (114 lines of code)
0% | 11% | 27% | 38% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 11% | 27% | 38% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
provisioning_lambda0% | 39% | 16% | 31% | 12%
example0% | 0% | 52% | 44% | 2%
deployment_lambda0% | 0% | 36% | 44% | 18%
provisioning_lambda/clients0% | 0% | 15% | 36% | 48%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def provisioning_handler()
in provisioning_lambda/lambda_function.py
61 7 2
def cf_handler()
in deployment_lambda/lambda_function.py
38 8 2
def main()
in example/provisioning_app.py
31 9 0
def get_config()
in provisioning_lambda/lambda_function.py
25 12 0
def create_policy()
in provisioning_lambda/clients/iot.py
24 1 4
def main()
in example/device.py
22 3 0
def get_request_body()
in provisioning_lambda/lambda_function.py
20 6 1
def register_ca()
in deployment_lambda/lambda_function.py
20 2 1
def issue_cert()
in provisioning_lambda/clients/acmpca.py
16 3 4
def disable_legacy_certificate()
in provisioning_lambda/clients/iot.py
16 4 2
def parse_response_data()
in example/device.py
16 2 2
def create_csr_key()
in provisioning_lambda/lambda_function.py
15 1 1
def parse_apig_paginator()
in example/provisioning_app.py
15 6 2
def create_csr()
in deployment_lambda/lambda_function.py
14 1 1
def invoke_certificate_api()
in example/provisioning_app.py
14 2 3
def record_device_info()
in provisioning_lambda/lambda_function.py
13 3 3
def register_iot_thing()
in provisioning_lambda/clients/iot.py
12 1 5
def send_response()
in deployment_lambda/lambda_function.py
12 5 4
def check_response()
in provisioning_lambda/clients/iot.py
11 2 1
def check_env()
in provisioning_lambda/lambda_function.py
10 4 0