microsoft / pmwcas
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 355 units with 4,199 lines of code in units (63.9% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (224 lines of code)
    • 10 medium complex units (651 lines of code)
    • 15 simple units (520 lines of code)
    • 328 very simple units (2,804 lines of code)
0% | 5% | 15% | 12% | 66%
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% | 8% | 21% | 14% | 55%
h0% | 0% | 6% | 8% | 84%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/benchmarks0% | 20% | 23% | 9% | 46%
src/environment0% | 5% | 0% | 7% | 86%
src/mwcas0% | 0% | 44% | 3% | 52%
src/util0% | 0% | 15% | 7% | 77%
src/double-linked-list0% | 0% | 0% | 55% | 44%
src/common0% | 0% | 0% | 29% | 70%
include0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void Main()
in src/benchmarks/doubly_linked_list_benchmark.cc
152 33 1
Status LinuxEnvironment::SetThreadAffinity()
in src/environment/environment_linux.cc
72 32 3
96 24 1
void DescriptorPool::Recovery()
in src/mwcas/mwcas.cc
115 19 1
71 18 2
53 15 1
41 15 0
void Setup()
in src/benchmarks/doubly_linked_list_benchmark.cc
68 14 1
std::string Status::ToString()
in src/util/status.cc
53 14 0
44 12 2
void Run()
in src/benchmarks/benchmark.h
58 11 4
void Run()
in src/benchmarks/benchmark_linux.h
52 11 4
void Teardown()
in src/benchmarks/mwcas_benchmark.cc
30 10 0
Status CASDList::Delete()
in src/double-linked-list/doubly_linked_list.cc
62 9 2
uint32_t WindowsEnvironment::GetCoreCount()
in src/environment/environment_windows.cc
48 9 0
uint64_t Descriptor::CondCAS()
in src/mwcas/mwcas.cc
32 9 2
void Main()
in src/benchmarks/mwcas_benchmark.cc
45 8 1
Status WindowsEnvironment::SetThreadAffinity()
in src/environment/environment_windows.cc
43 8 3
virtual Status Initialize()
in src/common/garbage_list.h
17 7 2
virtual Status Push()
in src/common/garbage_list.h
33 7 3