microsoft / DirectXTK
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 1,451 units with 24,250 lines of code in units (47.8% of code).
    • 14 very complex units (4,356 lines of code)
    • 10 complex units (1,589 lines of code)
    • 64 medium complex units (4,603 lines of code)
    • 105 simple units (3,303 lines of code)
    • 1,258 very simple units (10,399 lines of code)
17% | 6% | 18% | 13% | 42%
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
cpp19% | 8% | 22% | 13% | 36%
h28% | 0% | 12% | 13% | 46%
cs0% | 0% | 7% | 30% | 62%
inl0% | 0% | 0% | 5% | 94%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Src18% | 6% | 22% | 14% | 38%
XWBTool76% | 0% | 11% | 2% | 10%
Audio15% | 12% | 23% | 14% | 33%
MakeSpriteFont0% | 0% | 7% | 30% | 62%
Inc0% | 0% | <1% | 6% | 92%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
inline size_t BitsPerPixel()
in Src/LoaderHelpers.h
155 134 1
int __cdecl wmain()
in XWBTool/xwbtool.cpp
567 113 2
503 110 6
HRESULT CreateTextureFromDDS()
in Src/DDSTextureLoader.cpp
417 101 3
HRESULT CreateTextureFromWIC()
in Src/WICTextureLoader.cpp
390 100 3
bool DirectX::IsValid()
in Audio/SoundCommon.cpp
375 84 1
314 84 5
bool ConvertToMiniFormat()
in XWBTool/xwbtool.cpp
362 80 3
188 72 3
267 70 7
HRESULT WaveBankReader::Impl::Open()
in Audio/WaveBankReader.cpp
343 69 1
199 56 1
inline HRESULT GetSurfaceInfo()
in Src/LoaderHelpers.h
143 52 6
133 52 3
unsigned int GetInputLayoutDesc()
in Src/ModelLoadSDKMESH.cpp
149 46 1
164 41 3
HRESULT CreateTextureFromDDS()
in Src/XboxDDSTextureLoader.cpp
137 38 3
169 37 3
HRESULT WaveFindFormatAndData()
in Audio/WAVFileReader.cpp
131 33 1
HRESULT CreateD3DResources()
in Src/DDSTextureLoader.cpp
212 33 15