microsoft / Xbox-ATG-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 14,338 units with 241,098 lines of code in units (56.6% of code).
    • 75 very complex units (21,468 lines of code)
    • 130 complex units (16,864 lines of code)
    • 677 medium complex units (54,355 lines of code)
    • 986 simple units (39,912 lines of code)
    • 12,470 very simple units (108,499 lines of code)
8% | 6% | 22% | 16% | 45%
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
cpp9% | 7% | 25% | 14% | 43%
c16% | 11% | 26% | 23% | 22%
h3% | 5% | 3% | 31% | 55%
inl0% | 0% | <1% | 6% | 92%
cs0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Kits/DirectXTex25% | 33% | 22% | 11% | 7%
Kits/DirectXTK15% | 7% | 19% | 13% | 43%
Kits/DirectXTK1213% | 6% | 17% | 13% | 48%
PCSamples/IntroGraphics13% | 3% | 29% | 18% | 35%
XDKSamples/Tools33% | 7% | 18% | 10% | 30%
XDKSamples/Graphics5% | 6% | 22% | 22% | 43%
UWPSamples/System5% | <1% | 33% | 15% | 44%
PCSamples/Graphics10% | 7% | 24% | 17% | 38%
PCSamples/Raytracing6% | 0% | 29% | 14% | 49%
Kits/ATGTK4% | 11% | 8% | 12% | 62%
UWPSamples/IntroGraphics0% | 2% | 33% | 13% | 50%
UWPSamples/Audio0% | 3% | 33% | 19% | 44%
UWPSamples/Graphics0% | 4% | 28% | 14% | 52%
XDKSamples/System0% | <1% | 9% | 19% | 69%
XDKSamples/Audio0% | 0% | 16% | 20% | 63%
XDKSamples/IntroGraphics0% | 0% | 7% | 25% | 67%
UWPSamples/Tools0% | 0% | 0% | 0% | 100%
Kits/CPUTK0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
int __cdecl wmain()
in XDKSamples/Tools/xtexconv/texconv.cpp
2027 408 2
void Sample::Render()
in UWPSamples/System/SystemInfoUWP/SystemInfo.cpp
1133 276 0
_Use_decl_annotations_ bool DirectX::_LoadScanline()
in Kits/DirectXTex/DirectXTexConvert.cpp
688 199 5
bool DirectX::_StoreScanline()
in Kits/DirectXTex/DirectXTexConvert.cpp
716 191 6
int ZEXPORT inflate()
in XDKSamples/Graphics/SimpleDmaDecompression/zlib/zlib-1.2.8/inflate.c
631 191 2
void DirectX::_ConvertScanline()
in Kits/DirectXTex/DirectXTexConvert.cpp
616 148 5
inline size_t BitsPerPixel()
in Kits/DirectXTK/Src/LoaderHelpers.h
155 134 1
inline size_t BitsPerPixel()
in Kits/DirectXTK12/Src/LoaderHelpers.h
155 134 1
size_t DirectX::BitsPerPixel()
in Kits/DirectXTex/DirectXTexUtil.cpp
143 126 1
size_t DirectX::BitsPerColor()
in Kits/DirectXTex/DirectXTexUtil.cpp
145 126 1
std::unique_ptr DirectX::Model::CreateFromCMO()
in Kits/DirectXTK/Src/ModelLoadCMO.cpp
503 110 6
HRESULT UncompressPixels()
in Kits/DirectXTex/DirectXTexTGA.cpp
392 105 1
std::unique_ptr DirectX::Model::CreateFromCMO()
in Kits/DirectXTK12/Src/ModelLoadCMO.cpp
466 102 5
HRESULT CreateTextureFromDDS()
in Kits/DirectXTK/Src/DDSTextureLoader.cpp
417 101 3
HRESULT CreateTextureFromWIC()
in Kits/DirectXTK/Src/WICTextureLoader.cpp
390 100 3
int ZEXPORT deflate()
in XDKSamples/Graphics/SimpleDmaDecompression/zlib/zlib-1.2.8/deflate.c
264 96 2
std::shared_ptr EffectFactory::Impl::CreateEffect()
in Kits/DirectXTK12/Src/EffectFactory.cpp
283 89 6
bool DirectX::_StoreScanlineDither()
in Kits/DirectXTex/DirectXTexConvert.cpp
358 87 9
HRESULT DirectX::_EncodeDDSHeader()
in Kits/DirectXTex/DirectXTexDDS.cpp
253 87 5
class __declspec()
in Kits/ATGTK/OrbitCamera.cpp
338 86 1