microsoft / calculator
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,951 units with 25,687 lines of code in units (43.2% of code).
    • 2 very complex units (719 lines of code)
    • 11 complex units (1,225 lines of code)
    • 46 medium complex units (3,324 lines of code)
    • 92 simple units (2,991 lines of code)
    • 1,800 very simple units (17,428 lines of code)
2% | 4% | 12% | 11% | 67%
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
cpp5% | 8% | 18% | 14% | 53%
cs0% | <1% | 7% | 8% | 82%
h0% | 0% | 0% | 7% | 92%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/CalcManager10% | 10% | 12% | 11% | 54%
src/CalcViewModel0% | 6% | 20% | 14% | 59%
src/Calculator0% | 1% | 8% | 12% | 77%
src/GraphControl0% | 0% | 16% | 15% | 68%
src/CalculatorUITestFramework0% | 0% | 11% | 0% | 88%
src/CalculatorUITests0% | 0% | 0% | 2% | 97%
src/GraphingInterfaces0% | 0% | 0% | 0% | 100%
src/GraphingImpl0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void CCalcEngine::ProcessCommandWorker()
in src/CalcManager/CEngine/scicomm.cpp
509 162 1
CalcEngine::Rational CCalcEngine::SciCalcFunctions()
in src/CalcManager/CEngine/scifunc.cpp
210 77 2
ButtonInfo StandardCalculatorViewModel::MapCharacterToButtonId()
in src/CalcViewModel/StandardCalculatorViewModel.cpp
106 40 1
wstring NumberToString()
in src/CalcManager/Ratpack/conv.cpp
145 38 4
CalcEngine::Rational CCalcEngine::DoOperation()
in src/CalcManager/CEngine/scioper.cpp
132 34 3
void CHistoryCollector::AddUnaryOpToHistory()
in src/CalcManager/CEngine/History.cpp
105 33 3
void StandardCalculatorViewModel::OnButtonPressed()
in src/CalcViewModel/StandardCalculatorViewModel.cpp
68 33 1
void StandardCalculatorViewModel::OnPaste()
in src/CalcViewModel/StandardCalculatorViewModel.cpp
117 33 1
public static string GetColorAutomationName()
in src/Calculator/Views/GraphingCalculator/EquationStylePanelControl.xaml.cs
97 32 1
PNUMBER StringToNumber()
in src/CalcManager/Ratpack/conv.cpp
117 31 3
void UnitConverter::SendCommand()
in src/CalcManager/UnitConverter.cpp
120 31 1
void StandardCalculatorViewModel::HandleUpdatedOperandData()
in src/CalcViewModel/StandardCalculatorViewModel.cpp
129 27 1
void CalculatorManager::SendCommand()
in src/CalcManager/CalculatorManager.cpp
89 26 1
private void OnAppLaunch()
in src/Calculator/App.xaml.cs
148 24 2
bool CalcInput::TryAddDigit()
in src/CalcManager/CEngine/CalcInput.cpp
78 23 6
public void UpdateScrollButtons()
in src/Calculator/Controls/OverflowTextBlock.cs
48 23 0
private static void OnKeyDownHandler()
in src/Calculator/Common/KeyboardShortcuManager.cs
57 22 2
void StandardCalculatorViewModel::SaveEditedCommand()
in src/CalcViewModel/StandardCalculatorViewModel.cpp
90 21 2
void UnitConverterViewModel::OnPropertyChanged()
in src/CalcViewModel/UnitConverterViewModel.cpp
66 19 1
void powratcomp()
in src/CalcManager/Ratpack/exp.cpp
105 18 4