freertos / coreMQTT-Agent-Demos
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 391 units with 7,018 lines of code in units (52.0% of code).
    • 2 very long units (387 lines of code)
    • 29 long units (1,906 lines of code)
    • 71 medium size units (2,434 lines of code)
    • 72 small units (1,008 lines of code)
    • 217 very small units (1,283 lines of code)
5% | 27% | 34% | 14% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c7% | 34% | 41% | 12% | 4%
py0% | 0% | 48% | 7% | 43%
h0% | 0% | 0% | 24% | 75%
js0% | 0% | 0% | 50% | 50%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/defender-tools37% | 37% | 25% | 0% | 0%
lib/FreeRTOS/network_transport13% | 28% | 45% | 12% | <1%
source/demo-tasks0% | 54% | 32% | 10% | 2%
source0% | 16% | 56% | 15% | 12%
build/VisualStudio/target-specific-source0% | 37% | 50% | 11% | 0%
lib/AWS/ota-pal0% | 21% | 73% | 0% | 4%
source/subscription-manager0% | 45% | 54% | 0% | 0%
lib/AWS/tools0% | 0% | 43% | 12% | 44%
lib/FreeRTOS/utilities0% | 0% | 50% | 21% | 28%
build/Cortex-M3_MPS2_QEMU_GCC/target-specific-source0% | 0% | 5% | 28% | 65%
lib/FreeRTOS/mqtt-agent-interface0% | 0% | 40% | 60% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
eReportBuilderStatus eGenerateJsonReport()
in source/defender-tools/report_builder.c
220 24 7
static TlsTransportStatus_t tlsSetup()
in lib/FreeRTOS/network_transport/freertos_plus_tcp/using_mbedtls_pkcs11/using_mbedtls_pkcs11.c
167 23 3
static BaseType_t prvSocketConnect()
in source/mqtt-agent-task.c
90 11 1
static bool prvCollectDeviceMetrics()
in source/demo-tasks/defender_demo.c
84 12 1
static CK_RV initializeClientKeys()
in lib/FreeRTOS/network_transport/freertos_plus_tcp/using_mbedtls_pkcs11/using_mbedtls_pkcs11.c
81 14 1
static eReportBuilderStatus prvWritePortsArray()
in source/defender-tools/report_builder.c
80 9 5
static void prvSimpleSubscribePublishTask()
in source/demo-tasks/simple_sub_pub_demo.c
76 5 1
void vTCPLoggingPrintf()
in build/VisualStudio/target-specific-source/logging_output_windows.c
75 12 2
TlsTransportStatus_t TLS_FreeRTOS_Connect()
in lib/FreeRTOS/network_transport/freertos_plus_tcp/using_mbedtls/using_mbedtls.c
75 13 6
static eReportBuilderStatus prvWriteConnectionsArray()
in source/defender-tools/report_builder.c
73 9 5
BaseType_t Sockets_Connect()
in lib/FreeRTOS/network_transport/freertos_plus_tcp/sockets_wrapper.c
72 8 5
static int32_t privateKeySigningCallback()
in lib/FreeRTOS/network_transport/freertos_plus_tcp/using_mbedtls_pkcs11/using_mbedtls_pkcs11.c
72 11 7
static void prvIncomingPublishUpdateDeltaCallback()
in source/demo-tasks/shadow_device_task.c
69 5 2
TlsTransportStatus_t TLS_FreeRTOS_Connect()
in lib/FreeRTOS/network_transport/freertos_plus_tcp/using_mbedtls_pkcs11/using_mbedtls_pkcs11.c
67 12 6
65 8 1
void vShadowDeviceTask()
in source/demo-tasks/shadow_device_task.c
65 6 1
static eReportBuilderStatus prvWriteTaskIdsArray()
in source/defender-tools/report_builder.c
64 9 5
static void prvOTADemoTask()
in source/demo-tasks/ota_over_mqtt_demo.c
64 8 1
static void prvIncomingPublishUpdateRejectedCallback()
in source/demo-tasks/shadow_device_task.c
61 5 2
void prvDefenderDemoTask()
in source/demo-tasks/defender_demo.c
61 11 1