microsoft / axe-windows
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 2,560 units with 22,863 lines of code in units (62.8% of code).
    • 10 very long units (1,366 lines of code)
    • 5 long units (328 lines of code)
    • 89 medium size units (2,496 lines of code)
    • 471 small units (6,633 lines of code)
    • 1,985 very small units (12,040 lines of code)
5% | 1% | 10% | 29% | 52%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs5% | 1% | 10% | 28% | 52%
cpp0% | 0% | 30% | 38% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/RulesTest12% | 0% | 4% | 36% | 46%
src/Desktop5% | 6% | 18% | 24% | 44%
tools/WindowsFormsControlSampler90% | 0% | 0% | 0% | 9%
src/Core0% | 5% | 12% | 24% | 56%
src/Actions0% | 0% | 21% | 29% | 48%
src/AutomationTests0% | 0% | 32% | 43% | 24%
src/CLI0% | 0% | 38% | 36% | 25%
src/ActionsTests0% | 0% | 51% | 33% | 15%
src/CLITests0% | 0% | 16% | 53% | 29%
src/Rules0% | 0% | 1% | 11% | 86%
src/DesktopTests0% | 0% | 16% | 9% | 73%
src/CurrentFileVersionCompatibilityTests0% | 0% | 36% | 33% | 30%
src/CoreTests0% | 0% | 6% | 37% | 56%
src/UnitTestSharedLibrary0% | 0% | 65% | 34% | 0%
src/Automation0% | 0% | 7% | 32% | 60%
tools/Win32ControlSampler0% | 0% | 30% | 38% | 30%
src/OldFileVersionCompatibilityTests0% | 0% | 33% | 35% | 30%
src/RuleSelection0% | 0% | 0% | 59% | 40%
src/Telemetry0% | 0% | 0% | 70% | 29%
src/TelemetryTests0% | 0% | 0% | 40% | 59%
src/RulesMD0% | 0% | 0% | 69% | 30%
src/Win320% | 0% | 0% | 40% | 59%
tools/WildlifeManager0% | 0% | 0% | 27% | 72%
src/RuleSelectionTests0% | 0% | 0% | 33% | 66%
src/Win32Tests0% | 0% | 0% | 0% | 100%
src/SystemAbstractions0% | 0% | 0% | 0% | 100%
src/SystemAbstractionsTests0% | 0% | 0% | 0% | 100%
src/InteropDummy0% | 0% | 0% | 0% | 100%
src/CI0% | 0% | 0% | 0% | 100%
tools/WpfControlSampler0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private void InitializeComponent()
in tools/WindowsFormsControlSampler/src/WindowsFormsControlSampler/Form1.Designer.cs
163 1 0
public void MonsterButtonTest()
in src/RulesTest/MonsterTest.cs
139 1 0
public void MonsterListView()
in src/RulesTest/MonsterTest.cs
139 1 0
public void MonsterDataGrid()
in src/RulesTest/MonsterTest.cs
139 1 0
public void MonsterDataGridHeader()
in src/RulesTest/MonsterTest.cs
139 1 0
public void MonsterEdit()
in src/RulesTest/MonsterTest.cs
139 1 0
public void MonsterMenu()
in src/RulesTest/MonsterTest.cs
139 1 0
public void MonsterUserControl()
in src/RulesTest/MonsterTest.cs
139 1 0
private void RegisterEventListener()
in src/Desktop/UIAutomation/EventHandlers/EventListenerFactory.cs
125 20 1
private void UnregisterEventListener()
in src/Desktop/UIAutomation/EventHandlers/EventListenerFactory.cs
105 18 1
public static A11yPattern GetPatternInstance()
in src/Desktop/UIAutomation/A11yPatternFactory.cs
96 40 4
public override string ToString()
in src/Core/Bases/A11yProperty.cs
66 21 0
private void UnregisterAllEventListener()
in src/Desktop/UIAutomation/EventHandlers/EventListenerFactory.cs
62 4 0
private int PopulateSiblingTreeNodes()
in src/Desktop/UIAutomation/TreeWalkers/DesktopElementAncestry.cs
53 6 2
private static void PopulatePropertiesAndPatternsFromCache()
in src/Desktop/UIAutomation/DesktopElementExtensionMethods.cs
51 5 1
public static IList GetTemplate()
in src/Desktop/Types/TextAttributeTemplate.cs
49 1 0
public static IOptions ProcessInputs()
in src/CLI/OptionsEvaluator.cs
48 8 2
private void PopulateChildrenTreeNode()
in src/Desktop/UIAutomation/TreeWalkers/TreeWalkerForLive.cs
47 5 2
private int PopulateChildrenTreeNode()
in src/Desktop/UIAutomation/TreeWalkers/TreeWalkerForTest.cs
47 6 3
private void ProcessMessageQueue()
in src/Desktop/UIAutomation/EventHandlers/EventListenerFactory.cs
46 9 0