microsoft / DirectX-Graphics-Samples
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 4,383 units with 60,448 lines of code in units (2.8% of code).
    • 10 very complex units (3,175 lines of code)
    • 36 complex units (5,101 lines of code)
    • 101 medium complex units (7,820 lines of code)
    • 235 simple units (9,513 lines of code)
    • 4,001 very simple units (34,839 lines of code)
5% | 8% | 12% | 15% | 57%
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
hpp19% | 18% | 10% | 10% | 40%
cpp4% | 6% | 17% | 23% | 47%
h0% | 6% | 5% | 1% | 86%
inl0% | 0% | 0% | 42% | 57%
py0% | 0% | 0% | 14% | 85%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
MiniEngine/Model16% | 18% | 15% | 14% | 35%
Libraries/D3D12RaytracingFallback8% | 3% | 15% | 15% | 58%
MiniEngine/Core1% | 8% | 10% | 12% | 67%
TechniqueDemos/D3D12MemoryManagement0% | 11% | 12% | 21% | 55%
Libraries/D3DX12AffinityLayer0% | 3% | 7% | 18% | 70%
MiniEngine/ModelConverter0% | 24% | 50% | 2% | 23%
MiniEngine/Tools0% | 22% | 16% | 23% | 37%
Libraries/D3DX12Residency0% | 0% | 42% | 3% | 54%
Tools/DXGIAdapterRemovalSupportTest0% | 0% | 19% | 45% | 35%
MiniEngine/ModelViewer0% | 0% | 0% | 13% | 86%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
bool parse_msgpack_internal()
in MiniEngine/Model/json.hpp
339 273 0
bool parse_cbor_internal()
in MiniEngine/Model/json.hpp
383 233 2
token_type scan_string()
in MiniEngine/Model/json.hpp
488 212 0
void CStateObjectInfo::ResolveSubobjectAssociations()
in Libraries/D3D12RaytracingFallback/src/StateObjectProcessing.cpp
566 142 0
size_t BitsPerPixel()
in MiniEngine/Core/DDSTextureLoader.cpp
134 116 1
token_type scan_number()
in MiniEngine/Model/json.hpp
266 98 0
size_t PixelBuffer::BytesPerPixel()
in MiniEngine/Core/PixelBuffer.cpp
94 81 1
void CStateObjectInfo::AddCollection()
in Libraries/D3D12RaytracingFallback/src/StateObjectProcessing.cpp
328 60 1
void OptimizeMesh()
in MiniEngine/Model/MeshConvert.cpp
319 57 3
void write_msgpack()
in MiniEngine/Model/json.hpp
258 56 1
void write_cbor()
in MiniEngine/Model/json.hpp
263 50 1
static HRESULT CreateTextureFromDDS()
in MiniEngine/Core/DDSTextureLoader.cpp
186 47 3
static DXGI_FORMAT GetDXGIFormat()
in MiniEngine/Core/DDSTextureLoader.cpp
158 45 1
bool sax_parse_internal()
in MiniEngine/Model/json.hpp
205 41 1
static void GetSurfaceInfo()
in MiniEngine/Core/DDSTextureLoader.cpp
119 40 6
void GameInput::Update()
in MiniEngine/Core/GameInput.cpp
92 40 1
bool get_msgpack_string()
in MiniEngine/Model/json.hpp
65 40 1
bool ConvertToDDS()
in MiniEngine/Model/TextureConvert.cpp
183 37 2
bool get_cbor_string()
in MiniEngine/Model/json.hpp
75 37 1
bool get_cbor_binary()
in MiniEngine/Model/json.hpp
79 37 1