microsoft / vs-threading
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 793 units with 11,726 lines of code in units (63.4% of code).
    • 0 very complex units (0 lines of code)
    • 5 complex units (575 lines of code)
    • 19 medium complex units (1,134 lines of code)
    • 93 simple units (3,182 lines of code)
    • 676 very simple units (6,835 lines of code)
0% | 4% | 9% | 27% | 58%
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% | 4% | 9% | 27% | 58%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/Microsoft.VisualStudio.Threading0% | 3% | 6% | 26% | 62%
src/Microsoft.VisualStudio.Threading.Analyzers.CSharp0% | 14% | 9% | 30% | 45%
src/SosThreadingTools0% | 18% | 22% | 23% | 35%
src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes0% | 0% | 25% | 35% | 38%
src/Microsoft.VisualStudio.Threading.Analyzers0% | 0% | 6% | 27% | 65%
src/Microsoft.VisualStudio.Threading.Analyzers.VisualBasic0% | 0% | 79% | 0% | 20%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private Diagnostic? AnalyzeAwaitedOrReturnedExpression()
in src/Microsoft.VisualStudio.Threading.Analyzers.CSharp/VSTHRD003UseJtfRunAsyncAnalyzer.cs
148 50 3
private bool TryIssueLock()
in src/Microsoft.VisualStudio.Threading/AsyncReaderWriterLock.cs
98 32 3
internal void Post()
in src/Microsoft.VisualStudio.Threading/JoinableTask.cs
117 29 3
private static void GetAllStateMachines()
in src/SosThreadingTools/DumpAsyncCommand.cs
124 29 4
private Task ReleaseAsync()
in src/Microsoft.VisualStudio.Threading/AsyncReaderWriterLock.cs
88 27 2
public override async Task RegisterCodeFixesAsync()
in src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/VSTHRD109AvoidAssertInAsyncMethodsCodeFix.cs
109 22 1
public override async Task RegisterCodeFixesAsync()
in src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/VSTHRD010MainThreadUsageCodeFix.cs
94 21 1
public static CombinedCancellationToken CombineWith()
in src/Microsoft.VisualStudio.Threading/CancellationTokenExtensions.cs
72 19 2
private bool TryDequeueSelfOrDependencies()
in src/Microsoft.VisualStudio.Threading/JoinableTask.cs
67 19 3
internal override Location? GetLocationOfBaseTypeName()
in src/Microsoft.VisualStudio.Threading.Analyzers.VisualBasic/VisualBasicUtils.cs
59 17 4
private static void RemoveDependingSynchronousTask()
in src/Microsoft.VisualStudio.Threading/JoinableTaskDependencyGraph.cs
65 16 4
private Task PrepareResourceAsync()
in src/Microsoft.VisualStudio.Threading/AsyncReaderWriterResourceLock`2.cs
61 15 3
private void AnalyzeInvocation()
in src/Microsoft.VisualStudio.Threading.Analyzers/AbstractVSTHRD105AvoidImplicitTaskSchedulerCurrentAnalyzer.cs
26 13 1
internal bool TryJoinComputation()
in src/Microsoft.VisualStudio.Threading/CancellableJoinComputation.cs
86 13 2
private static void ChainStateMachineBasedOnTaskContinuations()
in src/SosThreadingTools/DumpAsyncCommand.cs
52 13 3
private void AddToCallerCalleeMap()
in src/Microsoft.VisualStudio.Threading.Analyzers.CSharp/VSTHRD010MainThreadUsageAnalyzer.cs
50 12 2
private static IEnumerable GetAwaitableTypes()
in src/Microsoft.VisualStudio.Threading.Analyzers/DiagnosticAnalyzerState.cs
29 12 1
internal static bool IsPublic()
in src/Microsoft.VisualStudio.Threading.Analyzers/Utils.cs
30 12 1
internal void CompleteOnCurrentThread()
in src/Microsoft.VisualStudio.Threading/JoinableTask.cs
83 12 0
private static JoinableTask? AddDependingSynchronousTask()
in src/Microsoft.VisualStudio.Threading/JoinableTaskDependencyGraph.cs
62 12 3