firebase / leveldb
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 729 units with 7,984 lines of code in units (55.9% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (328 lines of code)
    • 21 medium complex units (1,279 lines of code)
    • 54 simple units (1,875 lines of code)
    • 651 very simple units (4,502 lines of code)
0% | 4% | 16% | 23% | 56%
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
cc0% | 4% | 17% | 24% | 53%
h0% | 0% | 0% | 9% | 90%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
db0% | 6% | 20% | 22% | 49%
doc/bench0% | 0% | 38% | 30% | 31%
table0% | 0% | 0% | 33% | 66%
util0% | 0% | 0% | 20% | 79%
helpers/memenv0% | 0% | 0% | 15% | 84%
port0% | 0% | 0% | 0% | 100%
include/leveldb0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void Run()
in db/db_bench.cc
109 34 0
130 32 1
89 28 1
Status VersionSet::Recover()
in db/version_set.cc
98 22 0
int main()
in doc/bench/db_bench_sqlite3.cc
47 21 2
int main()
in db/db_bench.cc
50 20 2
bool Reader::ReadRecord()
in db/log_reader.cc
85 19 2
Status Version::Get()
in db/version_set.cc
81 18 4
int main()
in doc/bench/db_bench_tree_db.cc
42 18 2
void Run()
in doc/bench/db_bench_sqlite3.cc
70 18 0
Status DBImpl::Recover()
in db/db_impl.cc
65 17 1
75 17 3
73 17 0
Status DBImpl::Write()
in db/db_impl.cc
56 16 2
void Run()
in doc/bench/db_bench_tree_db.cc
65 16 0
45 14 0
59 13 1
38 13 4
bool ParseFileName()
in db/filename.cc
43 13 3
36 12 4