microsoft / DirectXTK12
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,678 units with 24,331 lines of code in units (47.2% of code).
    • 12 very complex units (3,198 lines of code)
    • 12 complex units (1,579 lines of code)
    • 61 medium complex units (4,325 lines of code)
    • 98 simple units (3,322 lines of code)
    • 1,495 very simple units (11,907 lines of code)
13% | 6% | 17% | 13% | 48%
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
cpp15% | 6% | 22% | 16% | 38%
h10% | 8% | 8% | 5% | 66%
inl0% | 0% | 0% | 5% | 94%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Src14% | 6% | 18% | 14% | 45%
Audio15% | 12% | 23% | 14% | 33%
Inc0% | 0% | 2% | 6% | 90%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
inline size_t BitsPerPixel()
in Src/LoaderHelpers.h
155 134 1
466 102 5
283 89 6
bool DirectX::IsValid()
in Audio/SoundCommon.cpp
375 84 1
297 84 4
280 72 9
HRESULT WaveBankReader::Impl::Open()
in Audio/WaveBankReader.cpp
343 69 1
HRESULT CreateTextureFromWIC()
in Src/WICTextureLoader.cpp
270 66 8
159 57 5
HRESULT CreateTextureFromDDS()
in Src/DDSTextureLoader.cpp
228 56 3
199 56 1
inline HRESULT GetSurfaceInfo()
in Src/LoaderHelpers.h
143 52 6
unsigned int GetInputLayoutDesc()
in Src/ModelLoadSDKMESH.cpp
149 47 1
bool FormatIsUAVCompatible()
in Src/ResourceUploadBatch.cpp
63 46 3
HRESULT CreateTextureFromDDS()
in Src/XboxDDSTextureLoader.cpp
159 44 3
DXGI_FORMAT ConvertSRVtoResourceFormat()
in Src/ResourceUploadBatch.cpp
56 39 1
169 37 3
HRESULT WaveFindFormatAndData()
in Audio/WAVFileReader.cpp
131 33 1
172 32 4
136 32 2