microsoft / CMake
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 13,730 units with 315,419 lines of code in units (45.6% of code).
    • 104 very complex units (36,427 lines of code)
    • 304 complex units (41,123 lines of code)
    • 1,113 medium complex units (70,607 lines of code)
    • 1,756 simple units (56,593 lines of code)
    • 10,453 very simple units (110,669 lines of code)
11% | 13% | 22% | 17% | 35%
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
c13% | 13% | 22% | 17% | 32%
cxx10% | 13% | 22% | 18% | 35%
cpp0% | 6% | 31% | 25% | 36%
h0% | 3% | 7% | 4% | 84%
py0% | 0% | 10% | 30% | 58%
hxx0% | 0% | 0% | 0% | 100%
inl0% | 0% | 0% | 0% | 100%
cc0% | 0% | 0% | 0% | 100%
pl0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
mm0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Utilities/cmcurl22% | 17% | 21% | 13% | 25%
Source10% | 12% | 22% | 18% | 36%
Source/kwsys18% | 12% | 20% | 16% | 31%
Utilities/cmnghttp220% | 7% | 12% | 17% | 41%
Source/CTest7% | 15% | 25% | 18% | 33%
Utilities/cmbzip220% | 30% | 25% | 4% | 18%
Utilities/cmzlib20% | 17% | 24% | 18% | 20%
Utilities/cmlibuv2% | 9% | 26% | 26% | 34%
Utilities/cmzstd4% | 9% | 24% | 16% | 45%
Utilities/cmlibarchive2% | 6% | 23% | 14% | 52%
Source/CursesDialog5% | 4% | 26% | 27% | 35%
Utilities/cmliblzma5% | 8% | 30% | 16% | 39%
Source/CPack0% | 27% | 24% | 15% | 32%
Utilities/cmjsoncpp0% | 5% | 29% | 23% | 41%
Utilities/std0% | 17% | 33% | 8% | 40%
Source/QtDialog0% | 4% | 14% | 18% | 62%
Source/LexerParser0% | 0% | 15% | 12% | 71%
Utilities/cmlibrhash0% | 0% | 8% | 36% | 54%
Utilities/Sphinx0% | 0% | 19% | 39% | 41%
Help/guide0% | 0% | 0% | 21% | 78%
Utilities/cmexpat0% | 0% | 0% | 14% | 85%
Utilities/cmvssetup0% | 0% | 0% | 0% | 100%
Modules0% | 0% | 0% | 0% | 100%
Source/Checks0% | 0% | 0% | 0% | 100%
Modules/FortranCInterface0% | 0% | 0% | 0% | 100%
Auxiliary/vim0% | 0% | 0% | 0% | 100%
Utilities/Release0% | 0% | 0% | 0% | 100%
Modules/CheckIPOSupported0% | 0% | 0% | 0% | 100%
Modules/FindMPI0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
CURLcode Curl_vsetopt()
in Utilities/cmcurl/lib/setopt.c
1837 562 3
static CURLcode ssh_statemach_act()
in Utilities/cmcurl/lib/vssh/libssh2.c
1655 335 2
cxx
bool SystemTools::FileIsDirectory()
in Source/kwsys/SystemTools.cxx
1411 313 1
cxx
766 249 2
ssize_t nghttp2_session_mem_recv()
in Utilities/cmnghttp2/lib/nghttp2_session.c
1047 234 3
static CURLcode myssh_statemach_act()
in Utilities/cmcurl/lib/vssh/libssh.c
1071 218 2
int ZEXPORT inflate()
in Utilities/cmzlib/inflate.c
587 172 2
size_t Curl_ftp_parselist()
in Utilities/cmcurl/lib/ftplistparser.c
659 164 4
cxx
bool HandleTargetsMode()
in Source/cmInstallCommand.cxx
583 154 2
static CURLMcode multi_runsingle()
in Utilities/cmcurl/lib/multi.c
581 144 3
cxx
int cmCoreTryCompile::TryCompileCode()
in Source/cmCoreTryCompile.cxx
659 141 2
static CURLcode ossl_connect_step1()
in Utilities/cmcurl/lib/vtls/openssl.c
493 132 3
cxx
void cmGlobalXCodeGenerator::CreateBuildSettings()
in Source/cmGlobalXCodeGenerator.cxx
534 131 3
static int32_t lookup_token()
in Utilities/cmnghttp2/lib/nghttp2_hd.c
361 130 2
471 117 0
cxx
void cmMakefileTargetGenerator::WriteObjectRuleFiles()
in Source/cmMakefileTargetGenerator.cxx
600 113 1
cxx
299 110 3
CURLproxycode Curl_SOCKS5()
in Utilities/cmcurl/lib/socks.c
435 109 7
CURLcode Curl_http_readwrite_headers()
in Utilities/cmcurl/lib/http.c
393 106 4
cxx
void cmVisualStudio10TargetGenerator::Generate()
in Source/cmVisualStudio10TargetGenerator.cxx
466 105 0