microsoft / Kusto-Query-Language
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,151 units with 48,556 lines of code in units (76.4% of code).
    • 6 very complex units (907 lines of code)
    • 25 complex units (4,501 lines of code)
    • 109 medium complex units (5,286 lines of code)
    • 275 simple units (6,939 lines of code)
    • 3,736 very simple units (30,923 lines of code)
1% | 9% | 10% | 14% | 63%
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% | 9% | 10% | 14% | 63%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Kusto.Language/Binder7% | 5% | 18% | 13% | 54%
Kusto.Language/Parser1% | 20% | 9% | 14% | 55%
Kusto.Language/Editor0% | 9% | 25% | 21% | 44%
Kusto.Language/Syntax0% | 2% | 1% | 14% | 80%
Kusto.Language/Symbols0% | 8% | 15% | 12% | 63%
Kusto.Language0% | 2% | 5% | 5% | 86%
Kusto.Language/Utils0% | 0% | 5% | 10% | 84%
Kusto.Language/Semantics0% | 0% | 33% | 12% | 54%
Kusto.Language/Diagnostics0% | 0% | 0% | 4% | 95%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public static ParameterMatchKind GetParameterMatchKind()
in src/Kusto.Language/Binder/Binder.cs
150 61 7
private void CreateProjectionColumns()
in src/Kusto.Language/Binder/Binder.cs
267 59 7
private static InfixPrecidence GetPrecedenceLevel()
in src/Kusto.Language/Parser/QueryParser.cs
72 58 1
private static SyntaxKind GetInfixOperationKind()
in src/Kusto.Language/Parser/QueryParser.cs
122 58 1
private static OperatorKind GetOperatorKind()
in src/Kusto.Language/Binder/Binder.cs
118 56 1
private void CheckArgument()
in src/Kusto.Language/Binder/Binder.cs
178 55 6
private void Initialize()
in src/Kusto.Language/Parser/QueryGrammar.cs
2433 50 0
private QueryOperator ParseQueryOperator()
in src/Kusto.Language/Parser/QueryParser.cs
97 48 0
private SignatureResult GetSignatureResult()
in src/Kusto.Language/Binder/Binder.cs
102 47 5
private static TimeSpan GetTimeSpanValue()
in src/Kusto.Language/Syntax/SyntaxToken.cs
77 42 1
private static bool ParameterMatches()
in src/Kusto.Language/Editor/Kusto/KustoCompleter.cs
56 41 2
private bool GetMatchingSymbols()
in src/Kusto.Language/Binder/Binder.cs
109 40 4
private void AddTokenRules()
in src/Kusto.Language/Editor/Kusto/KustoFormatter.cs
77 37 1
private GlobalState With()
in src/Kusto.Language/GlobalState.cs
72 37 1
private static SyntaxKind GetStringOperationKind()
in src/Kusto.Language/Parser/QueryParser.cs
78 36 1
public static bool Matches()
in src/Kusto.Language/Symbols/SymbolMatch.cs
41 36 4
public bool ShouldAutoComplete()
in src/Kusto.Language/Editor/Kusto/KustoCompleter.cs
68 35 2
private static TokenInfo GetPunctuationTokenInfo()
in src/Kusto.Language/Parser/TokenParser.cs
82 34 2
private bool IsQueryOperatorParameterKind()
in src/Kusto.Language/Binder/Binder.cs
55 33 2
private void GetSymbolsInContext()
in src/Kusto.Language/Binder/Binder.cs
107 32 4