microsoft / llvm-mctoll
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 493 units with 16,182 lines of code in units (43.4% of code).
    • 19 very complex units (6,683 lines of code)
    • 20 complex units (2,192 lines of code)
    • 58 medium complex units (3,163 lines of code)
    • 62 simple units (1,692 lines of code)
    • 334 very simple units (2,452 lines of code)
41% | 13% | 19% | 10% | 15%
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
cpp41% | 13% | 19% | 10% | 14%
h0% | 0% | 0% | 8% | 91%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
X8655% | 13% | 20% | 5% | 5%
ROOT30% | 12% | 19% | 17% | 20%
ARM/DAG67% | 9% | 12% | 0% | 10%
ARM0% | 28% | 28% | 15% | 28%
RISCV0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void InstSelector::selectCode()
in ARM/DAG/InstSelector.cpp
945 356 1
615 212 1
357 172 1
460 125 2
bool X86MachineInstructionRaiser::raiseMoveToMemInstr()
in X86/X86MachineInstructionRaiser.cpp
222 116 2
421 109 4
286 98 1
356 95 6
219 94 2
bool X86MachineInstructionRaiser::raiseCallMachineInstr()
in X86/X86MachineInstructionRaiser.cpp
308 91 1
354 73 4
186 69 3
281 66 8
void IREmitter::emitSpecialNode()
in ARM/DAG/IREmitter.cpp
521 65 1
375 63 3
250 61 1
210 59 1
227 58 0
90 53 2
131 48 16