microsoft / python-language-server
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 15,512 units with 46,994 lines of code in units (61.9% of code).
    • 6 very complex units (844 lines of code)
    • 17 complex units (1,282 lines of code)
    • 150 medium complex units (6,462 lines of code)
    • 288 simple units (6,507 lines of code)
    • 15,051 very simple units (31,899 lines of code)
1% | 2% | 13% | 13% | 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
cs2% | 4% | 20% | 20% | 51%
py0% | 0% | 29% | 20% | 50%
pyi0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/Parsing/Impl/Tokens25% | 10% | 24% | 10% | 29%
src/Parsing/Impl3% | 4% | 38% | 23% | 28%
src/Analysis/Ast/Impl<1% | 1% | 6% | 8% | 82%
src/LanguageServer/Impl/Completion0% | 18% | 35% | 25% | 20%
src/LanguageServer/Impl/Formatting0% | 60% | 21% | 6% | 11%
src/Parsing/Impl/Ast0% | <1% | 12% | 15% | 70%
src/LanguageServer/Impl/Sources0% | 0% | 47% | 29% | 22%
src/Analysis/Core/Impl0% | 0% | 13% | 20% | 65%
src/Core/Impl/IO0% | 0% | 31% | 29% | 39%
src/Caching/Impl/Models0% | 0% | 37% | 20% | 42%
src/LanguageServer/Impl/CodeActions0% | 0% | 23% | 30% | 46%
src/Core/Impl/Extensions0% | 0% | 12% | 30% | 56%
src/Caching/Impl0% | 0% | 15% | 32% | 51%
src/LanguageServer/Impl0% | 0% | 7% | 17% | 74%
src/LanguageServer/Impl/Telemetry0% | 0% | 26% | 18% | 54%
src/LanguageServer/Impl/Implementation0% | 0% | 2% | 21% | 76%
src0% | 0% | 0% | 89% | 10%
src/LanguageServer/Impl/Indexing0% | 0% | 0% | 17% | 82%
src/Caching/Impl/Lazy0% | 0% | 0% | 33% | 66%
src/Core/Impl/Text0% | 0% | 0% | 30% | 69%
src/Core/Impl/Threading0% | 0% | 0% | 14% | 85%
src/Core/Impl/Idle0% | 0% | 0% | 24% | 75%
src/LanguageServer/Impl/Services0% | 0% | 0% | 12% | 87%
src/LanguageServer/Impl/Protocol0% | 0% | 0% | 53% | 46%
src/Core/Impl/Collections0% | 0% | 0% | 0% | 100%
src/LanguageServer/Impl/Diagnostics0% | 0% | 0% | 0% | 100%
src/Core/Impl/Disposables0% | 0% | 0% | 0% | 100%
src/LanguageServer/Impl/Utilities0% | 0% | 0% | 0% | 100%
src/Core/Impl/Services0% | 0% | 0% | 0% | 100%
src/Core/Impl/Diagnostics0% | 0% | 0% | 0% | 100%
src/Caching/Impl/IO0% | 0% | 0% | 0% | 100%
src/Core/Impl/OS0% | 0% | 0% | 0% | 100%
src/Caching/Impl/Extensions0% | 0% | 0% | 0% | 100%
src/LanguageServer/Impl/Optimization0% | 0% | 0% | 0% | 100%
src/LanguageServer/Impl/SearchPaths0% | 0% | 0% | 0% | 100%
src/LanguageServer/Impl/Documents0% | 0% | 0% | 0% | 100%
src/LanguageServer/Impl/Definitions0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private Token ReadName()
in src/Parsing/Impl/Tokens/Tokenizer.cs
229 195 0
public static string ParseString()
in src/Parsing/Impl/LiteralParser.cs
111 57 7
private Token NextOperator()
in src/Parsing/Impl/Tokens/Tokenizer.cs
144 57 1
private static Dictionary MakeCodecsDict()
in src/Parsing/Impl/Parser.cs
100 56 0
private Token Next()
in src/Parsing/Impl/Tokens/Tokenizer.cs
156 56 0
private IMember GetValueFromBinaryOp()
in src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Operators.cs
104 52 2
private bool TryGetValueFromBuiltinBinaryOp()
in src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.Operators.cs
93 47 5
public static bool IsVirtualId()
in src/Analysis/Ast/Impl/Extensions/BuiltinTypeIdExtensions.cs
57 46 1
private Expression FinishDictOrSetValue()
in src/Parsing/Impl/Parser.cs
150 46 0
private static void AppendTokenEnsureWhiteSpacesAround()
in src/LanguageServer/Impl/Formatting/LineFormatter.cs
122 41 2
public ArgumentSet()
in src/Analysis/Ast/Impl/Types/ArgumentSet.cs
134 40 5
internal static List ParseBytes()
in src/Parsing/Impl/LiteralParser.cs
69 39 5
private Token ReadNumber()
in src/Parsing/Impl/Tokens/Tokenizer.cs
74 37 1
public static BuiltinTypeId GetTypeId()
in src/Analysis/Ast/Impl/Extensions/BuiltinTypeIdExtensions.cs
39 35 1
internal static PythonMemberType GetMemberId()
in src/Analysis/Ast/Impl/Extensions/BuiltinTypeIdExtensions.cs
45 35 1
public delegate IMember ReturnValueProvider()
in src/Analysis/Ast/Impl/Types/PythonFunctionOverload.cs
136 31 4
public TokenInfo ReadToken()
in src/Parsing/Impl/Tokens/Tokenizer.cs
88 31 0
private Token ReadHexNumber()
in src/Parsing/Impl/Tokens/Tokenizer.cs
52 30 0
public static string ToCodeString()
in src/Parsing/Impl/Ast/PythonOperator.cs
33 29 1
private static CompletionListOptions GetOptions()
in src/LanguageServer/Impl/Completion/TopLevelCompletion.cs
42 28 3