aws-samples / aws-iot-fleet-provisioning
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 50 units with 502 lines of code in units (70.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (102 lines of code)
    • 14 small units (203 lines of code)
    • 32 very small units (197 lines of code)
0% | 0% | 20% | 40% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 0% | 24% | 26% | 49%
py0% | 0% | 13% | 63% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
dotnet-core/AWS.IoT.FleetProvisioning0% | 0% | 74% | 0% | 25%
ROOT0% | 0% | 14% | 65% | 19%
dotnet-core/AWS.IoT.FleetProvisioning/Certificates0% | 0% | 86% | 0% | 13%
dotnet-core/AWS.IoT.FleetProvisioning/Provisioning0% | 0% | 0% | 59% | 40%
dotnet-core/AWS.IoT.FleetProvisioning/IoTClient0% | 0% | 0% | 23% | 76%
dotnet-core/AWS.IoT.FleetProvisioning/Extensions0% | 0% | 0% | 0% | 100%
utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def core_connect()
in provisioning_handler.py
26 2 1
public X509Certificate2 LoadX509Certificate()
in dotnet-core/AWS.IoT.FleetProvisioning/Certificates/CertificateLoader.cs
26 3 3
private static IHostBuilder CreateHostBuilder()
in dotnet-core/AWS.IoT.FleetProvisioning/Program.cs
26 1 1
public static async Task Main()
in dotnet-core/AWS.IoT.FleetProvisioning/Program.cs
24 3 1
def on_message_callback()
in provisioning_handler.py
19 5 2
def __init__()
in provisioning_handler.py
18 4 2
private void MessageCallback()
in dotnet-core/AWS.IoT.FleetProvisioning/Provisioning/DeviceProvisioningHandler.cs
18 3 1
def cert_validation_test()
in provisioning_handler.py
17 1 1
public async Task BeginProvisioningFlowAsync()
in dotnet-core/AWS.IoT.FleetProvisioning/Provisioning/DeviceProvisioningHandler.cs
16 2 1
private void RegisterThing()
in dotnet-core/AWS.IoT.FleetProvisioning/Provisioning/DeviceProvisioningHandler.cs
16 1 1
def enable_error_monitor()
in provisioning_handler.py
14 3 1
def assemble_certificates()
in provisioning_handler.py
13 1 2
def register_thing()
in provisioning_handler.py
13 2 3
def new_cert_pub_sub()
in provisioning_handler.py
13 2 1
private void AssembleCertificates()
in dotnet-core/AWS.IoT.FleetProvisioning/Provisioning/DeviceProvisioningHandler.cs
13 1 1
def basic_callback()
in provisioning_handler.py
11 4 4
private void InitializeClient()
in dotnet-core/AWS.IoT.FleetProvisioning/IoTClient/ProvisioningClient.cs
11 1 5
private void ClientOnMqttMsgPublishReceived()
in dotnet-core/AWS.IoT.FleetProvisioning/IoTClient/ProvisioningClient.cs
11 2 2
private void NewCertificatePublishAndSubscribe()
in dotnet-core/AWS.IoT.FleetProvisioning/Provisioning/DeviceProvisioningHandler.cs
10 1 0
10 4 1