aws-samples / aws-iot-alexa-connected-home-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 4,328 units with 72,857 lines of code in units (52.9% of code).
    • 66 very long units (8,847 lines of code)
    • 231 long units (15,491 lines of code)
    • 642 medium size units (20,827 lines of code)
    • 838 small units (12,296 lines of code)
    • 2,551 very small units (15,396 lines of code)
12% | 21% | 28% | 16% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c14% | 25% | 32% | 16% | 10%
py0% | 12% | 27% | 25% | 33%
js0% | 87% | 0% | 0% | 12%
h0% | 0% | 4% | 17% | 77%
go0% | 0% | 36% | 54% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
amazon-freertos/lib/FreeRTOS-Plus-TCP25% | 27% | 27% | 11% | 8%
amazon-freertos/lib/FreeRTOS5% | 17% | 19% | 21% | 36%
amazon-freertos/lib/secure_sockets30% | 21% | 39% | 6% | 1%
amazon-freertos/lib/ota24% | 26% | 40% | 3% | 5%
amazon-freertos/lib/mqtt13% | 45% | 27% | 11% | 2%
amazon-freertos/lib/tls50% | 0% | 37% | 10% | 2%
amazon-freertos/lib/pkcs119% | 32% | 43% | 8% | 5%
amazon-freertos/lib/shadow21% | 21% | 47% | 9% | 0%
amazon-freertos/lib/greengrass23% | 44% | 25% | 5% | <1%
amazon-freertos/lib/wifi2% | 18% | 51% | 15% | 11%
amazon-freertos/lib/FreeRTOS-Plus-POSIX0% | 21% | 44% | 22% | 10%
amazon-freertos/tools/ota_e2e_tests0% | 22% | 22% | 24% | 30%
amazon-freertos/tools/certificate_configuration0% | 93% | 0% | 0% | 6%
amazon-freertos/lib/cbor0% | 0% | 34% | 54% | 11%
amazon-freertos/tools/cbmc0% | 0% | 52% | 22% | 24%
amazon-freertos/tools/checks0% | 0% | 57% | 14% | 27%
amazon-freertos/tools/aws_config_quick_start0% | 0% | 40% | 16% | 43%
amazon-freertos/lib/defender0% | 0% | 23% | 32% | 43%
amazon-freertos/lib/crypto0% | 0% | 86% | 10% | 3%
amazon-freertos/tools/echo_server0% | 0% | 36% | 54% | 9%
amazon-freertos/tools/git0% | 0% | 10% | 58% | 31%
amazon-freertos/lib/utils0% | 0% | 0% | 100% | 0%
amazon-freertos/lib/bufferpool0% | 0% | 0% | 0% | 100%
function0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
BaseType_t FreeRTOS_setsockopt()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_Sockets.c
280 56 5
static DocParseErr_t prvParseJSONbyModel()
in amazon-freertos/lib/ota/aws_ota_agent.c
253 32 3
static void ksz8851snl_update()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/portable/NetworkInterface/ksz8851snl/NetworkInterface.c
216 29 0
static uint32_t prvParseDNSReply()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_DNS.c
201 26 3
void vDHCPProcess()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_DHCP.c
195 28 1
static void prvTCPReturnPacket()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_TCP_IP.c
190 27 4
static void prvInitialiseNewTask()
in amazon-freertos/lib/FreeRTOS/tasks.c
184 8 8
static void prvOTAUpdateTask()
in amazon-freertos/lib/ota/aws_ota_agent.c
171 31 1
asm volatile()
in amazon-freertos/lib/FreeRTOS/portable/GCC/ATMega323/port.c
171 1 1
int32_t SOCKETS_SetSockOpt()
in amazon-freertos/lib/secure_sockets/portable/lwip/aws_secure_sockets.c
165 32 5
static int prvInitializeClientCredential()
in amazon-freertos/lib/tls/aws_tls.c
153 24 1
int32_t SOCKETS_SetSockOpt()
in amazon-freertos/lib/secure_sockets/portable/ti/cc3220_launchpad/aws_secure_sockets.c
153 18 5
uint16_t usGenerateProtocolChecksum()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_IP.c
151 26 3
BaseType_t xQueueSemaphoreTake()
in amazon-freertos/lib/FreeRTOS/queue.c
149 16 2
int32_t SOCKETS_SetSockOpt()
in amazon-freertos/lib/secure_sockets/portable/freertos_plus_tcp/aws_secure_sockets.c
147 23 5
static BaseType_t prvProcessDHCPReplies()
in amazon-freertos/lib/FreeRTOS-Plus-TCP/source/FreeRTOS_DHCP.c
144 30 1
static IngestResult_t prvIngestDataBlock()
in amazon-freertos/lib/ota/aws_ota_agent.c
142 18 4
void PendSV_Handler()
in amazon-freertos/lib/FreeRTOS/portable/GCC/ARM_CM33/non_secure/portasm.c
142 1 1
void PendSV_Handler()
in amazon-freertos/lib/FreeRTOS/portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/portasm.c
142 1 1
int32_t SOCKETS_SetSockOpt()
in amazon-freertos/lib/secure_sockets/portable/infineon/xmc4800_iotkit/aws_secure_sockets.c
142 23 5