microsoft / OpenXR-MixedReality
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 3,407 units with 39,829 lines of code in units (45.6% of code).
    • 7 very complex units (1,811 lines of code)
    • 30 complex units (3,321 lines of code)
    • 124 medium complex units (7,076 lines of code)
    • 164 simple units (4,545 lines of code)
    • 3,082 very simple units (23,076 lines of code)
4% | 8% | 17% | 11% | 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
h6% | 7% | 19% | 14% | 52%
cpp6% | 20% | 27% | 11% | 34%
inl0% | 2% | 6% | 5% | 85%
hpp0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
shared/ext7% | 12% | 26% | 16% | 36%
shared/SampleShared/DirectXTK36% | 30% | 20% | 2% | 9%
shared/ext/rapidjson4% | 7% | 21% | 14% | 52%
shared/ext/DirectXMath0% | 4% | 9% | 5% | 81%
shared/ext/fmt0% | 5% | 12% | 13% | 68%
shared/XrSceneLib0% | 9% | 26% | 11% | 52%
shared/pbr0% | 0% | 22% | 11% | 65%
shared/gltf0% | 0% | 16% | 41% | 41%
shared/XrUtility0% | 0% | 7% | <1% | 91%
shared/SampleShared0% | 0% | 10% | 12% | 76%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
inline size_t BitsPerPixel()
in shared/SampleShared/DirectXTK/LoaderHelpers.h
146 124 1
bool TinyGLTF::LoadFromString()
in shared/ext/tiny_gltf.h
554 123 7
void ParseNumber()
in shared/ext/rapidjson/reader.h
235 93 2
HRESULT CreateTextureFromDDS()
in shared/SampleShared/DirectXTK/DDSTextureLoader.cpp
370 91 3
static int stbi__parse_png_file()
in shared/ext/stb_image.h
153 84 3
170 57 8
inline DXGI_FORMAT GetDXGIFormat()
in shared/SampleShared/DirectXTK/LoaderHelpers.h
183 52 1
inline void GetSurfaceInfo()
in shared/SampleShared/DirectXTK/LoaderHelpers.h
129 44 6
static void MergeVertsFast()
in shared/ext/mikktspace.cpp
90 42 5
inl
inline bool XM_CALLCONV Intersects()
in shared/ext/DirectXMath/Inc/DirectXCollision.inl
192 40 6
HRESULT DirectX::SHProjectCubeMap()
in shared/ext/DirectXMath/SHMath/DirectXSHD3D11.cpp
148 39 6
static tbool GenerateTSpaces()
in shared/ext/mikktspace.cpp
130 39 7
tbool genTangSpace()
in shared/ext/mikktspace.cpp
128 38 2
void Parse()
in shared/ext/rapidjson/internal/regex.h
107 37 1
static int stbi__process_marker()
in shared/ext/stb_image.h
92 37 2
HRESULT DirectX::SHProjectCubeMap()
in shared/ext/DirectXMath/SHMath/DirectXSHD3D12.cpp
121 36 6
101 36 1
103 34 3
HRESULT CreateD3DResources()
in shared/SampleShared/DirectXTK/DDSTextureLoader.cpp
211 33 15
OutputIt basic_printf_context::format()
in shared/ext/fmt/printf.h
97 33 0