microsoft / PTVS
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 7,988 units with 89,401 lines of code in units (59.2% of code).
    • 6 very complex units (1,156 lines of code)
    • 27 complex units (2,208 lines of code)
    • 278 medium complex units (14,286 lines of code)
    • 712 simple units (19,005 lines of code)
    • 6,965 very simple units (52,746 lines of code)
1% | 2% | 15% | 21% | 58%
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
cs1% | 2% | 15% | 21% | 60%
cpp20% | 5% | 29% | 17% | 26%
js0% | 26% | 29% | 19% | 24%
py0% | 3% | 16% | 23% | 57%
h0% | 0% | 26% | 3% | 69%
c0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Python/Product1% | 2% | 15% | 20% | 60%
Common/Product2% | 1% | 16% | 23% | 56%
Python/Templates0% | 22% | 24% | 16% | 36%
Common/Tools0% | 30% | 51% | 9% | 8%
Python/Setup0% | 0% | 66% | 0% | 33%
Build/17.00% | 0% | 21% | 49% | 29%
Build/16.00% | 0% | 0% | 56% | 43%
Build0% | 0% | 0% | 0% | 100%
Python/Prerequisites0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
bool DoAttach()
in Python/Product/PyDebugAttach/PyDebugAttach.cpp
328 101 3
public SnapshotSpan? GetExpressionRange()
in Python/Product/PythonTools/PythonTools/Intellisense/ReverseExpressionParser.cs
187 83 6
public int Exec()
in Python/Product/PythonTools/PythonTools/Intellisense/IntellisenseController.cs
131 70 5
internal int AddItemWithSpecificInternal()
in Common/Product/SharedProject/ProjectNode.cs
248 68 12
public virtual object GetProperty()
in Common/Product/SharedProject/HierarchyNode.cs
168 56 1
private static ConsoleColor? GetColorFromEscape()
in Python/Product/PythonTools/PythonTools/Repl/PythonCommonInteractiveEvaluator.cs
94 56 2
private Addition CanAddFileFromProjectReference()
in Common/Product/SharedProject/ProjectNode.CopyPaste.cs
165 38 3
private static int CalculateIndentation()
in Python/Product/PythonTools/PythonTools/Editor/Indent/AutoIndent.cs
106 38 4
internal override int QueryStatusOnNode()
in Python/Product/PythonTools/PythonTools/Project/InterpretersNode.cs
75 37 4
bool VsPyProf::GetUserToken()
in Python/Product/VsPyProf/PythonApi.cpp
91 35 3
private bool ParseInput()
in Common/Tools/BuildTasks/ExtractLambdasFromXaml.cs
92 34 0
def handle_line()
in Python/Product/PythonTools/ptvsd/debugger.py
64 34 3
private void ParseOptions()
in Python/Product/Debugger/Debugger/DebugEngine/AD7Engine.cs
69 33 1
public override int GetProperty()
in Python/Product/Profiling/Profiling/SessionNode.cs
84 33 3
protected List diff_bisect()
in Python/Product/PythonTools/PythonTools/Editor/Formatting/DiffMatchPatch.cs
92 32 3
internal static UnicodeCategory GetUnicodeCategory()
in Python/Product/PythonTools/PythonTools/Repl/Completion/Utilities.cs
65 31 1
private VisualStudioInterpreterConfiguration TryReadConfiguration()
in Python/Product/VSInterpreters/Interpreter/PythonRegistrySearch.cs
89 31 6
public int CompareTo()
in Python/Product/VSInterpreters/PackageManager/PackageVersion.cs
97 31 1
private InterpreterConfiguration TryReadConfiguration()
in Python/Product/Cookiecutter/Shared/Interpreters/PythonRegistrySearch.cs
92 30 6
public override void DoAddition()
in Common/Product/SharedProject/ProjectNode.CopyPaste.cs
99 29 1