microsoft / ExpressivePixels
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 974 units with 11,727 lines of code in units (51.6% of code).
    • 10 very long units (1,673 lines of code)
    • 19 long units (1,215 lines of code)
    • 105 medium size units (3,108 lines of code)
    • 181 small units (2,557 lines of code)
    • 659 very small units (3,174 lines of code)
14% | 10% | 26% | 21% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp18% | 7% | 26% | 22% | 25%
c12% | 21% | 32% | 22% | 11%
hpp22% | 8% | 19% | 12% | 37%
py0% | 13% | 26% | 24% | 34%
cs0% | 10% | 26% | 20% | 43%
h0% | 0% | 0% | 15% | 84%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Firmware/ExpressivePixelsCore29% | 9% | 27% | 12% | 20%
Firmware/ExpressivePixelsMIDI20% | 7% | 23% | 11% | 36%
Firmware/Platform_NordicSDK5% | 8% | 31% | 28% | 26%
Firmware/Segger11% | 28% | 35% | 16% | 7%
Windows/ExpressivePixelsActivator0% | 10% | 26% | 20% | 43%
Firmware0% | 28% | 51% | 5% | 14%
Firmware/RaspberryPi0% | 9% | 18% | 30% | 41%
Firmware/Platform_Arduino0% | 5% | 15% | 40% | 38%
Firmware/Arduino0% | 0% | 0% | 52% | 47%
Firmware/Device_Nordic52840DK_SeggerEmbeddedStudio0% | 0% | 0% | 76% | 23%
Firmware/Device_Nordic52840DK_SeggerEmbeddedStudio Minimal0% | 0% | 0% | 72% | 27%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void CExpressivePixelsApp::ExecuteTTYCommand()
in Firmware/ExpressivePixelsCore/EPXApp.cpp
392 72 0
void CExpressivePixelsApp::PayloadExecute()
in Firmware/ExpressivePixelsCore/EPXApp_Payload.cpp
191 33 1
bool MidiInterface::parse()
in Firmware/ExpressivePixelsMIDI/MIDI.hpp
186 51 0
void CExpressivePixelsApp::value()
in Firmware/ExpressivePixelsCore/EPXApp_JSON.cpp
185 63 1
void JsonStreamingParser::parse()
in Firmware/ExpressivePixelsCore/JsonStreamingParser.cpp
135 58 1
static void ble_evt_handler()
in Firmware/Platform_NordicSDK/EPXPlatform_BLE.c
134 28 2
int SEGGER_RTT_vprintf()
in Firmware/Segger/SEGGER_RTT_printf.c
120 29 3
bool CAnimationManager::ProcessFrame()
in Firmware/ExpressivePixelsCore/CAnimationManager.cpp
119 38 2
bool CExpressivePixelsStorage::SequenceRead()
in Firmware/ExpressivePixelsCore/EPXApp_CStorage.cpp
108 35 3
void CExpressivePixelsApp::PayloadParseBinary()
in Firmware/ExpressivePixelsCore/EPXApp_Payload_Binary.cpp
103 20 1
public async void OnBLEAdvertismentReceived()
in Windows/ExpressivePixelsActivator/ConnectivityCore/BLE_DeviceManager.cs
92 15 2
uint32_t ble_nus_init()
in Firmware/Platform_NordicSDK/EPXPlatform_BLE_DualNUS.c
74 4 2
bool CSwitchActivation::ConsoleCommandProcess()
in Firmware/ExpressivePixelsCore/EPXApp_Trigger_Switch.cpp
71 14 3
bool CExpressivePixelsApp::AppInitialize()
in Firmware/ExpressivePixelsCore/EPXApp.cpp
69 7 4
void MidiInterface::thruFilter()
in Firmware/ExpressivePixelsMIDI/MIDI.hpp
68 22 1
def main()
in Firmware/uf2conv.py
68 13 0
static void _PrintUnsigned()
in Firmware/Segger/SEGGER_RTT_printf.c
67 21 6
def __init__()
in Firmware/RaspberryPi/animation.py
66 12 2
void CExpressivePixelsApp::AppProcess()
in Firmware/ExpressivePixelsCore/EPXApp.cpp
65 25 1
bool CStorage::Initialize()
in Firmware/Platform_NordicSDK/EPXPlatform_CStorage.cpp
63 7 5