microsoft / ApplicationInsights-dotnet
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 2,764 units with 35,555 lines of code in units (63.2% of code).
    • 1 very complex units (226 lines of code)
    • 5 complex units (615 lines of code)
    • 58 medium complex units (4,033 lines of code)
    • 179 simple units (5,996 lines of code)
    • 2,521 very simple units (24,685 lines of code)
<1% | 1% | 11% | 16% | 69%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
cs<1% | 1% | 11% | 16% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
WEB/Src1% | <1% | 12% | 17% | 67%
BASE/src0% | 1% | 10% | 15% | 73%
NETCORE/src0% | 7% | 15% | 17% | 60%
LOGGING/src0% | 0% | 10% | 27% | 61%
troubleshooting/ETW0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private Expression ProduceComparatorExpressionForSingleFieldCondition()
in WEB/Src/PerformanceCollector/PerformanceCollector/Filter.cs
226 75 3
public void Configure()
in NETCORE/src/Shared/Implementation/TelemetryConfigurationOptionsSetup.cs
174 36 1
public void Initialize()
in BASE/src/Microsoft.ApplicationInsights/Extensibility/OperationCorrelationTelemetryInitializer.cs
100 35 1
private static void PopulateTelemetryContext()
in BASE/src/Microsoft.ApplicationInsights/Metrics/Extensibility/MetricAggregateToApplicationInsightsPipelineConverterBase.cs
137 35 3
private static bool ShouldSubscribe()
in BASE/src/Microsoft.ApplicationInsights/Extensibility/Implementation/Tracing/DiagnosticsModule/DiagnosticsEventListener.cs
58 33 1
internal object OnBegin()
in WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpProcessing.cs
146 33 2
private void InjectRequestHeaders()
in WEB/Src/DependencyCollector/DependencyCollector/HttpCoreDiagnosticSourceListener.cs
82 25 2
public void Process()
in BASE/src/Microsoft.ApplicationInsights/Extensibility/Implementation/RichPayloadEventSource.cs
221 24 1
public void OnNext()
in NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/DiagnosticListeners/Implementation/HostingDiagnosticListener.cs
82 22 1
private void ExtractAndPostMetric()
in WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterListener.cs
108 21 2
public override void OnEvent()
in WEB/Src/DependencyCollector/DependencyCollector/Implementation/AzureSdk/AzureSdkDiagnosticsEventHandler.cs
70 20 2
public CategorySample()
in WEB/Src/PerformanceCollector/PerformanceCollector/Implementation/QuickPulse/Process/PerfLib/CategorySample.cs
120 20 4
private void ProcessTelemetry()
in WEB/Src/PerformanceCollector/PerformanceCollector/QuickPulseTelemetryProcessor.cs
145 19 1
public void Initialize()
in BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs
78 18 1
internal static DependencyTelemetry ExtractDependencyTelemetry()
in WEB/Src/DependencyCollector/DependencyCollector/TelemetryDiagnosticSourceListener.cs
94 18 2
internal static RequestTelemetry CreateRequestTelemetryPrivate()
in WEB/Src/Web/Web/Implementation/RequestTrackingExtensions.cs
91 18 1
internal string GetValueForField()
in WEB/Src/WindowsServer/WindowsServer/Implementation/DataContracts/AzureInstanceComputeMetadata.cs
62 18 1
protected virtual void Dispose()
in BASE/src/Microsoft.ApplicationInsights/Extensibility/Implementation/OperationHolder.cs
62 17 1
private MultidimensionalPointResult TryCreatePoint()
in BASE/src/Microsoft.ApplicationInsights/Metrics/Implementation/ConcurrentDatastructures/MultidimensionalCube2.cs
94 17 2
public delegate void AdaptiveSamplingPercentageEvaluatedCallback()
in BASE/src/ServerTelemetryChannel/Implementation/SamplingPercentageEstimatorTelemetryProcessor.cs
137 17 5