microsoft / vs-editor-api
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 3,878 units with 46,073 lines of code in units (58.7% of code).
    • 2 very complex units (455 lines of code)
    • 8 complex units (1,172 lines of code)
    • 93 medium complex units (5,823 lines of code)
    • 301 simple units (9,109 lines of code)
    • 3,474 very simple units (29,514 lines of code)
<1% | 2% | 12% | 19% | 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
cs<1% | 2% | 12% | 19% | 64%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/Editor/FPF/PresentationCore47% | 0% | 0% | 3% | 49%
src/Editor/Text/Def1% | 0% | 12% | 18% | 66%
src/Editor/Text/Impl0% | 2% | 15% | 22% | 59%
src/Editor/Language/Impl0% | 8% | 12% | 18% | 60%
src/Editor/Text/Util0% | 4% | 4% | 23% | 67%
src/Editor/Core/Def0% | 0% | 12% | 8% | 79%
src/Editor/Core/Impl0% | 0% | 18% | 39% | 42%
src/Editor/Language/Def0% | 0% | 7% | 0% | 92%
src/Editor/FPF/WindowsBase0% | 0% | 0% | 7% | 92%
src/Editor/Language/Util0% | 0% | 0% | 0% | 100%
src/Editor/FPF/PresentationFramework0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
internal static KnownColor ColorStringToKnownColor()
in src/Editor/FPF/PresentationCore/System.Windows.Media.Colors.cs
374 244 1
public static UnicodeScript UScript()
in src/Editor/Text/Def/Internal/TextData/UnicodeWordExtent.cs
81 63 1
private static void AddE2EData()
in src/Editor/Language/Impl/Language/AsyncCompletion/CompletionTelemetry.cs
108 46 2
private async Task UpdateSnapshot()
in src/Editor/Language/Impl/Language/AsyncCompletion/AsyncCompletionSession.cs
171 40 6
private bool InsertText()
in src/Editor/Text/Impl/EditorOperations/EditorOperations.cs
180 37 4
public ElisionMapNode IncorporateChange()
in src/Editor/Text/Impl/TextModel/Projection/ElisionMapNode.cs
183 33 13
public void PerformAction()
in src/Editor/Text/Impl/XPlat/MultiCaretImpl/SelectionTransformer.cs
94 29 1
public ProjectionLineInfo GetLineFromPosition()
in src/Editor/Text/Impl/TextModel/Projection/ElisionMapNode.cs
183 27 7
internal void DecomposeSpans()
in src/Editor/Text/Util/TextDataUtil/ProjectionSpanDiffer.cs
142 27 0
private void ComputeSourceEdits()
in src/Editor/Text/Impl/TextModel/Projection/ProjectionBuffer.cs
111 26 1
public static bool IsPropBreak()
in src/Editor/Text/Def/Internal/TextData/UnicodeWordExtent.cs
38 25 3
private StringRebuilder InsertionLiesInSpan()
in src/Editor/Text/Impl/TextModel/Projection/ProjectionBuffer.cs
91 24 11
private static IReadOnlyList Normalize()
in src/Editor/Text/Impl/TextModel/NormalizedTextChangeCollection.cs
128 23 5
static public bool FindCurrentToken()
in src/Editor/Text/Def/Internal/TextData/UnicodeWordExtent.cs
67 22 2
private void InterpretSourceBufferChange()
in src/Editor/Text/Impl/TextModel/Projection/ProjectionBuffer.cs
85 22 7
private void BuildContentTypes()
in src/Editor/Core/Impl/ContentType/ContentTypeRegistryServiceImpl.cs
76 21 0
public bool MoveSelectedLinesUp()
in src/Editor/Text/Impl/EditorOperations/EditorOperations.cs
145 21 0
public string NextLineToken()
in src/Editor/Text/Impl/DifferenceAlgorithm/TFS/DiffFinder.cs
62 20 1
public bool MoveSelectedLinesDown()
in src/Editor/Text/Impl/EditorOperations/EditorOperations.cs
154 20 0
private static bool DeleteHorizontalWhitespace()
in src/Editor/Text/Impl/EditorOperations/EditorOperations.cs
49 20 4