microsoft / Detours
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 361 units with 7,429 lines of code in units (64.8% of code).
    • 3 very complex units (441 lines of code)
    • 4 complex units (926 lines of code)
    • 32 medium complex units (2,101 lines of code)
    • 40 simple units (1,446 lines of code)
    • 282 very simple units (2,515 lines of code)
5% | 12% | 28% | 19% | 33%
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
cpp5% | 12% | 28% | 19% | 33%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src5% | 12% | 28% | 19% | 33%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
55 68 1
55 68 1
BOOL CImage::Write()
in src/image.cpp
331 64 1
BOOL CImage::Read()
in src/image.cpp
250 45 1
244 44 3
294 38 5
138 32 5
105 24 4
BOOL WINAPI AllocExeHelper()
in src/creatwth.cpp
80 22 4
219 21 1
61 21 3
28 19 1
28 19 1
70 19 3
51 18 2
88 18 4
70 16 3
89 15 3
49 15 1
60 15 1