apple / indexstore-db
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 6,907 units with 45,011 lines of code in units (42.6% of code).
    • 12 very complex units (1,963 lines of code)
    • 30 complex units (2,194 lines of code)
    • 122 medium complex units (5,435 lines of code)
    • 270 simple units (6,417 lines of code)
    • 6,473 very simple units (29,002 lines of code)
4% | 4% | 12% | 14% | 64%
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
cpp7% | 8% | 20% | 18% | 44%
inc12% | 2% | 19% | 21% | 43%
h0% | <1% | 1% | 7% | 89%
c0% | 13% | 20% | 23% | 42%
swift0% | 21% | 0% | 16% | 62%
py0% | 0% | 26% | 44% | 28%
mm0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib/LLVMSupport6% | 5% | 15% | 16% | 55%
lib/Index0% | 9% | 8% | 15% | 66%
lib/Database0% | 5% | 12% | 13% | 68%
include/llvm0% | <1% | 1% | 8% | 88%
Sources/IndexStoreDB0% | 57% | 0% | 0% | 42%
lib/CIndexStoreDB0% | 10% | 0% | 0% | 89%
lib/Support0% | 0% | 13% | 10% | 75%
lib/Core0% | 0% | 10% | 4% | 85%
Utilities0% | 0% | 26% | 44% | 28%
Sources/tibs0% | 0% | 0% | 76% | 23%
Sources/ISDBTestSupport0% | 0% | 0% | 7% | 92%
include/indexstore0% | 0% | 0% | 0% | 100%
include/IndexStoreDB0% | 0% | 0% | 0% | 100%
Sources/ISDBTibs0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
int llvm::sys::unicode::foldCharSimple()
in lib/LLVMSupport/Support/UnicodeCaseFold.cpp
541 283 1
static bool is_local_impl()
in lib/LLVMSupport/Support/Unix/Path.inc
466 104 1
static void getAvailableFeatures()
in lib/LLVMSupport/Support/Host.cpp
113 94 6
bool sys::getHostCPUFeatures()
in lib/LLVMSupport/Support/Host.cpp
102 90 1
bool CommandLineParser::ParseCommandLineOptions()
in lib/LLVMSupport/Support/CommandLine.cpp
235 77 4
static Triple::ObjectFormatType getDefaultFormat()
in lib/LLVMSupport/Support/Triple.cpp
67 55 1
std::string Triple::normalize()
in lib/LLVMSupport/Support/Triple.cpp
141 55 1
bool Scanner::fetchMoreTokens()
in lib/LLVMSupport/Support/YAMLParser.cpp
66 54 0
StringRef Triple::getArchTypeName()
in lib/LLVMSupport/Support/Triple.cpp
55 51 1
static unsigned getArchPointerBitWidth()
in lib/LLVMSupport/Support/Triple.cpp
59 51 1
Triple Triple::get32BitArchVariant()
in lib/LLVMSupport/Support/Triple.cpp
59 51 0
Triple Triple::get64BitArchVariant()
in lib/LLVMSupport/Support/Triple.cpp
59 51 0
void IEEEFloat::toString()
in lib/LLVMSupport/Support/APFloat.cpp
138 45 4
StringRef Triple::getArchTypePrefix()
in lib/LLVMSupport/Support/Triple.cpp
50 45 1
StringRef ScalarNode::unescapeDoubleQuoted()
in lib/LLVMSupport/Support/YAMLParser.cpp
126 41 3
void StoreUnitRepo::registerUnit()
in lib/Index/IndexDatastore.cpp
195 40 3
Triple Triple::getBigEndianArchVariant()
in lib/LLVMSupport/Support/Triple.cpp
48 38 0
StringRef Triple::getOSTypeName()
in lib/LLVMSupport/Support/Triple.cpp
41 37 1
bool Triple::isLittleEndian()
in lib/LLVMSupport/Support/Triple.cpp
42 36 0
inline bool isNumeric()
in include/llvm/Support/YAMLTraits.h
64 35 1