microsoft / busiotools
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 545 units with 12,237 lines of code in units (62.1% of code).
    • 12 very long units (2,385 lines of code)
    • 34 long units (2,231 lines of code)
    • 136 medium size units (3,957 lines of code)
    • 147 small units (2,166 lines of code)
    • 216 very small units (1,498 lines of code)
19% | 18% | 32% | 17% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs22% | 18% | 31% | 16% | 11%
cpp12% | 12% | 32% | 26% | 15%
h0% | 42% | 32% | 13% | 12%
ino0% | 0% | 56% | 27% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sensors/Tools/SensorExplorer23% | 18% | 31% | 14% | 12%
usb/tools/ConnectionExerciser11% | 11% | 32% | 29% | 14%
sensors/Tools/MALT9% | 23% | 38% | 17% | 11%
hmdvalidationkit/managed0% | 25% | 34% | 37% | 3%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static async Task GetDefault()
in sensors/Tools/SensorExplorer/Sensor.cs
501 74 1
public async Task EvaluateStateEverySecondAsync()
in sensors/Tools/SensorExplorer/Scenario4_Distance.xaml.cs
285 47 0
public void UpdateProperty()
in sensors/Tools/SensorExplorer/SensorDisplay.cs
216 60 1
public SensorDisplay()
in sensors/Tools/SensorExplorer/SensorDisplay.cs
192 23 7
bool DTMF_HandleCommand()
in usb/tools/ConnectionExerciser/libraries/DTMF/DTMF.cpp
169 35 1
public static async Task GetPLDInformation()
in sensors/Tools/SensorExplorer/Sensor.cs
156 32 2
private void TestBegin()
in sensors/Tools/SensorExplorer/Scenario0_Testing.xaml.cs
154 34 0
private void TestBegin()
in sensors/Tools/SensorExplorer/Scenario0_Tests.xaml.cs
154 34 0
private async void EnumerateSensors()
in sensors/Tools/SensorExplorer/Scenario0_Testing.xaml.cs
153 21 0
private async void EnumerateSensors()
in sensors/Tools/SensorExplorer/Scenario0_Tests.xaml.cs
153 21 0
private async void EnumerateSensors()
in sensors/Tools/SensorExplorer/Scenario1_View.xaml.cs
150 21 0
static void Main()
in sensors/Tools/MALT/Code/MALTUtil/MALTUtil/Program.cs
102 16 1
private void AddSummaryPage()
in sensors/Tools/SensorExplorer/Scenario1_View.xaml.cs
92 22 0
private void CalculateResolutionNoiseDensity()
in sensors/Tools/SensorExplorer/Scenario0_Testing.xaml.cs
84 12 0
private void CalculateResolutionNoiseDensity()
in sensors/Tools/SensorExplorer/Scenario0_Tests.xaml.cs
84 12 0
private void CalculateOffsetTest()
in sensors/Tools/SensorExplorer/Scenario0_Testing.xaml.cs
79 13 0
private void CalculateOffsetTest()
in sensors/Tools/SensorExplorer/Scenario0_Tests.xaml.cs
79 13 0
public static async Task GetProperties()
in sensors/Tools/SensorExplorer/Sensor.cs
79 12 1
private async static void PeriodicTimerCallbackSensorDisplay()
in sensors/Tools/SensorExplorer/PeriodicTimer.cs
74 15 1
public bool FindHmdKitDevice()
in hmdvalidationkit/managed/HmdKit.cs
73 10 0