microsoft / Windows-AppConsult-Samples-DesktopBridge
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 365 units with 4,066 lines of code in units (29.8% of code).
    • 1 very long units (165 lines of code)
    • 6 long units (409 lines of code)
    • 34 medium size units (1,035 lines of code)
    • 77 small units (1,093 lines of code)
    • 247 very small units (1,364 lines of code)
4% | 10% | 25% | 26% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs5% | 11% | 24% | 23% | 34%
cpp0% | 6% | 26% | 35% | 32%
h0% | 0% | 37% | 38% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Blog-ModernizationStory27% | 0% | 30% | 14% | 28%
Blog-OptionalPackages0% | 30% | 26% | 24% | 18%
Blog-AdvancedInstaller0% | 41% | 36% | 0% | 22%
Blog-SourceGenerator0% | 49% | 0% | 12% | 37%
Docs-ContextMenuSample0% | 5% | 27% | 35% | 31%
Blog-Scripting0% | 30% | 38% | 7% | 23%
Blog-AppTransition0% | 0% | 50% | 17% | 32%
Blog-FIPs0% | 0% | 83% | 0% | 16%
Blog-Sqlite0% | 0% | 29% | 21% | 49%
MSIX-Shared-Storage-Folder0% | 0% | 29% | 31% | 38%
Blog-WinRTComponent0% | 0% | 37% | 0% | 62%
Blog-WpfNetCore0% | 0% | 0% | 38% | 61%
UWPAPIsUsedFromUnityEXEApp0% | 0% | 0% | 96% | 3%
Blog-AppInstallerWithActivation0% | 0% | 0% | 68% | 32%
Blog-MSIXModificationPackages0% | 0% | 0% | 77% | 22%
Blog-PSF0% | 0% | 0% | 45% | 54%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private void InitializeComponent()
in Blog-ModernizationStory/DynamicWindowsForms/FormDynamic.Designer.cs
165 1 0
private void InitializeComponent()
in Blog-OptionalPackages/MyEmployees-ModificationPackages/MyEmployees/Form1.Designer.cs
76 1 0
private void InitializeComponent()
in Blog-OptionalPackages/MyEmployees-OptionalPackages/MyEmployees/Form1.Designer.cs
76 1 0
private void InitializeComponent()
in Blog-AdvancedInstaller/MyEmployees/Form1.Designer.cs
75 1 0
private static GenerateCodeContext CreateGenerateCodeContext()
in Blog-SourceGenerator/MvvmGenerator/AutoImplementNotifyPropertyChangedGenerator.cs
71 4 2
HRESULT CRegisterExtension::RegisterElevatableInProcServer()
in Docs-ContextMenuSample/ExplorerCommandVerb/RegisterExtension.cpp
57 9 3
private void InitializeComponent()
in Blog-Scripting/MyEmployees/MyEmployees/Form1.Designer.cs
54 1 0
public override void Initialize()
in Blog-FIPs/FipsCodeAnalyzer/FipsCodeAnalyzer/FipsCodeAnalyzerAnalyzer.cs
47 7 1
internal ControlEnum? GetControlEnum()
in Blog-ModernizationStory/DynamicWindowsForms/ControlHelpers/ControlTypeHelper.cs
44 15 2
__inline HRESULT ShellAttributesToString()
in Docs-ContextMenuSample/ExplorerCommandVerb/ShellHelpers.h
44 3 2
private void InitializeComponent()
in Blog-AdvancedInstaller/MyEmployees/AboutForm.Designer.cs
39 1 0
private void InitializeComponent()
in Blog-OptionalPackages/MyEmployees-ModificationPackages/MyEmployees/AboutForm.Designer.cs
39 1 0
private void InitializeComponent()
in Blog-OptionalPackages/MyEmployees-OptionalPackages/MyEmployees/AboutForm.Designer.cs
39 1 0
private void InitializeComponent()
in Blog-Scripting/MyEmployees/MyEmployees/AboutForm.Designer.cs
39 1 0
HRESULT CRegisterExtension::RegisterAppShortcutInSendTo()
in Docs-ContextMenuSample/ExplorerCommandVerb/RegisterExtension.cpp
37 9 0
internal override Control GetControl()
in Blog-ModernizationStory/DynamicWindowsForms/ControlHelpers/ControlFactoryXaml.cs
34 13 1
private async void BtnGetWeather_OnClick()
in Blog-Sqlite/SqlLite.UI/MainWindow.xaml.cs
33 6 2
private void okButton_Click()
in Blog-AppTransition/ExpenseIt/ExpenseItDemo/CreateExpenseReportDialogBox.cs
32 3 2
internal bool IsWuxControl()
in Blog-ModernizationStory/DynamicWindowsForms/ControlHelpers/ControlTypeHelper.cs
30 12 1
HRESULT CExplorerCommandStateHandler_RegisterUnRegister()
in Docs-ContextMenuSample/ExplorerCommandVerb/ExplorerCommandStateHandler.cpp
30 5 1