microsoft / snmalloc
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 372 units with 4,002 lines of code in units (45.6% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (219 lines of code)
    • 11 simple units (481 lines of code)
    • 359 very simple units (3,302 lines of code)
0% | 0% | 5% | 12% | 82%
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
h0% | 0% | 5% | 12% | 82%
cc0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/ds0% | 0% | 21% | 7% | 71%
src/backend0% | 0% | 16% | 0% | 83%
src/mem0% | 0% | 0% | 14% | 85%
src/pal0% | 0% | 0% | 23% | 76%
src/aal0% | 0% | 0% | 0% | 100%
src/override0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void on_clear()
in src/ds/dllist.h
159 13 1
static capptr::Chunk reserve()
in src/backend/backend.h
60 11 3
33 10 1
SNMALLOC_FAST_PATH void dealloc()
in src/mem/localalloc.h
49 9 1
bool post()
in src/mem/remotecache.h
56 8 3
static void notify_using()
in src/pal/pal_apple.h
30 8 2
static uint64_t get_entropy64()
in src/pal/pal_linux.h
47 8 0
57 7 1
static uint64_t dev_urandom()
in src/pal/pal_posix.h
41 7 0
20 6 1
void print()
in src/mem/allocstats.h
69 6 3
SNMALLOC_SLOW_PATH decltype()
in src/mem/localalloc.h
30 6 1
constexpr SizeClassTable()
in src/mem/sizeclasstable.h
49 6 0
if constexpr()
in src/backend/pagemap.h
17 5 1
Cmp read()
in src/ds/aba.h
11 5 0
19 5 0
bool is_empty()
in src/mem/allocstats.h
18 5 0
static void register_local_state()
in src/mem/chunkallocator.h
35 5 2
46 5 1
void handle_dealloc_remote()
in src/mem/corealloc.h
23 5 3