microsoft / DirectXShaderCompiler
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 64,848 units with 815,703 lines of code in units (55.6% of code).
    • 392 very complex units (90,656 lines of code)
    • 965 complex units (97,687 lines of code)
    • 3,600 medium complex units (179,013 lines of code)
    • 5,463 simple units (135,183 lines of code)
    • 54,428 very simple units (313,164 lines of code)
11% | 11% | 21% | 16% | 38%
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
cpp12% | 13% | 24% | 18% | 30%
c17% | 14% | 27% | 12% | 28%
cs13% | 0% | 13% | 12% | 60%
py5% | 19% | 17% | 18% | 39%
cc4% | 0% | 13% | 17% | 65%
h<1% | 1% | 3% | 6% | 88%
inl0% | 41% | 19% | 11% | 27%
inc0% | 7% | 22% | 22% | 47%
pl0% | 52% | 0% | 20% | 27%
js0% | 0% | 5% | 22% | 71%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tools/clang11% | 11% | 22% | 16% | 38%
lib/CodeGen13% | 14% | 26% | 17% | 27%
lib/Transforms11% | 18% | 29% | 20% | 20%
projects/dxilconv39% | 8% | 13% | 10% | 28%
lib/HLSL13% | 12% | 31% | 18% | 24%
lib/Bitcode42% | 11% | 19% | 7% | 18%
lib/Analysis9% | 14% | 27% | 17% | 31%
lib/DxcSupport55% | 0% | 1% | 14% | 28%
lib/IR9% | 9% | 16% | 15% | 50%
lib/Miniz26% | 21% | 19% | 10% | 21%
tools/llvm-objdump16% | 19% | 30% | 18% | 14%
utils/TableGen8% | 18% | 28% | 18% | 26%
lib/MC7% | 14% | 21% | 19% | 37%
lib/AsmParser19% | 16% | 26% | 14% | 22%
lib/ExecutionEngine10% | 9% | 18% | 20% | 40%
lib/Support4% | 9% | 20% | 18% | 47%
lib/DXIL6% | 4% | 15% | 19% | 54%
tools/llvm-cxxdump73% | 0% | 0% | 13% | 12%
lib/DxcBindingTable80% | 0% | 0% | 0% | 19%
tools/llvm-size47% | 0% | 40% | 10% | 2%
lib/DxilContainer16% | 17% | 14% | 17% | 34%
tools/opt52% | 0% | 0% | 29% | 18%
tools/llvm-nm25% | 30% | 28% | 2% | 13%
utils/hct3% | 29% | 17% | 16% | 33%
utils/lit8% | 18% | 8% | 30% | 34%
include/llvm<1% | 1% | 4% | 9% | 84%
tools/llvm-config67% | 0% | 0% | 22% | 10%
lib/DebugInfo4% | 5% | 15% | 16% | 58%
lib/TableGen4% | 4% | 23% | 32% | 35%
include/dxc0% | 9% | 4% | 4% | 81%
lib/DxilRootSignature0% | 25% | 22% | 19% | 32%
lib/Object0% | 8% | 14% | 10% | 66%
lib/Linker0% | 29% | 26% | 16% | 26%
tools/llvm-readobj0% | 7% | 21% | 17% | 52%
lib/DxilPIXPasses0% | 9% | 31% | 30% | 28%
utils0% | 34% | 22% | 10% | 32%
utils/KillTheDoctor0% | 61% | 8% | 9% | 20%
tools/llvm-diff0% | 31% | 12% | 29% | 26%
tools/llvm-mc0% | 50% | 15% | 14% | 19%
tools/lli0% | 20% | 0% | 23% | 56%
utils/PerfectShuffle0% | 59% | 0% | 16% | 24%
tools/llvm-extract0% | 100% | 0% | 0% | 0%
tools/llc0% | 85% | 0% | 0% | 14%
tools/llvm-bcanalyzer0% | 40% | 51% | 0% | 8%
utils/FileCheck0% | 14% | 42% | 21% | 21%
tools/llvm-cov0% | 10% | 37% | 11% | 39%
tools/dsymutil0% | 4% | 31% | 36% | 27%
lib/Target0% | 12% | 6% | 23% | 57%
utils/llvm-build0% | 12% | 15% | 21% | 50%
utils/unittest0% | 0% | 6% | 12% | 80%
lib/DxrFallback0% | 0% | 23% | 14% | 62%
lib/DxilDia0% | 0% | 11% | 16% | 72%
tools/llvm-pdbdump0% | 0% | 38% | 21% | 39%
lib/ProfileData0% | 0% | 29% | 26% | 44%
tools/yaml2obj0% | 0% | 37% | 19% | 43%
tools/llvm-rtdyld0% | 0% | 61% | 20% | 17%
tools/obj2yaml0% | 0% | 45% | 0% | 54%
utils/release0% | 0% | 100% | 0% | 0%
lib/LTO0% | 0% | 21% | 20% | 58%
tools/llvm-stress0% | 0% | 38% | 5% | 55%
tools/llvm-lto0% | 0% | 75% | 0% | 24%
lib/Fuzzer0% | 0% | 11% | 31% | 57%
lib/Passes0% | 0% | 34% | 22% | 42%
tools/llvm-c-test0% | 0% | 22% | 17% | 60%
tools/dxexp0% | 0% | 53% | 36% | 9%
tools/llvm-dis0% | 0% | 47% | 41% | 10%
tools/llvm-mcmarkup0% | 0% | 45% | 13% | 41%
tools/llvm-profdata0% | 0% | 21% | 55% | 23%
utils/yaml-bench0% | 0% | 30% | 22% | 46%
utils/testgen0% | 0% | 86% | 0% | 13%
tools/verify-uselistorder0% | 0% | 11% | 31% | 57%
lib/Option0% | 0% | 7% | 48% | 44%
tools/macho-dump0% | 0% | 10% | 28% | 60%
tools/llvm-symbolizer0% | 0% | 7% | 33% | 58%
tools/llvm-link0% | 0% | 0% | 100% | 0%
tools/llvm-as0% | 0% | 0% | 100% | 0%
utils/lint0% | 0% | 0% | 36% | 63%
utils/not0% | 0% | 0% | 100% | 0%
utils/count0% | 0% | 0% | 100% | 0%
unittests/Analysis0% | 0% | 0% | 18% | 81%
unittests/Support0% | 0% | 0% | 2% | 97%
unittests/IR0% | 0% | 0% | 0% | 100%
unittests/ADT0% | 0% | 0% | 0% | 100%
lib/MSSupport0% | 0% | 0% | 0% | 100%
tools/lto0% | 0% | 0% | 0% | 100%
unittests/DebugInfo0% | 0% | 0% | 0% | 100%
unittests/ProfileData0% | 0% | 0% | 0% | 100%
unittests/Transforms0% | 0% | 0% | 0% | 100%
utils/version0% | 0% | 0% | 0% | 100%
lib/PassPrinters0% | 0% | 0% | 0% | 100%
include/llvm-c0% | 0% | 0% | 0% | 100%
lib/IRReader0% | 0% | 0% | 0% | 100%
unittests/Bitcode0% | 0% | 0% | 0% | 100%
tools/llvm-dwarfdump0% | 0% | 0% | 0% | 100%
unittests/Linker0% | 0% | 0% | 0% | 100%
utils/fpcmp0% | 0% | 0% | 0% | 100%
unittests/CodeGen0% | 0% | 0% | 0% | 100%
unittests/MC0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void Clang::ConstructJob()
in tools/clang/lib/Driver/Tools.cpp
1487 522 6
void DxbcConverter::ConvertInstructions()
in projects/dxilconv/lib/DxbcConverter/DxbcConverter.cpp
1864 457 1
RValue CodeGenFunction::EmitBuiltinExpr()
in tools/clang/lib/CodeGen/CGBuiltin.cpp
1341 405 4
bool FunctionAttrs::inferPrototypeAttributes()
in lib/Transforms/IPO/FunctionAttrs.cpp
833 384 1
std::error_code BitcodeReader::parseFunctionBody()
in lib/Bitcode/Reader/BitcodeReader.cpp
935 327 1
void Parser::ParseDeclarationSpecifiers()
in tools/clang/lib/Parse/ParseDecl.cpp
747 293 5
bool Lexer::LexTokenInternal()
in tools/clang/lib/Lex/Lexer.cpp
552 261 2
std::string SDNode::getOperationName()
in lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
286 255 1
ExprResult Parser::ParseCastExpression()
in tools/clang/lib/Parse/ParseExpr.cpp
568 241 4
void SelectionDAGLegalize::ExpandNode()
in lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
1042 237 1
void CGMSHLSLRuntime::AddHLSLFunctionInfo()
in tools/clang/lib/CodeGen/CGHLSLMS.cpp
942 234 2
static inline bool inheritsFrom()
in utils/TableGen/X86DisassemblerTables.cpp
278 230 4
SDValue SelectionDAG::getNode()
in lib/CodeGen/SelectionDAG/SelectionDAG.cpp
417 228 6
bool LLParser::ParseValID()
in lib/AsmParser/LLParser.cpp
495 219 2
int ReadDxcOpts()
in lib/DxcSupport/HLSLOptions.cpp
652 217 5
static ICEDiag CheckICE()
in tools/clang/lib/AST/ExprConstant.cpp
319 213 2
bool Sema::DiagnoseHLSLDecl()
in tools/clang/lib/Sema/SemaHLSL.cpp
497 194 5
void ExprEngine::Visit()
in tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
489 189 3
void CXXNameMangler::mangleExpression()
in tools/clang/lib/AST/ItaniumMangle.cpp
590 184 2
CXString clang_getCursorKindSpelling()
in tools/clang/tools/libclang/CIndex.cpp
369 183 1