microsoft / MCW-Internet-of-Things
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 31 units with 899 lines of code in units (77.8% of code).
    • 1 very long units (495 lines of code)
    • 1 long units (55 lines of code)
    • 3 medium size units (83 lines of code)
    • 11 small units (175 lines of code)
    • 15 very small units (91 lines of code)
55% | 6% | 9% | 19% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs55% | 6% | 9% | 19% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lab-files/starter-project/SmartMeterSimulator60% | 6% | 10% | 13% | 9%
lab-files/starter-project/CloudToDevice0% | 0% | 0% | 84% | 15%
lab-files/starter-project/DownstreamDevice0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private void InitializeComponent()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/MainForm.Designer.cs
495 1 0
private void WorkComplete()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/MainForm.cs
55 10 1
private void btnRegister_Click()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/MainForm.cs
29 5 2
private void Device_Hover()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/MainForm.cs
28 5 2
public async void ReceiveMessageAsync()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/Sensor.cs
26 5 0
public int Compare()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/ListViewColumnSorter.cs
20 3 2
private void DoWork()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/MainForm.cs
20 5 1
private async static Task PromptUser()
in Hands-on lab/lab-files/starter-project/CloudToDevice/Program.cs
19 3 0
private void btnDisconnect_Click()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/MainForm.cs
18 6 2
private void btnConnect_Click()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/MainForm.cs
17 6 2
private static string GetReadLine()
in Hands-on lab/lab-files/starter-project/CloudToDevice/Program.cs
15 3 2
private static int GetReadLineInteger()
in Hands-on lab/lab-files/starter-project/CloudToDevice/Program.cs
15 4 3
private static double GetReadLineDouble()
in Hands-on lab/lab-files/starter-project/CloudToDevice/Program.cs
15 4 3
private static string ComputeDerivedSymmetricKey()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/DeviceManager.cs
13 2 2
public MainForm()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/MainForm.cs
12 1 0
public Task QueueTask()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/BackgroundQueue.cs
11 1 1
private void InstallDevice()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/MainForm.cs
10 1 2
public async static Task RegisterDeviceAsync()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/DeviceManager.cs
9 1 3
public async void SendMessageAsync()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/Sensor.cs
9 1 0
protected override void Dispose()
in Hands-on lab/lab-files/starter-project/SmartMeterSimulator/MainForm.Designer.cs
8 3 1