microsoft / WinAppDriver
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 452 units with 5,650 lines of code in units (41.9% of code).
    • 3 very long units (347 lines of code)
    • 9 long units (583 lines of code)
    • 68 medium size units (1,978 lines of code)
    • 86 small units (1,219 lines of code)
    • 286 very small units (1,523 lines of code)
6% | 10% | 35% | 21% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs4% | 7% | 36% | 21% | 30%
cpp17% | 33% | 25% | 23% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Tools/UIRecorder/UIRecorder11% | 15% | 42% | 15% | 14%
Tools/UIRecorder/UIXPathLib17% | 33% | 25% | 23% | 0%
ApplicationUnderTests/AppUIBasics/DataModel0% | 53% | 0% | 11% | 36%
ApplicationUnderTests/AppUIBasics/ControlPages0% | 0% | 31% | 31% | 36%
ApplicationUnderTests/AppUIBasics/Common0% | 0% | 38% | 16% | 44%
ApplicationUnderTests/AppUIBasics0% | 0% | 35% | 18% | 46%
ApplicationUnderTests/Input0% | 0% | 22% | 13% | 64%
Tools/UIRecorder/UIRecorderTemplate0% | 0% | 52% | 31% | 15%
ApplicationUnderTests/AppUIBasics/Navigation0% | 0% | 0% | 75% | 25%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static string GenerateXPathToUiElement()
in Tools/UIRecorder/UIRecorder/GenerateXPath.cs
131 37 3
HRESULT UiTreeWalk::AppendUiAttributes()
in Tools/UIRecorder/UIXPathLib/UiTreeWalk.cpp
110 20 5
public static void InitVk2StringMap()
in Tools/UIRecorder/UIRecorder/GenerateXPath.cs
106 1 0
static Dictionary GetTagAttributes()
in Tools/UIRecorder/UIRecorder/GenerateXPath.cs
84 21 1
HRESULT UiTreeWalk::PathFromRootToTarget()
in Tools/UIRecorder/UIXPathLib/UiTreeWalk.cpp
79 15 2
HRESULT UiTreeWalk::ElementContainingPoint()
in Tools/UIRecorder/UIXPathLib/UiTreeWalk.cpp
72 20 4
private void treeUiPath_SelectedItemChanged()
in Tools/UIRecorder/UIRecorder/MainWindow.xaml.cs
68 15 2
public static void HandleUiEvent()
in Tools/UIRecorder/UIRecorder/XmlNodePathRecorder.cs
61 19 4
long UiTreeWalk::UiTreeWalkerThreadProc()
in Tools/UIRecorder/UIXPathLib/UiTreeWalk.cpp
60 8 1
private void comboBoxRecordedUi_SelectionChanged()
in Tools/UIRecorder/UIRecorder/MainWindow.xaml.cs
54 14 2
private async Task GetControlInfoDataAsync()
in ApplicationUnderTests/AppUIBasics/DataModel/ControlInfoDataSource.cs
53 9 0
public static IntPtr RunOnUiThread()
in Tools/UIRecorder/UIRecorder/MainWindow.xaml.cs
52 10 5
protected override Size ArrangeOverride()
in ApplicationUnderTests/AppUIBasics/Common/WrapPanel.cs
48 10 1
bool XmlEncode()
in Tools/UIRecorder/UIXPathLib/UiTreeWalk.cpp
48 11 2
private static void RecorderThread()
in Tools/UIRecorder/UIRecorder/MouseKeyboardEventHandler.cs
45 10 0
private void UpdateUiTreeNodeValue()
in Tools/UIRecorder/UIRecorder/WindowEditNodeAttribute.xaml.cs
43 10 0
protected override Size MeasureOverride()
in ApplicationUnderTests/AppUIBasics/Common/WrapPanel.cs
42 8 1
private string HighlightPath()
in Tools/UIRecorder/UIRecorder/MainWindow.xaml.cs
42 8 2
private void EditAttribute_Click()
in Tools/UIRecorder/UIRecorder/MainWindow.xaml.cs
42 10 2
public static void AddToUiTree()
in Tools/UIRecorder/UIRecorder/UiTreeNode.cs
42 10 1