microsoft / RoslynClrHeapAllocationAnalyzer
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 66 units with 864 lines of code in units (78.6% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (231 lines of code)
    • 5 medium size units (144 lines of code)
    • 16 small units (221 lines of code)
    • 41 very small units (268 lines of code)
0% | 26% | 16% | 25% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 26% | 16% | 25% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ClrHeapAllocationsAnalyzer0% | 26% | 16% | 25% | 31%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
protected override void AnalyzeNode()
in ClrHeapAllocationsAnalyzer/EnumeratorAllocationAnalyzer.cs
64 25 1
protected override void AnalyzeNode()
in ClrHeapAllocationsAnalyzer/ExplicitAllocationAnalyzer.cs
62 14 1
protected override void AnalyzeNode()
in ClrHeapAllocationsAnalyzer/TypeConversionAllocationAnalyzer.cs
54 11 1
private static void CheckDelegateCreation()
in ClrHeapAllocationsAnalyzer/TypeConversionAllocationAnalyzer.cs
51 15 8
protected override void AnalyzeNode()
in ClrHeapAllocationsAnalyzer/ConcatenationAllocationAnalyzer.cs
33 8 1
private void TryRegisterCodeFix()
in ClrHeapAllocationsAnalyzer/AvoidAllocationWithArrayEmptyCodeFix.cs
31 6 5
protected override void AnalyzeNode()
in ClrHeapAllocationsAnalyzer/CallSiteImplicitAllocationAnalyzer.cs
31 8 1
protected override void AnalyzeNode()
in ClrHeapAllocationsAnalyzer/DisplayClassAllocationAnalyzer.cs
26 5 1
private static void BinaryExpressionCheck()
in ClrHeapAllocationsAnalyzer/TypeConversionAllocationAnalyzer.cs
23 7 6
private bool IsExpectedParameterReadonlySequence()
in ClrHeapAllocationsAnalyzer/AvoidAllocationWithArrayEmptyCodeFix.cs
19 6 2
private static bool IsTypeReadonlySequence()
in ClrHeapAllocationsAnalyzer/AvoidAllocationWithArrayEmptyCodeFix.cs
18 6 2
private static void ClosureCaptureDataFlowAnalysis()
in ClrHeapAllocationsAnalyzer/DisplayClassAllocationAnalyzer.cs
18 6 3
public sealed override async Task RegisterCodeFixesAsync()
in ClrHeapAllocationsAnalyzer/AvoidAllocationWithArrayEmptyCodeFix.cs
17 3 1
private SyntaxNode ReplaceExpression()
in ClrHeapAllocationsAnalyzer/AvoidAllocationWithArrayEmptyCodeFix.cs
15 5 2
private bool IsCopyConstructor()
in ClrHeapAllocationsAnalyzer/AvoidAllocationWithArrayEmptyCodeFix.cs
15 6 2
private static void ConditionalExpressionCheck()
in ClrHeapAllocationsAnalyzer/TypeConversionAllocationAnalyzer.cs
14 3 5
private static void CastExpressionCheck()
in ClrHeapAllocationsAnalyzer/TypeConversionAllocationAnalyzer.cs
13 4 5
private void Analyze()
in ClrHeapAllocationsAnalyzer/AllocationAnalyzer.cs
12 3 1
private async Task Transform()
in ClrHeapAllocationsAnalyzer/AvoidAllocationWithArrayEmptyCodeFix.cs
12 2 4
private static void CheckNonOverridenMethodOnStruct()
in ClrHeapAllocationsAnalyzer/CallSiteImplicitAllocationAnalyzer.cs
12 4 4