microsoft / perfview
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 11,826 units with 158,518 lines of code in units (57.7% of code).
    • 19 very complex units (9,453 lines of code)
    • 57 complex units (9,188 lines of code)
    • 375 medium complex units (25,488 lines of code)
    • 830 simple units (26,366 lines of code)
    • 10,545 very simple units (88,023 lines of code)
5% | 5% | 16% | 16% | 55%
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
cs5% | 5% | 16% | 16% | 55%
cpp0% | 0% | 26% | 12% | 61%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/PerfView11% | 9% | 21% | 18% | 39%
src/TraceEvent3% | 3% | 10% | 14% | 67%
src/CSVReader6% | 10% | 26% | 23% | 32%
src/EtwHeapDump41% | 22% | 14% | 10% | 10%
src/HeapDump4% | 12% | 25% | 15% | 42%
src/TraceParserGen0% | 14% | 28% | 25% | 31%
src/MemoryGraph0% | 5% | 20% | 20% | 53%
src/related0% | 3% | 39% | 18% | 38%
src/FastSerialization0% | 0% | 12% | 18% | 69%
src/PerfViewExtensions0% | 0% | 47% | 0% | 52%
src/EtwClrProfiler0% | 0% | 21% | 10% | 68%
src/Utilities0% | 0% | 13% | 18% | 67%
src/HeapDumpCommon0% | 0% | 100% | 0% | 0%
src/PerfView.TestUtilities0% | 0% | 0% | 0% | 100%
src/PerfView640% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
1546 209 5
internal static void SetupCallbacks()
in src/TraceEvent/Computers/TraceManagedProcess.cs
1004 181 1
public override SourceLocation SourceLocationForManagedCode()
in src/TraceEvent/Symbols/NativeSymbolModule.cs
1014 129 2
private void ReadFile()
in src/PerfView/memory/ClrProfilerParser.cs
535 109 1
protected override Action OpenImpl()
in src/PerfView/PerfViewData.cs
413 103 2
private unsafe void SetupCallbacks()
in src/TraceEvent/TraceLog.cs
636 96 1
public static string ParsedArgsAsString()
in src/PerfView/CommandProcessor.cs
327 81 2
private unsafe void CopyRawEvents()
in src/TraceEvent/TraceLog.cs
409 80 2
internal void SetupCallbacks()
in src/EtwHeapDump/DotNetHeapDumpGraphReader.cs
355 70 4
public override void ForEach()
in src/PerfView/EtwEventSource.cs
267 70 1
public void Start()
in src/PerfView/CommandProcessor.cs
507 69 1
public static string GetManifestForRegisteredProvider()
in src/TraceEvent/RegisteredTraceEventParser.cs
357 66 1
protected override void WriteHtmlBody()
in src/PerfView/PerfViewData.cs
524 64 4
public bool ReadHeader()
in src/CSVReader/ETLStackBrowse/ZL/gzipdecoder.cs
189 62 1
private bool PopulateCommandLineArgs()
in src/PerfView/Dialogs/RunCommandDialog.xaml.cs
278 61 0
private void Read()
in src/PerfView/OtherSources/XMLStackSource.cs
242 59 1
public StackResult ComputeStacks()
in src/CSVReader/ETLStackBrowse/Stack.cs
300 58 2
private void DumpDotNetHeapDataWorker()
in src/HeapDump/GCHeapDumper.cs
279 57 4
public RunCommandDialog()
in src/PerfView/Dialogs/RunCommandDialog.xaml.cs
271 55 4
protected override void WriteHtmlBody()
in src/PerfView/PerfViewData.cs
417 50 4