apple / foundationdb
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 19,041 units with 285,357 lines of code in units (69.8% of code).
    • 88 very complex units (32,621 lines of code)
    • 234 complex units (30,399 lines of code)
    • 952 medium complex units (58,719 lines of code)
    • 1,582 simple units (49,677 lines of code)
    • 16,185 very simple units (113,941 lines of code)
11% | 10% | 20% | 17% | 39%
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
cpp11% | 11% | 23% | 18% | 35%
c21% | 15% | 21% | 16% | 24%
h3% | 5% | 13% | 14% | 63%
go13% | 3% | 13% | 17% | 52%
py2% | 6% | 14% | 16% | 59%
cs0% | 7% | 22% | 19% | 50%
java0% | 2% | 5% | 16% | 76%
rb0% | 0% | 9% | 15% | 75%
hpp0% | 0% | 19% | 32% | 47%
inc0% | 0% | 10% | 67% | 22%
js0% | 0% | 0% | 21% | 78%
cc0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
fdbserver14% | 13% | 24% | 17% | 29%
fdbclient7% | 7% | 19% | 17% | 48%
fdbcli34% | 15% | 17% | 11% | 21%
fdbrpc10% | 8% | 15% | 19% | 46%
fdbbackup29% | 0% | 24% | 15% | 30%
bindings3% | 2% | 9% | 16% | 67%
flow1% | 7% | 12% | 16% | 61%
fdbmonitor19% | 12% | 17% | 15% | 34%
FDBLibTLS16% | 5% | 23% | 20% | 33%
contrib2% | 5% | 16% | 17% | 58%
packaging0% | 49% | 4% | 15% | 30%
layers0% | 0% | 14% | 18% | 67%
fdbservice0% | 0% | 32% | 17% | 50%
fdbkubernetesmonitor0% | 0% | 31% | 36% | 31%
recipes0% | 0% | 5% | 7% | 86%
flowbench0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
SQLITE_PRIVATE int sqlite3VdbeExec()
in fdbserver/sqlite/sqlite3.amalgamation.c
3712 721 1
static void yy_reduce()
in fdbserver/sqlite/sqlite3.amalgamation.c
1129 468 2
void ServerKnobs::initialize()
in fdbclient/ServerKnobs.cpp
627 457 3
static int do_meta_command()
in fdbserver/sqlite/shell.c
825 273 2
int main()
in fdbbackup/backup.actor.cpp
1094 255 2
void printStatus()
in fdbcli/StatusCommand.actor.cpp
803 230 4
SQLITE_PRIVATE void sqlite3Pragma()
in fdbserver/sqlite/sqlite3.amalgamation.c
879 197 5
ACTOR Future cli()
in fdbcli/fdbcli.actor.cpp
679 171 2
void parseArgsInternal()
in fdbserver/fdbserver.actor.cpp
602 171 2
SQLITE_PRIVATE int sqlite3ExprCodeTarget()
in fdbserver/sqlite/sqlite3.amalgamation.c
497 151 3
SQLITE_PRIVATE void sqlite3VXPrintf()
in fdbserver/sqlite/sqlite3.amalgamation.c
454 144 4
265 128 1
static int keywordCode()
in fdbserver/sqlite/sqlite3.amalgamation.c
241 126 2
SQLITE_PRIVATE int sqlite3GetToken()
in fdbserver/sqlite/sqlite3.amalgamation.c
260 126 2
int main()
in fdbserver/fdbserver.actor.cpp
480 112 2
ACTOR Future checkDataConsistency()
in fdbserver/workloads/ConsistencyCheck.actor.cpp
421 112 5
static void porter_stemmer()
in fdbserver/sqlite/sqlite3.amalgamation.c
189 110 4
static Bitmask codeOneLoopStart()
in fdbserver/sqlite/sqlite3.amalgamation.c
438 107 4
func()
in bindings/go/src/_stacktester/stacktester.go
434 104 1
ACTOR Future update()
in fdbserver/storageserver.actor.cpp
330 101 2