microsoft / BuildXL
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 31,033 units with 428,497 lines of code in units (69.7% of code).
    • 41 very complex units (11,851 lines of code)
    • 126 complex units (15,188 lines of code)
    • 941 medium complex units (59,512 lines of code)
    • 1,997 simple units (69,131 lines of code)
    • 27,928 very simple units (272,815 lines of code)
2% | 3% | 13% | 16% | 63%
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
cs2% | 3% | 12% | 15% | 66%
ts5% | 4% | 26% | 20% | 42%
cpp1% | 10% | 24% | 17% | 45%
mm0% | 0% | 73% | 18% | 8%
hpp0% | 0% | 14% | 4% | 81%
c0% | 0% | 9% | 14% | 75%
h0% | 0% | 0% | 16% | 83%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Public/Src2% | 3% | 13% | 16% | 63%
Private/Wdg0% | 5% | 16% | 16% | 60%
Public/Sdk0% | 0% | 37% | 26% | 36%
Private/CloudStorePlayground0% | 0% | 16% | 33% | 50%
Shared/Npm0% | 0% | 0% | 38% | 61%
Private/CloudTest0% | 0% | 0% | 0% | 100%
Private/InternalSdk0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export function forEachChild()
in Public/Src/FrontEnd/TypeScript.Net/TypeScript.Net/TypeScriptImpl/Parser.ts
350 244 2
public SyntaxKind Scan()
in Public/Src/FrontEnd/TypeScript.Net/TypeScript.Net/Scanning/Scanner.cs
494 139 0
private static void DoGetChildren()
in Public/Src/FrontEnd/TypeScript.Net/TypeScript.Net/Parsing/NodeWalker.cs
546 112 3
private static T ForEachChild()
in Public/Src/FrontEnd/TypeScript.Net/TypeScript.Net/Printing/NodeWalkerEx.cs
455 109 3
private async Task ProcessSandboxedProcessResultAsync()
in Public/Src/Engine/Processes/SandboxedProcessPipExecutor.cs
375 108 6
public static Node Read()
in Public/Src/FrontEnd/Script/Ast/Node.Persistence.cs
214 108 1
private async Task ExecutePipStep()
in Public/Src/Engine/Scheduler/Scheduler.cs
576 105 1
private bool CheckGrammarModifiers()
in Public/Src/FrontEnd/TypeScript.Net/TypeScript.Net/TypeChecking/Checker.cs
265 100 1
function checkGrammarModifiers()
in Public/Src/FrontEnd/TypeScript.Net/TypeScript.Net/TypeScriptImpl/checker.ts
211 98 1
function emitJavaScriptWorker()
in Public/Src/FrontEnd/TypeScript.Net/TypeScript.Net/TypeScriptImpl/emitter.ts
169 91 1
private ISymbol ResolveName()
in Public/Src/FrontEnd/TypeScript.Net/TypeScript.Net/TypeChecking/Checker.cs
259 89 6
public Args()
in Public/Src/Tools/Execution.Analyzer/Args.cs
295 84 1
private bool TryGetObservedFileAccesses()
in Public/Src/Engine/Processes/SandboxedProcessPipExecutor.cs
316 83 6
private IType CheckBinaryLikeExpression()
in Public/Src/FrontEnd/TypeScript.Net/TypeScript.Net/TypeChecking/Checker.cs
225 83 5
internal static async Task ProcessInternalAsync()
in Public/Src/Engine/Scheduler/Fingerprints/ObservedInputProcessor.cs
497 82 10
371 81 4
private BuildXLEngineResult DoRun()
in Public/Src/Engine/Dll/Engine.cs
442 76 3
export function isExpression()
in Public/Src/FrontEnd/TypeScript.Net/TypeScript.Net/TypeScriptImpl/Utilities.ts
100 76 1
public static bool IsExpression()
in Public/Src/FrontEnd/TypeScript.Net/TypeScript.Net/Types/NodeUtilities.cs
120 76 1
private unsafe void FindRabinChunkBoundariesInternal()
in Public/Src/Cache/ContentStore/Hashing/Chunking/RegressionChunking.cs
508 74 5