microsoft / DirectXTex
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 911 units with 41,668 lines of code in units (62.5% of code).
    • 46 very complex units (15,392 lines of code)
    • 78 complex units (10,163 lines of code)
    • 127 medium complex units (7,423 lines of code)
    • 127 simple units (3,884 lines of code)
    • 533 very simple units (4,806 lines of code)
36% | 24% | 17% | 9% | 11%
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
cpp39% | 24% | 18% | 9% | 6%
h0% | 20% | 3% | 3% | 72%
inl0% | 0% | 27% | 14% | 58%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
DirectXTex22% | 34% | 18% | 9% | 14%
Texdiag78% | 0% | 11% | 5% | 4%
Texconv61% | 12% | 14% | 5% | 7%
DDSTextureLoader43% | 11% | 23% | 15% | 4%
ScreenGrab65% | 11% | 17% | <1% | 4%
Texassemble73% | 6% | 10% | 4% | 5%
WICTextureLoader47% | 0% | 16% | 18% | 17%
DDSView0% | 57% | 31% | 8% | 3%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
int __cdecl wmain()
in Texconv/texconv.cpp
1973 399 2
int __cdecl wmain()
in Texassemble/texassemble.cpp
1099 250 2
_Use_decl_annotations_ bool DirectX::_LoadScanline()
in DirectXTex/DirectXTexConvert.cpp
688 199 5
bool DirectX::_StoreScanline()
in DirectXTex/DirectXTexConvert.cpp
716 191 6
int __cdecl wmain()
in Texdiag/texdiag.cpp
808 168 2
void DirectX::_ConvertScanline()
in DirectXTex/DirectXTexConvert.cpp
616 148 5
size_t DirectX::BitsPerPixel()
in DirectXTex/DirectXTexUtil.cpp
143 126 1
size_t DirectX::BitsPerColor()
in DirectXTex/DirectXTexUtil.cpp
145 126 1
size_t BitsPerPixel()
in DDSTextureLoader/DDSTextureLoader12.cpp
136 119 1
size_t BitsPerPixel()
in ScreenGrab/ScreenGrab12.cpp
136 119 1
size_t BitsPerPixel()
in DDSTextureLoader/DDSTextureLoader11.cpp
133 116 1
size_t BitsPerPixel()
in ScreenGrab/ScreenGrab11.cpp
133 116 1
HRESULT UncompressPixels()
in DirectXTex/DirectXTexTGA.cpp
392 105 1
HRESULT DumpBCImage()
in Texdiag/texdiag.cpp
1318 104 3
bool DirectX::_StoreScanlineDither()
in DirectXTex/DirectXTexConvert.cpp
358 87 9
HRESULT DirectX::_EncodeDDSHeader()
in DirectXTex/DirectXTexDDS.cpp
253 87 5
HRESULT CreateTextureFromWIC()
in WICTextureLoader/WICTextureLoader11.cpp
337 86 11
bool LegacyExpandScanline()
in DirectXTex/DirectXTexDDS.cpp
235 83 1
bool DirectX::IsSupportedTexture()
in DirectXTex/DirectXTexD3D11.cpp
156 79 2
HRESULT Generate3DMipsCubicFilter()
in DirectXTex/DirectXTexMipmaps.cpp
297 79 4