aws-samples / aws-iot-core-lorawan
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 83 units with 2,601 lines of code in units (44.7% of code).
    • 6 very long units (953 lines of code)
    • 6 long units (398 lines of code)
    • 23 medium size units (746 lines of code)
    • 22 small units (328 lines of code)
    • 26 very small units (176 lines of code)
36% | 15% | 28% | 12% | 6%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py33% | 16% | 31% | 11% | 6%
js67% | 0% | 0% | 21% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
transform_binary_payload36% | 3% | 33% | 17% | 9%
gateway_watchdog59% | 35% | 0% | 4% | 0%
device_watchdog72% | 27% | 0% | 0% | 0%
timestream_for_transform_binary_payload0% | 89% | 0% | 0% | 10%
timestream0% | 50% | 29% | 0% | 20%
workshop0% | 0% | 71% | 28% | 0%
iotthingshadow0% | 0% | 88% | 0% | 11%
send_downlink_payload0% | 0% | 100% | 0% | 0%
transform_binary_payload_pilot_things0% | 0% | 100% | 0% | 0%
cayenneLPPDecoder0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_states()
in gateway_watchdog/cdkstack/lorawan_gateway_monitoring_detectormodel.py
238 1 1
def get_states()
in device_watchdog/cdkstack/lorawan_device_heartbeat_detectormodel.py
184 1 2
function DecodeElsysPayload()
in transform_binary_payload/src-payload-decoders/node/elsys.js
149 32 1
def dict_from_payload()
in transform_binary_payload/src-payload-decoders/python/elsys.py
135 39 2
def dict_from_payload()
in transform_binary_payload/src-payload-decoders/python/adeunis_ftd2.py
126 42 2
def dict_from_payload()
in transform_binary_payload/src-payload-decoders/python/adeunis_dc_v2.py
121 33 2
def __init__()
in gateway_watchdog/cdkstack/lorawan_connectivity_watchdog_stack.py
91 1 4
def lambda_handler()
in timestream_for_transform_binary_payload/src-lambda-write-to-timestream/app.py
70 2 2
def __init__()
in device_watchdog/cdkstack/lorawan_connectivity_watchdog_stack.py
69 1 4
def lambda_handler()
in timestream/src-lambda-write-to-timestream/app.py
62 2 2
def handler()
in gateway_watchdog/src_get_wireless_gateway_statistics_lambda/lambda.py
53 11 2
def dict_from_payload()
in transform_binary_payload/src-payload-decoders/python/globalsat_lt100.py
53 16 2
def dict_from_payload()
in transform_binary_payload/src-payload-decoders/python/dragino_lbt1.py
48 4 2
def lambda_handler()
in send_downlink_payload/src/app.py
47 11 2
def dict_from_payload()
in transform_binary_payload/src-payload-decoders/python/dragino_laq4.py
47 5 2
def lambda_handler()
in transform_binary_payload/src-iotrule-transformation/app.py
47 11 2
def dict_from_payload()
in transform_binary_payload/src-payload-decoders/python/meteo_helix.py
42 5 2
def lambda_handler()
in iotthingshadow/src-mapthingname/app.py
37 4 2
def lambda_handler()
in timestream/src-lambda-transform/app.py
36 5 2
def decode_digital_data()
in transform_binary_payload/src-payload-decoders/python/nas_um3080.py
35 9 2