microsoft / PowerToys
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 4,384 units with 63,410 lines of code in units (36.0% of code).
    • 5 very complex units (1,153 lines of code)
    • 11 complex units (1,010 lines of code)
    • 132 medium complex units (9,061 lines of code)
    • 339 simple units (12,941 lines of code)
    • 3,897 very simple units (39,245 lines of code)
1% | 1% | 14% | 20% | 61%
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
cpp3% | 3% | 18% | 22% | 52%
cs0% | <1% | 10% | 18% | 71%
h0% | 0% | 3% | 21% | 75%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/modules2% | 1% | 14% | 19% | 61%
src/settings-ui0% | <1% | 6% | 15% | 78%
src/runner0% | 0% | 34% | 28% | 36%
src/common0% | 0% | 9% | 23% | 67%
installer/PowerToysSetupCustomActions0% | 0% | 33% | 22% | 43%
tools/WebcamReportTool0% | 0% | 66% | 0% | 33%
src/ActionRunner0% | 0% | 100% | 0% | 0%
tools/BugReportTool0% | 0% | 0% | 71% | 28%
src/Update0% | 0% | 0% | 46% | 53%
tools/FancyZones_DrawLayoutTest0% | 0% | 0% | 23% | 76%
tools/FancyZone_HitTest0% | 0% | 0% | 60% | 39%
tools/FancyZones_zonable_tester0% | 0% | 0% | 20% | 79%
tools/CleanUp_tool0% | 0% | 0% | 28% | 71%
tools/project_template0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
intptr_t HandleShortcutRemapEvent()
in src/modules/keyboardmanager/KeyboardManagerEngineLibrary/KeyboardEventHandlers.cpp
403 95 4
std::pair ValidateShortcutBufferElement()
in src/modules/keyboardmanager/KeyboardManagerEditorLibrary/BufferValidationHelpers.cpp
187 65 8
std::string toMediaTypeString()
in src/modules/videoconference/VideoConferenceShared/Logging.cpp
127 62 1
void D2DOverlayWindow::render()
in src/modules/ShortcutGuide/ShortcutGuide/overlay_window.cpp
252 53 1
HRESULT GetTransformedFileName()
in src/modules/powerrename/lib/Helpers.cpp
184 51 5
DWORD WINAPI CPowerRenameManager::s_regexWorkerThread()
in src/modules/powerrename/lib/PowerRenameManager.cpp
180 50 1
void SetModifierKeyEvents()
in src/modules/keyboardmanager/common/Helpers.cpp
49 38 8
bool Shortcut::IsKeyboardStateClearExceptShortcut()
in src/modules/keyboardmanager/common/Shortcut.cpp
139 35 1
BOOL GetEnumeratedFileName()
in src/modules/powerrename/lib/Helpers.cpp
146 33 1
private bool FilterAccessibleKeyboardEvents()
in src/settings-ui/Settings.UI/Controls/ShortcutControl/ShortcutControl.xaml.cs
39 32 2
ShortcutErrorType DoShortcutsOverlap()
in src/modules/keyboardmanager/KeyboardManagerEditorLibrary/EditorHelpers.cpp
27 29 2
UINT MockedInput::SendVirtualInput()
in src/modules/keyboardmanager/KeyboardManagerEngineTest/MockedInput.cpp
85 28 3
LRESULT FancyZones::WndProc()
in src/modules/fancyzones/FancyZonesLib/FancyZones.cpp
124 27 4
bool IgnoreKeyCode()
in src/modules/keyboardmanager/common/Shortcut.cpp
25 27 1
bool Shortcut::SetKey()
in src/modules/keyboardmanager/common/Shortcut.cpp
108 26 1
bool Shortcut::CheckModifiersKeyboardState()
in src/modules/keyboardmanager/common/Shortcut.cpp
88 26 1
LRESULT Toolbar::WindowProcessMessages()
in src/modules/videoconference/VideoConferenceModule/Toolbar.cpp
129 25 4
void run_settings_window()
in src/runner/settings_window.cpp
129 24 2
void FancyZonesSettings::LoadSettings()
in src/modules/fancyzones/FancyZonesLib/Settings.cpp
84 23 2
public List Query()
in src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.WebSearch/Main.cs
108 23 1