freertos / Labs-Project-Espressif-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 65 units with 1,654 lines of code in units (75.3% of code).
    • 0 very long units (0 lines of code)
    • 10 long units (626 lines of code)
    • 21 medium size units (675 lines of code)
    • 15 small units (226 lines of code)
    • 19 very small units (127 lines of code)
0% | 37% | 40% | 13% | 7%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c0% | 37% | 40% | 13% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
components/ota_pal0% | 49% | 31% | 11% | 6%
components/pkcs11_pal0% | 23% | 72% | 0% | 4%
components/network_transport0% | 55% | 0% | 36% | 8%
components/pkcs11_helpers0% | 100% | 0% | 0% | 0%
components/mqtt-subscription-manager0% | 45% | 54% | 0% | 0%
components/crypto0% | 0% | 58% | 31% | 9%
components/mqtt-agent-interface0% | 0% | 40% | 60% | 0%
components/logging0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
OtaPalStatus_t otaPal_SetPlatformImageState()
in components/ota_pal/source/ota_pal.c
77 15 2
CK_RV PKCS11_PAL_GetObjectValue()
in components/pkcs11_pal/source/core_pkcs11_pal.c
73 12 4
static CK_RV prvGetCertificate()
in components/ota_pal/source/ota_pal.c
70 14 3
OtaPalStatus_t otaPal_CheckFileSignature()
in components/ota_pal/source/ota_pal.c
66 9 1
static CK_RV prvGetCertificateHandle()
in components/ota_pal/source/ota_pal.c
64 7 4
TlsTransportStatus_t TLS_FreeRTOS_Connect()
in components/network_transport/source/tls_freertos.c
58 12 6
OtaPalStatus_t otaPal_CloseFile()
in components/ota_pal/source/ota_pal.c
58 9 1
BaseType_t xPkcs11GenerateRandomNumber()
in components/pkcs11_helpers/source/pkcs11_helpers.c
54 13 2
bool SubscriptionManager_AddSubscription()
in components/mqtt-subscription-manager/source/mqtt_subscription_manager.c
53 12 5
static int prvApplyPatch()
in components/ota_pal/source/ota_pal.c
53 5 1
void prvLabelToFilenameHandle()
in components/pkcs11_pal/source/core_pkcs11_pal.c
48 7 3
BaseType_t CRYPTO_SignatureVerificationFinal()
in components/crypto/source/iot_crypto.c
45 7 5
static void initialize_nvs_partition()
in components/pkcs11_pal/source/core_pkcs11_pal.c
45 9 0
CK_RV PKCS11_PAL_DestroyObject()
in components/pkcs11_pal/source/core_pkcs11_pal.c
43 5 1
CK_OBJECT_HANDLE PKCS11_PAL_FindObject()
in components/pkcs11_pal/source/core_pkcs11_pal.c
41 8 2
static BaseType_t prvVerifySignature()
in components/crypto/source/iot_crypto.c
38 5 7
bool SubscriptionManager_HandleIncomingPublishes()
in components/mqtt-subscription-manager/source/mqtt_subscription_manager.c
34 6 2
OtaPalImageState_t otaPal_GetPlatformImageState()
in components/ota_pal/source/ota_pal.c
34 8 1
static CK_RV prvGetCertificateHandle()
in components/ota_pal/source/ota_pal.c
30 4 4
int16_t otaPal_WriteBlock()
in components/ota_pal/source/ota_pal.c
30 4 4