microsoft / XmlNotepad
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 1,356 units with 21,309 lines of code in units (66.4% of code).
    • 10 very long units (2,107 lines of code)
    • 51 long units (3,446 lines of code)
    • 214 medium size units (6,675 lines of code)
    • 314 small units (4,571 lines of code)
    • 767 very small units (4,510 lines of code)
9% | 16% | 31% | 21% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs9% | 16% | 31% | 21% | 21%
js0% | 0% | 0% | 51% | 48%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Application24% | 15% | 21% | 18% | 19%
src/XmlNotepad5% | 16% | 34% | 21% | 22%
src/Model4% | 12% | 35% | 25% | 21%
src/XmlStats0% | 65% | 6% | 22% | 5%
src/BuildTasks0% | 14% | 74% | 10% | 0%
src/WpfApp0% | 11% | 29% | 26% | 32%
src/FontBuilder0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private void InitializeComponent()
in src/Application/FormMain.Designer.cs
881 1 0
private void InitializeComponent()
in src/Application/FormSearch.Designer.cs
206 1 0
private void InitializeComponent()
in src/Application/FormCsvImport.Designer.cs
167 1 0
public string DisplayXsltResults()
in src/XmlNotepad/XsltControl.cs
151 23 4
private void DrawItem()
in src/XmlNotepad/NodeTextView.cs
129 28 3
private void InitializeComponent()
in src/Application/FormSchemas.Designer.cs
126 1 0
public void HandleKeyDown()
in src/XmlNotepad/TreeView.cs
125 42 1
public XmlTreeNode GetTreeNode()
in src/XmlNotepad/Commands.cs
115 24 3
private void LoadDocument()
in src/Model/DomLoader.cs
106 24 0
private bool SettingValueMatches()
in src/Model/Settings.cs
101 36 2
public MoveNode()
in src/XmlNotepad/Commands.cs
96 22 5
private void myTreeView_KeyDown()
in src/XmlNotepad/XmlTreeView.cs
95 32 2
public void WriteReport()
in src/XmlStats/XmlStats.cs
93 10 2
public virtual void LoadConfig()
in src/Application/FormMain.cs
92 21 0
private void InitializeComponent()
in src/XmlNotepad/XmlTreeView.cs
89 1 0
private static int Main()
in src/XmlStats/XmlStats.cs
89 21 1
private void DoCompare()
in src/Application/FormMain.cs
87 10 1
public void Process()
in src/XmlStats/XmlStats.cs
87 24 1
private void myTreeView_AfterLabelEdit()
in src/XmlNotepad/XmlTreeView.cs
86 25 2
86 10 4