microsoft / DiagManager
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 225 units with 3,105 lines of code in units (48.4% of code).
    • 2 very long units (262 lines of code)
    • 6 long units (445 lines of code)
    • 30 medium size units (907 lines of code)
    • 51 small units (753 lines of code)
    • 136 very small units (738 lines of code)
8% | 14% | 29% | 24% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs9% | 15% | 28% | 23% | 23%
js0% | 0% | 33% | 39% | 27%
vbs0% | 0% | 0% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
DiagManager/DiagClasses6% | 14% | 29% | 27% | 22%
DiagManager17% | 13% | 23% | 14% | 30%
diagutil/Intercounters0% | 60% | 31% | 0% | 7%
DiagManager/CustomDiagnostics0% | 0% | 33% | 39% | 27%
diagutil0% | 0% | 66% | 33% | 0%
DiagManager/Properties0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private void MakeManualBatchFiles()
in DiagManager/DiagClasses/PackageMgr.cs
137 19 0
private void InitializeComponent()
in DiagManager/fmSettings.Designer.cs
125 1 0
private void InitializeComponent()
in DiagManager/fmHelp.Designer.cs
100 1 0
public string AddEventActionText()
in DiagManager/DiagClasses/XEvent.cs
84 20 0
public static DiagCategory GetCustomGroup()
in DiagManager/DiagClasses/DiagFactory.cs
74 11 2
public static void PopulateTree()
in DiagManager/DiagClasses/DiagTreeMgr.cs
72 18 3
static List GetEventCategoryList()
in DiagManager/DiagClasses/DiagFactory.cs
59 8 4
public void Translate()
in diagutil/Intercounters/XmlTranslator.cs
56 9 1
private static void OnCheck()
in DiagManager/DiagClasses/DiagTreeMgr.cs
47 13 2
public Xevent()
in DiagManager/DiagClasses/XEvent.cs
47 7 1
public bool ComputeFileHash()
in DiagManager/DiagClasses/PackageMgr.cs
44 6 2
function Split2000ErrorLog()
in DiagManager/CustomDiagnostics/SQL Base/errorlogs.js
43 4 1
void SetEventLogCollector()
in DiagManager/DiagClasses/ConfigFileMgr.cs
38 1 1
void SetCustomDiag()
in DiagManager/DiagClasses/ConfigFileMgr.cs
38 7 1
private void SetFont()
in DiagManager/fmDiagManager.cs
38 11 1
private void btnSaveSelection_Click()
in DiagManager/fmDiagManager.cs
38 9 2
static void FindSqldiag()
in diagutil/Program.cs
36 10 0
public void OnThreadException()
in DiagManager/Program.cs
35 5 2
private void CopyAllFiles()
in DiagManager/DiagClasses/PackageMgr.cs
34 3 0
private void fmDiagManager_Load()
in DiagManager/fmDiagManager.cs
34 2 2