aws-samples / aws-cms-telemetry-demo
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 118 units with 1,176 lines of code in units (79.5% of code).
    • 1 very long units (107 lines of code)
    • 1 long units (56 lines of code)
    • 12 medium size units (354 lines of code)
    • 26 small units (330 lines of code)
    • 78 very small units (329 lines of code)
9% | 4% | 30% | 28% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py9% | 4% | 30% | 28% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT9% | 4% | 30% | 28% | 27%
utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in setupSingleVehicle.py
107 23 10
def main()
in test.py
56 6 0
def main()
in generateTelemetry.py
45 2 2
37 9 10
def cert_validation_test()
in provisioningHandler.py
33 3 1
32 7 4
def main()
in generateDTC.py
32 1 2
31 4 6
def createCognitoUser()
in cognitoHandler.py
29 4 5
28 8 4
def core_connect()
in provisioningHandler.py
23 1 1
def authenticateCognitoUser()
in cognitoHandler.py
22 3 5
def __init__()
in provisioningHandler.py
21 1 5
def assemble_certificates()
in provisioningHandler.py
21 3 2
def on_message_callback()
in provisioningHandler.py
20 5 2
17 4 5
def createRegionObject()
in payloadHandler.py
16 3 3
def createRole()
in iamHandler.py
15 3 4
def enable_error_monitor()
in provisioningHandler.py
14 3 1
def getTripPayload()
in payloadHandler.py
14 1 6