awslabs / disaster-recovery-for-aws-iot
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 126 units with 2,569 lines of code in units (73.2% of code).
    • 2 very long units (220 lines of code)
    • 6 long units (429 lines of code)
    • 37 medium size units (1,097 lines of code)
    • 46 small units (603 lines of code)
    • 35 very small units (220 lines of code)
8% | 16% | 42% | 23% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py8% | 16% | 42% | 23% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/lambda/iot-dr-launch-solution51% | 0% | 25% | 23% | 0%
source/lambda/iot-dr-layer22% | 15% | 34% | 22% | 5%
source/lambda/iot-dr-r53-health-check0% | 82% | 0% | 0% | 17%
source/lambda/sfn-iot-mr-thing-crud0% | 85% | 0% | 14% | 0%
source/lambda/iot-dr-create-r53-checker0% | 41% | 45% | 6% | 6%
source/lambda/sfn-iot-mr-thing-group-crud0% | 40% | 14% | 38% | 6%
source/lambda/iot-mr-jitr0% | 36% | 17% | 40% | 6%
source/tools0% | 0% | 60% | 24% | 15%
source/lambda/iot-dr-region-syncer0% | 0% | 73% | 14% | 12%
source/lambda/iot-dr-custom-launch-solution0% | 0% | 100% | 0% | 0%
source/lambda/sfn-iot-mr-thing-type-crud0% | 0% | 35% | 64% | 0%
source/lambda/sfn-iot-mr-shadow-syncer0% | 0% | 47% | 52% | 0%
source/lambda/sfn-iot-mr-dynamo-trigger0% | 0% | 100% | 0% | 0%
source/lambda/iot-dr-missing-device-replication0% | 0% | 45% | 39% | 15%
source/lambda/iot-mr-cross-region0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in source/lambda/iot-dr-launch-solution/lambda_function.py
118 9 2
def create_thing_with_cert_and_policy()
in source/lambda/iot-dr-layer/device_replication.py
102 13 7
def lambda_handler()
in source/lambda/iot-dr-r53-health-check/iot-dr-r53-health-checker.py
94 17 2
def lambda_handler()
in source/lambda/sfn-iot-mr-thing-crud/lambda_function.py
86 18 2
def create_thing()
in source/lambda/iot-dr-create-r53-checker/lambda_function.py
69 2 5
def delete_thing()
in source/lambda/iot-dr-layer/device_replication.py
69 4 3
def lambda_handler()
in source/lambda/sfn-iot-mr-thing-group-crud/lambda_function.py
57 18 2
def create_iot_policy()
in source/lambda/iot-mr-jitr/lambda_function.py
54 4 2
def connection_start()
in source/tools/iot-dr-pubsub.py
46 3 1
def lambda_handler()
in source/lambda/iot-dr-custom-launch-solution/lambda_function.py
46 7 2
def lambda_handler()
in source/lambda/iot-dr-create-r53-checker/lambda_function.py
45 5 2
def compare_shadow()
in source/tools/iot-dr-shadow-cmp.py
43 10 4
def create_thing()
in source/lambda/iot-dr-layer/device_replication.py
42 10 5
def lambda_handler()
in source/lambda/iot-dr-region-syncer/iot-region-to-region-syncer.py
37 5 2
def lambda_handler()
in source/lambda/sfn-iot-mr-thing-type-crud/lambda_function.py
35 13 2
def create_registry_event()
in source/lambda/iot-dr-region-syncer/iot-region-to-ddb-syncer.py
34 7 4
def search_things()
in source/tools/iot-search-devices.py
32 5 1
def cfnresponse_send()
in source/lambda/iot-dr-launch-solution/lambda_function.py
32 4 6
def get_and_create_policy()
in source/lambda/iot-dr-layer/device_replication.py
32 3 3
def delete_policy()
in source/lambda/iot-dr-layer/device_replication.py
32 6 2