microsoft / BluetoothLEExplorer
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 396 units with 5,258 lines of code in units (40.3% of code).
    • 3 very long units (372 lines of code)
    • 9 long units (585 lines of code)
    • 49 medium size units (1,554 lines of code)
    • 91 small units (1,288 lines of code)
    • 244 very small units (1,459 lines of code)
7% | 11% | 29% | 24% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs7% | 11% | 29% | 24% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
BluetoothLEExplorer/BluetoothLEExplorer/Models12% | 10% | 36% | 22% | 17%
GattServicesLibrary/GattServicesLibrary/Services38% | 0% | 53% | 4% | 3%
BluetoothLEExplorer/BluetoothLEExplorer/ViewModels0% | 18% | 28% | 21% | 31%
BluetoothLEExplorer/BluetoothLEExplorer/Services0% | 22% | 13% | 28% | 35%
GattServicesLibrary/GattServicesLibrary/Helpers0% | 38% | 0% | 47% | 14%
GattServicesLibrary/GattServicesLibrary/Characteristics0% | 0% | 24% | 20% | 54%
SortedObservableCollection/SortedObservableCollection0% | 0% | 43% | 49% | 7%
GattServicesLibrary/GattServicesLibrary0% | 0% | 33% | 41% | 25%
BluetoothLEExplorer/BluetoothLEExplorer0% | 0% | 52% | 31% | 15%
BluetoothLEExplorer/BluetoothLEExplorer/Views0% | 0% | 0% | 29% | 70%
BluetoothLEExplorer/GattHelper/Converters0% | 0% | 0% | 22% | 77%
GattServicesLibrary/GattServicesLibrary/CharacteristicParameterValues0% | 0% | 0% | 100% | 0%
BluetoothLEExplorer/BluetoothLEExplorer/CustomControls0% | 0% | 0% | 34% | 65%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private void SetValue()
in BluetoothLEExplorer/BluetoothLEExplorer/Models/ObservableGattCharacteristics.cs
151 51 0
public static byte GetHidUsageFromPs2Set1()
in BluetoothLEExplorer/BluetoothLEExplorer/Models/HidHelper.cs
116 109 1
public override async Task Init()
in GattServicesLibrary/GattServicesLibrary/Services/MicrosoftService.cs
105 6 0
private async void CharacteristicPageViewModel_PropertyChanged()
in BluetoothLEExplorer/BluetoothLEExplorer/ViewModels/CharacteristicPageViewModel.cs
85 11 2
public static string GetErrorString()
in BluetoothLEExplorer/BluetoothLEExplorer/Services/Other/GattProtocolErrorParser.cs
77 19 1
private async void ServicePageViewModel_PropertyChanged()
in BluetoothLEExplorer/BluetoothLEExplorer/ViewModels/ServicePageViewModel.cs
69 9 2
public async void WriteValue()
in BluetoothLEExplorer/BluetoothLEExplorer/ViewModels/CharacteristicPageViewModel.cs
65 12 0
private void ChangeKeyState()
in BluetoothLEExplorer/BluetoothLEExplorer/Models/VirtualKeyboard.cs
64 10 2
private async void DeviceWatcher_Updated()
in BluetoothLEExplorer/BluetoothLEExplorer/Models/GattSampleContext.cs
59 7 2
public void StartEnumeration()
in BluetoothLEExplorer/BluetoothLEExplorer/Models/GattSampleContext.cs
56 2 0
public async Task Connect()
in BluetoothLEExplorer/BluetoothLEExplorer/Models/ObservableBluetoothLEDevice.cs
55 5 0
public static string ConvertValueBufferToString()
in GattServicesLibrary/GattServicesLibrary/Helpers/ValueConverter.cs
55 19 2
private async Task CreateHidService()
in BluetoothLEExplorer/BluetoothLEExplorer/Models/VirtualKeyboard.cs
49 7 0
private async Task GetAllCharacteristics()
in BluetoothLEExplorer/BluetoothLEExplorer/Models/ObservableGattDeviceService.cs
47 9 0
private async Task GetAllPrimaryServices()
in BluetoothLEExplorer/BluetoothLEExplorer/Models/ObservableBluetoothLEDevice.cs
46 6 1
public async Task SetIndicate()
in BluetoothLEExplorer/BluetoothLEExplorer/Models/ObservableGattCharacteristics.cs
45 7 0
public async Task SetNotify()
in BluetoothLEExplorer/BluetoothLEExplorer/Models/ObservableGattCharacteristics.cs
45 7 0
private async Task AddDeviceToList()
in BluetoothLEExplorer/BluetoothLEExplorer/Models/GattSampleContext.cs
44 8 1
public async void WriteTransaction()
in BluetoothLEExplorer/BluetoothLEExplorer/ViewModels/CharacteristicPageViewModel.cs
44 7 0
private int FindNewIndex()
in SortedObservableCollection/SortedObservableCollection/SortedObservableCollection.cs
44 8 2