microsoft / cppwinrt
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 1,271 units with 13,814 lines of code in units (53.4% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (550 lines of code)
    • 34 medium complex units (2,441 lines of code)
    • 52 simple units (1,847 lines of code)
    • 1,182 very simple units (8,976 lines of code)
0% | 3% | 17% | 13% | 64%
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% | 3% | 18% | 11% | 66%
cpp0% | 6% | 13% | 24% | 56%
cs0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
strings0% | 5% | 2% | 6% | 84%
cppwinrt0% | 3% | 33% | 17% | 45%
natvis0% | 0% | 12% | 22% | 64%
vsix/ProjectTemplates0% | 0% | 0% | 33% | 66%
vsix/ItemTemplates0% | 0% | 0% | 0% | 100%
vsix/Dev160% | 0% | 0% | 0% | 100%
vsix/Dev170% | 0% | 0% | 0% | 100%
scratch0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
struct __declspec()
in strings/base_implements.h
360 47 1
void write()
in cppwinrt/type_writers.h
80 33 1
static int run()
in cppwinrt/main.cpp
110 29 2
void GetInterfaceData()
in natvis/object_visualizer.cpp
116 24 4
static void write_component_g_cpp()
in cppwinrt/component_writers.h
156 23 2
static void write_consume_extensions()
in cppwinrt/code_writers.h
172 21 2
99 21 4
static void write_abi_args()
in cppwinrt/code_writers.h
82 20 2
static bool write_structs()
in cppwinrt/code_writers.h
100 20 2
64 20 2
82 20 2
static void parse_command_line()
in cppwinrt/cmd_reader.h
66 19 3
void write()
in cppwinrt/type_writers.h
57 19 1
auto files()
in cppwinrt/cmd_reader.h
78 18 2
static void write_delegate_definition()
in cppwinrt/code_writers.h
124 16 2
static auto get_interfaces()
in cppwinrt/helpers.h
55 16 2
static std::string get_signature()
in natvis/type_resolver.cpp
28 16 1
static void write_class_usings()
in cppwinrt/code_writers.h
47 15 2
static void write_component_interfaces()
in cppwinrt/component_writers.h
35 15 2
56 15 7