microsoft / terminal
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 12,537 units with 149,376 lines of code in units (46.5% of code).
    • 9 very complex units (2,146 lines of code)
    • 44 complex units (5,516 lines of code)
    • 272 medium complex units (17,831 lines of code)
    • 570 simple units (20,705 lines of code)
    • 11,642 very simple units (103,178 lines of code)
1% | 3% | 11% | 13% | 69%
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
cpp1% | 3% | 13% | 15% | 65%
cs9% | 1% | 12% | 12% | 63%
hpp0% | 2% | 6% | 10% | 79%
h0% | 4% | 6% | 9% | 79%
ipp0% | 0% | 0% | 78% | 21%
cc0% | 0% | 0% | 0% | 100%
py0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/terminal5% | 7% | 14% | 16% | 56%
src/interactivity15% | <1% | 12% | 19% | 51%
src/tools7% | 10% | 19% | 14% | 47%
src/host<1% | 2% | 11% | 10% | 74%
build/Helix44% | 0% | 0% | 27% | 27%
src/cascadia<1% | <1% | 11% | 14% | 72%
src/propsheet0% | 38% | 16% | 21% | 24%
dep/CLI110% | 12% | 20% | 20% | 46%
oss/fmt0% | 7% | 13% | 9% | 69%
dep/jsoncpp0% | 5% | 29% | 23% | 41%
src/types0% | 3% | 18% | 16% | 61%
src/buffer0% | 4% | 13% | 10% | 70%
src/inc0% | 4% | 4% | 9% | 81%
oss/boost0% | <1% | 3% | 9% | 86%
src/renderer0% | 0% | 12% | 13% | 74%
src/server0% | 0% | 50% | 15% | 33%
src/tsf0% | 0% | 48% | 10% | 40%
src/til0% | 0% | 7% | 11% | 80%
src/winconpty0% | 0% | 0% | 30% | 69%
oss/libpopcnt0% | 0% | 0% | 31% | 68%
src/propslib0% | 0% | 0% | 27% | 72%
oss/dynamic_bitset0% | 0% | 0% | 19% | 80%
oss/chromium0% | 0% | 0% | 11% | 88%
oss/interval_tree0% | 0% | 0% | 27% | 72%
scratch/ScratchIslandApp0% | 0% | 0% | 0% | 100%
oss/pcg0% | 0% | 0% | 0% | 100%
src/api-ms-win-core-synch-l1-2-00% | 0% | 0% | 0% | 100%
tools0% | 0% | 0% | 0% | 100%
src/internal0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
static void Main()
in src/tools/vtapp/Program.cs
368 85 1
void HandleKeyEvent()
in src/interactivity/win32/windowio.cpp
251 84 5
BOOL HandleMouseEvent()
in src/interactivity/win32/windowio.cpp
296 70 4
public static TestPass ParseTestWttFile()
in build/Helix/HelixTestHelpers.cs
198 59 3
bool AdaptDispatch::SetGraphicsRendition()
in src/terminal/adapter/adaptDispatchGraphics.cpp
187 59 1
bool TerminalDispatch::SetGraphicsRendition()
in src/cascadia/TerminalCore/TerminalDispatchGraphics.cpp
183 58 1
void InputTest::TerminalInputModifierKeyTests()
in src/terminal/adapter/ut_adapter/inputTest.cpp
187 54 0
bool OutputStateMachineEngine::ActionCsiDispatch()
in src/terminal/parser/OutputStateMachineEngine.cpp
196 53 2
bool COOKED_READ_DATA::ProcessInput()
in src/host/readDataCooked.cpp
280 51 3
BOOL UpdateStateInfo()
in src/propsheet/console.cpp
153 50 3
int FindCreateFont()
in src/propsheet/fontdlg.cpp
191 49 2
void _process_requirements()
in dep/CLI11/CLI11.hpp
129 48 0
int FontListCreate()
in src/propsheet/fontdlg.cpp
145 47 2
bool _parse_arg()
in dep/CLI11/CLI11.hpp
133 45 2
211 44 1
OutputIt basic_printf_context::format()
in oss/fmt/include/fmt/printf.h
108 39 0
OutputIt write_float()
in oss/fmt/include/fmt/format.h
86 38 5
INT_PTR WINAPI ColorDlgProc()
in src/propsheet/ColorsPage.cpp
188 38 4
DWORD GetRegistryValues()
in src/propsheet/registry.cpp
352 38 1
static int doParent()
in src/tools/closetest/closetest.cpp
166 37 1