microsoft / dotnet-samples
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 365 units with 5,942 lines of code in units (75.0% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (117 lines of code)
    • 1 medium complex units (19 lines of code)
    • 21 simple units (673 lines of code)
    • 342 very simple units (5,133 lines of code)
0% | 1% | <1% | 11% | 86%
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
cs0% | 1% | <1% | 11% | 86%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
System.Numerics/SIMD/Mandelbrot0% | 8% | 1% | 15% | 74%
Microsoft.Diagnostics.Tracing/TraceEvent/TraceEvent0% | 0% | 0% | 16% | 83%
System.Numerics/SIMD/RayTracer0% | 0% | 0% | 13% | 86%
System.Reflection.Metadata/MdDumper/Visualization0% | 0% | 0% | 9% | 90%
Microsoft.Diagnostics.Tracing/EventSource/EventSource0% | 0% | 0% | 14% | 85%
WinForms-HDPI/SystemAware0% | 0% | 0% | 0% | 100%
WinForms-HDPI/PerMonitorAware0% | 0% | 0% | 0% | 100%
System.Reflection.Metadata/MdDumper0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public static Render SelectRender()
in System.Numerics/SIMD/Mandelbrot/Interfaces.cs
117 27 7
public object Convert()
in System.Numerics/SIMD/Mandelbrot/WPFHelpers.cs
19 12 4
private void DrawMandelbrot()
in System.Numerics/SIMD/Mandelbrot/MainWindow.xaml.cs
56 10 2
private Color CalculateRecursiveColor()
in System.Numerics/SIMD/RayTracer/Camera.cs
50 10 3
static void ProcessData()
in Microsoft.Diagnostics.Tracing/TraceEvent/TraceEvent/40_SimpleTraceLog.cs
35 9 1
private void WriteRows()
in System.Reflection.Metadata/MdDumper/Visualization/MetadataVisualizer.cs
52 8 1
public static void Run()
in Microsoft.Diagnostics.Tracing/TraceEvent/TraceEvent/51_SimpleMonitorRelogger.cs
78 7 0
public async Task RenderSceneToBitmapThreaded()
in System.Numerics/SIMD/RayTracer/Camera.cs
43 7 3
public static void SimulateInstall()
in Microsoft.Diagnostics.Tracing/EventSource/EventSource/30_EventLogEventSource.cs
44 6 3
private static string GetProcessName()
in Microsoft.Diagnostics.Tracing/TraceEvent/TraceEvent/20_ObserveGCEvent.cs
20 6 1
private static string GetProcessName()
in Microsoft.Diagnostics.Tracing/TraceEvent/TraceEvent/21_ObserveJitEvents.cs
20 6 1
private static string GetProcessName()
in Microsoft.Diagnostics.Tracing/TraceEvent/TraceEvent/22_ObserveEventSource.cs
20 6 1
static void Print()
in Microsoft.Diagnostics.Tracing/TraceEvent/TraceEvent/32_KernelAndClrFile.cs
10 6 1
static void Print()
in Microsoft.Diagnostics.Tracing/TraceEvent/TraceEvent/34_KernelAndClrFileWin7.cs
10 6 1
static void Print()
in Microsoft.Diagnostics.Tracing/TraceEvent/TraceEvent/50_SimpleFileRelogger.cs
10 6 1
static void Print()
in Microsoft.Diagnostics.Tracing/TraceEvent/TraceEvent/51_SimpleMonitorRelogger.cs
10 6 1
private void DrawMandelbrot()
in System.Numerics/SIMD/Mandelbrot/FlyThru.xaml.cs
57 6 2
public void RenderSingleThreadedWithADT()
in System.Numerics/SIMD/Mandelbrot/ScalarDouble.cs
28 6 5
public void RenderSingleThreadedNoADT()
in System.Numerics/SIMD/Mandelbrot/ScalarDouble.cs
30 6 5
public void RenderSingleThreadedWithADT()
in System.Numerics/SIMD/Mandelbrot/ScalarFloat.cs
23 6 5