microsoft / checkedc-llvm-test-suite
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 23,233 units with 538,882 lines of code in units (42.7% of code).
    • 222 very complex units (80,428 lines of code)
    • 521 complex units (75,165 lines of code)
    • 1,743 medium complex units (117,477 lines of code)
    • 2,504 simple units (82,550 lines of code)
    • 18,243 very simple units (183,262 lines of code)
14% | 13% | 21% | 15% | 34%
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
c22% | 17% | 21% | 13% | 24%
cpp8% | 12% | 24% | 17% | 37%
cc6% | 12% | 26% | 15% | 38%
inc11% | 1% | 4% | 10% | 71%
cxx11% | 15% | 22% | 6% | 43%
hpp0% | 2% | 9% | 26% | 60%
h0% | 0% | 3% | 14% | 82%
py0% | 0% | 23% | 27% | 48%
perl0% | 0% | 63% | 0% | 36%
pl0% | 0% | 0% | 60% | 39%
hh0% | 0% | 0% | 0% | 100%
hxx0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
MultiSource15% | 14% | 21% | 15% | 32%
CTMark14% | 13% | 22% | 14% | 34%
MicroBenchmarks5% | 11% | 22% | 10% | 50%
SingleSource1% | 2% | 12% | 23% | 60%
cmake0% | 96% | 0% | 0% | 3%
tools0% | 19% | 58% | 0% | 22%
litsupport0% | 0% | 28% | 33% | 38%
LNTBased0% | 0% | 50% | 26% | 23%
utils0% | 0% | 27% | 44% | 28%
ROOT0% | 0% | 0% | 28% | 71%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void Mesh::calc_neighbors_local()
in MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/mesh.cpp
1702 567 1
Static void zgettok()
in MultiSource/Benchmarks/MallocBench/p2c/lex.c
773 307 0
void constants()
in CTMark/mafft/constants.c
813 297 2
void constants()
in MultiSource/Benchmarks/mafft/constants.c
813 297 2
void Mesh::gpu_calc_neighbors_local()
in MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/mesh.cpp
1255 265 1
static void echo()
in CTMark/consumer-typeset/z25.c
573 248 3
static void echo()
in MultiSource/Benchmarks/MiBench/consumer-typeset/z25.c
573 248 3
Static int parsecomment()
in MultiSource/Benchmarks/MallocBench/p2c/lex.c
497 243 2
OBJECT Manifest()
in CTMark/consumer-typeset/z08.c
882 228 11
OBJECT Manifest()
in MultiSource/Benchmarks/MiBench/consumer-typeset/z08.c
882 228 11
OBJECT Parse()
in CTMark/consumer-typeset/z06.c
609 217 4
OBJECT Parse()
in MultiSource/Benchmarks/MiBench/consumer-typeset/z06.c
609 217 4
OBJECT MinSize()
in CTMark/consumer-typeset/z12.c
814 211 3
OBJECT MinSize()
in MultiSource/Benchmarks/MiBench/consumer-typeset/z12.c
814 211 3
void FlushGalley()
in CTMark/consumer-typeset/z20.c
693 196 1
void FlushGalley()
in MultiSource/Benchmarks/MiBench/consumer-typeset/z20.c
693 196 1
Static void wrexpr()
in MultiSource/Benchmarks/MallocBench/p2c/pexpr.c
631 195 2
void Mesh::set_refinement_order()
in MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/mesh.cpp
243 185 11
void genorient()
in MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/genorient.c
535 183 1
OBJECT FixAndPrintObject()
in CTMark/consumer-typeset/z23.c
882 180 10