freertos / Labs-Project-Espressif-Demos
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 65 units with 1,654 lines of code in units (75.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 6 medium complex units (385 lines of code)
    • 11 simple units (489 lines of code)
    • 48 very simple units (780 lines of code)
0% | 0% | 23% | 29% | 47%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
c0% | 0% | 23% | 29% | 47%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
components/ota_pal0% | 0% | 18% | 28% | 52%
components/pkcs11_pal0% | 0% | 23% | 50% | 26%
components/network_transport0% | 0% | 55% | 0% | 44%
components/pkcs11_helpers0% | 0% | 100% | 0% | 0%
components/mqtt-subscription-manager0% | 0% | 45% | 54% | 0%
components/crypto0% | 0% | 0% | 23% | 76%
components/mqtt-agent-interface0% | 0% | 0% | 0% | 100%
components/logging0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
OtaPalStatus_t otaPal_SetPlatformImageState()
in components/ota_pal/source/ota_pal.c
77 15 2
static CK_RV prvGetCertificate()
in components/ota_pal/source/ota_pal.c
70 14 3
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
TlsTransportStatus_t TLS_FreeRTOS_Connect()
in components/network_transport/source/tls_freertos.c
58 12 6
CK_RV PKCS11_PAL_GetObjectValue()
in components/pkcs11_pal/source/core_pkcs11_pal.c
73 12 4
OtaPalStatus_t otaPal_CheckFileSignature()
in components/ota_pal/source/ota_pal.c
66 9 1
OtaPalStatus_t otaPal_CloseFile()
in components/ota_pal/source/ota_pal.c
58 9 1
static void initialize_nvs_partition()
in components/pkcs11_pal/source/core_pkcs11_pal.c
45 9 0
OtaPalImageState_t otaPal_GetPlatformImageState()
in components/ota_pal/source/ota_pal.c
34 8 1
CK_OBJECT_HANDLE PKCS11_PAL_FindObject()
in components/pkcs11_pal/source/core_pkcs11_pal.c
41 8 2
BaseType_t CRYPTO_SignatureVerificationFinal()
in components/crypto/source/iot_crypto.c
45 7 5
void SubscriptionManager_RemoveSubscription()
in components/mqtt-subscription-manager/source/mqtt_subscription_manager.c
29 7 3
static CK_RV prvGetCertificateHandle()
in components/ota_pal/source/ota_pal.c
64 7 4
void prvLabelToFilenameHandle()
in components/pkcs11_pal/source/core_pkcs11_pal.c
48 7 3
bool SubscriptionManager_HandleIncomingPublishes()
in components/mqtt-subscription-manager/source/mqtt_subscription_manager.c
34 6 2
void prvHandleToLabel()
in components/pkcs11_pal/source/core_pkcs11_pal.c
25 6 2
static BaseType_t prvVerifySignature()
in components/crypto/source/iot_crypto.c
38 5 7
int32_t TLS_FreeRTOS_recv()
in components/network_transport/source/tls_freertos.c
19 5 3
int32_t TLS_FreeRTOS_send()
in components/network_transport/source/tls_freertos.c
19 5 3