microsoft / DbgShell
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 4,403 units with 61,502 lines of code in units (41.8% of code).
    • 36 very long units (4,788 lines of code)
    • 130 long units (9,094 lines of code)
    • 603 medium size units (18,099 lines of code)
    • 919 small units (13,310 lines of code)
    • 2,715 very small units (16,211 lines of code)
7% | 14% | 29% | 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
cs8% | 15% | 28% | 21% | 25%
h12% | 11% | 23% | 13% | 38%
cpp0% | 5% | 37% | 28% | 28%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
DbgProvider/public4% | 16% | 31% | 21% | 26%
DbgShell20% | 24% | 23% | 18% | 11%
ClrMemDiag/Desktop13% | 12% | 30% | 15% | 27%
DbgProvider/internal8% | 20% | 26% | 21% | 23%
ClrMemDiag/Utilities9% | 12% | 28% | 20% | 28%
ClrMemDiag/ICorDebug27% | 0% | 28% | 26% | 18%
ClrMemDiag/Debugger61% | 0% | 10% | 11% | 16%
DbgShellExt13% | 42% | 30% | 7% | 6%
ClrMemDiag/Native0% | 8% | 18% | 18% | 53%
DbgEngWrapper0% | 0% | 36% | 29% | 34%
ClrMemDiag0% | 0% | 22% | 31% | 45%
DbgNativeUtil0% | 0% | 0% | 100% | 0%
DbgProvider0% | 0% | 0% | 16% | 83%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private void ParseHelper()
in DbgShell/CommandLineParameterParser.cs
336 69 1
public static string IndentAndWrap()
in DbgProvider/internal/CaStringUtil.cs
221 33 5
void EnumTypeDefs()
in ClrMemDiag/ICorDebug/IMetadataImport.cs
188 1 2
public void Run()
in DbgShell/ColorConsoleHost.cs
164 27 0
private void SetThreadWaiters()
in ClrMemDiag/Desktop/lockinspection.cs
158 68 0
private static void LoadManagedLines()
in ClrMemDiag/Utilities/PDB/PdbFile.cs
157 24 8
internal static unsafe extern bool SymGetTypeInfo()
in DbgProvider/internal/Native/DbgHelp.cs
155 1 5
154 50 1
public static object Transform()
in DbgProvider/public/Commands/TransformationAttributes.cs
147 39 7
public static unsafe object SymGetTypeInfo()
in DbgProvider/internal/Native/DbgHelp.cs
138 32 4
private static void WriteConsoleOutputCJK()
in DbgShell/ConsoleControl.cs
138 18 6
static int MainWorker()
in DbgShell/MainClass.cs
137 8 1
protected static PSObject _CreateDbgValueWorker()
in DbgProvider/public/Debugger/DbgValue.cs
131 22 5
int ReadVirtual()
in ClrMemDiag/Debugger/IDebugDataSpaces.cs
130 1 4
private void _DoRunspaceInitialization()
in DbgShell/ColorConsoleHost.cs
127 18 7
internal PdbFunction()
in ClrMemDiag/Utilities/PDB/PdbFunction.cs
120 21 2
internal object GetValueAtAddress()
in ClrMemDiag/Desktop/heap.cs
119 37 2
internal static int FixGenericsWorker()
in ClrMemDiag/Desktop/types.cs
117 39 4
public override IEnumerable EnumerateMemoryRegions()
in ClrMemDiag/Desktop/runtimebase.cs
116 35 0
public Command()
in ClrMemDiag/Utilities/command.cs
116 24 2