microsoft / ApplicationInsights-dotnet
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,764 units with 35,555 lines of code in units (63.2% of code).
    • 12 very long units (1,812 lines of code)
    • 70 long units (4,552 lines of code)
    • 374 medium size units (11,079 lines of code)
    • 588 small units (8,602 lines of code)
    • 1,720 very small units (9,510 lines of code)
5% | 12% | 31% | 24% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs5% | 12% | 31% | 24% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
WEB/Src6% | 12% | 34% | 21% | 24%
BASE/src3% | 12% | 29% | 25% | 28%
NETCORE/src7% | 13% | 28% | 24% | 25%
LOGGING/src0% | 16% | 24% | 35% | 23%
troubleshooting/ETW0% | 0% | 30% | 34% | 34%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private Expression ProduceComparatorExpressionForSingleFieldCondition()
in WEB/Src/PerformanceCollector/PerformanceCollector/Filter.cs
226 75 3
public void Process()
in BASE/src/Microsoft.ApplicationInsights/Extensibility/Implementation/RichPayloadEventSource.cs
221 24 1
internal static void DecorateProfilerForSqlCommand()
in WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerRuntimeInstrumentation.cs
179 1 1
public void Configure()
in NETCORE/src/Shared/Implementation/TelemetryConfigurationOptionsSetup.cs
174 36 1
internal object OnBegin()
in WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpProcessing.cs
146 33 2
private void ProcessTelemetry()
in WEB/Src/PerformanceCollector/PerformanceCollector/QuickPulseTelemetryProcessor.cs
145 19 1
private static void PopulateTelemetryContext()
in BASE/src/Microsoft.ApplicationInsights/Metrics/Extensibility/MetricAggregateToApplicationInsightsPipelineConverterBase.cs
137 35 3
public delegate void AdaptiveSamplingPercentageEvaluatedCallback()
in BASE/src/ServerTelemetryChannel/Implementation/SamplingPercentageEstimatorTelemetryProcessor.cs
137 17 5
public CategorySample()
in WEB/Src/PerformanceCollector/PerformanceCollector/Implementation/QuickPulse/Process/PerfLib/CategorySample.cs
120 20 4
public static void TrackValueHelper()
in BASE/src/Microsoft.ApplicationInsights/Metrics/Implementation/AutocollectedMetricsExtraction/CommonHelper.cs
116 11 3
private void ExtractAndPostMetric()
in WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterListener.cs
108 21 2
public void OnNext()
in WEB/Src/DependencyCollector/DependencyCollector/HttpCoreDiagnosticSourceListener.cs
103 16 1
public void Initialize()
in BASE/src/Microsoft.ApplicationInsights/Extensibility/OperationCorrelationTelemetryInitializer.cs
100 35 1
public static IOperationHolder StartOperation()
in BASE/src/Microsoft.ApplicationInsights/TelemetryClientExtensions.cs
95 16 2
private MultidimensionalPointResult TryCreatePoint()
in BASE/src/Microsoft.ApplicationInsights/Metrics/Implementation/ConcurrentDatastructures/MultidimensionalCube2.cs
94 17 2
internal static DependencyTelemetry ExtractDependencyTelemetry()
in WEB/Src/DependencyCollector/DependencyCollector/TelemetryDiagnosticSourceListener.cs
94 18 2
public TimeSpan UpdateState()
in WEB/Src/PerformanceCollector/PerformanceCollector/Implementation/QuickPulse/QuickPulseCollectionStateManager.cs
92 16 2
internal static RequestTelemetry CreateRequestTelemetryPrivate()
in WEB/Src/Web/Web/Implementation/RequestTrackingExtensions.cs
91 18 1
public virtual Tuple Split()
in BASE/src/Microsoft.ApplicationInsights/Channel/Transmission.cs
89 13 1
private Action CreateHandlerForExceptionTelemetry()
in BASE/src/Microsoft.ApplicationInsights/Extensibility/Implementation/RichPayloadEventSource.TelemetryHandler.cs
88 2 4