microsoft / devkit-sdk
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 2,620 units with 26,643 lines of code in units (23.9% of code).
    • 4 very long units (1,534 lines of code)
    • 39 long units (2,578 lines of code)
    • 246 medium size units (7,388 lines of code)
    • 478 small units (6,467 lines of code)
    • 1,853 very small units (8,676 lines of code)
5% | 9% | 27% | 24% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c12% | 11% | 26% | 27% | 21%
cpp2% | 13% | 33% | 26% | 23%
h0% | 2% | 21% | 17% | 58%
cs0% | 13% | 57% | 23% | 5%
py0% | 0% | 76% | 0% | 23%
js0% | 0% | 15% | 44% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
AZ3166/src/cores/arduino18% | 14% | 27% | 19% | 19%
AZ3166/src/libraries/AzureIoT28% | 13% | 37% | 11% | 8%
AZ3166/tools/dice_device_enrollment/src13% | 23% | 39% | 11% | 12%
AZ3166/src/libraries/Sensors0% | 6% | 21% | 41% | 30%
AZ3166/src/libraries/Audio0% | 18% | 35% | 23% | 22%
AZ3166/src/libraries/AudioV20% | 17% | 29% | 28% | 24%
AZ3166/src/libraries/MQTT0% | 10% | 56% | 18% | 14%
AZ3166/src/system/mbed-os0% | 1% | 16% | 17% | 64%
AZ3166/jenkins/DevKitTestTool0% | 13% | 57% | 23% | 5%
AZ3166/src/libraries/WebSocket0% | 26% | 49% | 15% | 8%
AZ3166/src/libraries/WiFi0% | 0% | 28% | 35% | 35%
AZ3166/src/libraries/Wire0% | 0% | 37% | 17% | 45%
AZ3166/src/libraries/FileSystem0% | 0% | 46% | 20% | 33%
AZ3166/src/system/azure-iot-sdk-c0% | 0% | 54% | 34% | 10%
AZ3166/jenkins/InstallationPackageScript/src0% | 0% | 16% | 47% | 36%
AZ3166/src/libraries/SPI0% | 0% | 0% | 47% | 52%
AZ3166/src/system/az3166-driver0% | 0% | 0% | 71% | 28%
AZ3166/jenkins/InstallationPackageScript0% | 0% | 0% | 0% | 100%
AZ3166/jenkins/deployment0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
size_t http_parser_execute()
in AZ3166/src/cores/arduino/httpclient/http_parser/http_parser.c
1138 332 4
int RiotStart()
in AZ3166/tools/dice_device_enrollment/src/dice_device_enrollment/RIoT/Core/RiotCore.c
153 26 5
bool DevKitMQTTClient_Init()
in AZ3166/src/libraries/AzureIoT/src/DevKitMQTTClient.cpp
134 22 3
bool __attribute__()
in AZ3166/src/libraries/AzureIoT/src/DevkitDPSClient.cpp
109 23 1
void httpd_parse_useragent()
in AZ3166/src/cores/arduino/httpserver/http_parse.c
99 47 2
static int handle_input()
in AZ3166/src/cores/arduino/cli/console_cli.cpp
96 29 1
public static int Main()
in AZ3166/jenkins/DevKitTestTool/Program.cs
89 16 1
int initIoTDevKit()
in AZ3166/src/libraries/Sensors/src/IoT_DevKit_HW.cpp
83 15 1
int LSM6DSLSensor::getEventStatus()
in AZ3166/src/libraries/Sensors/src/LSM6DSLSensor.cpp
83 28 1
int httpd_wsgi()
in AZ3166/src/cores/arduino/httpserver/httpd_wsgi.c
80 22 1
static HAL_StatusTypeDef I2Cx_ReadMultiple()
in AZ3166/src/libraries/Audio/src/stm32412g_discovery.c
79 2 6
static HAL_StatusTypeDef I2Cx_ReadMultiple()
in AZ3166/src/libraries/AudioV2/src/stm32412g_discovery.c
78 2 6
int main()
in AZ3166/tools/dice_device_enrollment/src/dice_device_enrollment/dice_device_enrollment.cpp
78 11 2
NTPResult NTPClient::setTime()
in AZ3166/src/cores/arduino/NTPClient/NTPClient.cpp
76 9 3
static int parseCommandArguments()
in AZ3166/tools/dice_device_enrollment/src/dice_device_enrollment/dice_device_enrollment.cpp
76 18 2
uint8_t BSP_AUDIO_IN_ConfigMicDefault()
in AZ3166/src/libraries/Audio/src/stm32412g_discovery_audio.c
72 9 1
int MQTT::Client::cycle()
in AZ3166/src/libraries/MQTT/src/MQTTClient.h
72 23 1
uint8_t BSP_AUDIO_IN_ConfigMicDefault()
in AZ3166/src/libraries/AudioV2/src/stm32412g_discovery_audio.c
69 9 1
int httpd_send_response_301()
in AZ3166/src/cores/arduino/httpserver/httpd_wsgi.c
68 17 5
int WebSocketClient::send()
in AZ3166/src/libraries/WebSocket/src/WebSocketClient.cpp
66 13 4