microsoft / sqltoolsservice
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,690 units with 69,334 lines of code in units (31.8% of code).
    • 8 very complex units (1,649 lines of code)
    • 11 complex units (1,295 lines of code)
    • 119 medium complex units (6,965 lines of code)
    • 350 simple units (11,804 lines of code)
    • 4,202 very simple units (47,621 lines of code)
2% | 1% | 10% | 17% | 68%
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% | 1% | 10% | 16% | 68%
cake0% | 0% | 0% | 33% | 66%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/Microsoft.SqlTools.ServiceLayer3% | 2% | 10% | 17% | 66%
src/Microsoft.Kusto.ServiceLayer<1% | 0% | 7% | 17% | 74%
src/Microsoft.SqlTools.ManagedBatchParser0% | 3% | 15% | 19% | 62%
src/Microsoft.SqlTools.Hosting0% | 0% | 11% | 11% | 77%
src/Microsoft.SqlTools.ResourceProvider.Core0% | 0% | 0% | 16% | 83%
src/Microsoft.InsightsGenerator0% | 0% | 0% | 25% | 74%
scripts0% | 0% | 0% | 33% | 66%
src/Microsoft.SqlTools.ResourceProvider.DefaultImpl0% | 0% | 0% | 5% | 94%
src/Microsoft.SqlTools.Credentials0% | 0% | 0% | 0% | 100%
src/Microsoft.SqlTools.ResourceProvider0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public override void ParseProperties()
in src/Microsoft.SqlTools.ServiceLayer/ShowPlan/ShowPlanGraph/RelOpTypeParser.cs
375 84 3
public bool ApplyChanges()
in src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepData.cs
203 67 2
public bool HasSameValueAs()
in src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype.cs
69 64 1
private void AddToParameterCollection()
in src/Microsoft.SqlTools.ServiceLayer/AutoParameterizaition/ScalarExpressionTransformer.cs
311 59 4
protected virtual void SaveProperties()
in src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype.cs
114 57 1
public DatabaseData()
in src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype.cs
310 54 2
private ScalarSymbol GetKustoType()
in src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoIntellisenseClient.cs
70 52 1
public virtual Database ApplyChanges()
in src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype.cs
197 52 0
public void ApplyChanges()
in src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobData.cs
147 50 1
public static SqlConnectionStringBuilder CreateConnectionStringBuilder()
in src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs
182 43 1
private void HandleUpdateItemRequest()
in src/Microsoft.SqlTools.ServiceLayer/TableDesigner/TableDesignerService.cs
192 43 1
private bool RuleText()
in src/Microsoft.SqlTools.ManagedBatchParser/BatchParser/Lexer.cs
108 35 0
public bool UpdateSourceSchedule()
in src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/ScheduleData.cs
88 33 0
public bool IsLogicallyEquivalentTo()
in src/Microsoft.SqlTools.ServiceLayer/ShowPlan/ShowPlanGraph/Node.cs
74 32 2
private void CreateOrAlterDataFile()
in src/Microsoft.SqlTools.ServiceLayer/Admin/Database/CreateDatabaseObjects.cs
117 29 1
public void ApplyChanges()
in src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/AgentOperatorData.cs
125 28 1
private void ParseLines()
in src/Microsoft.SqlTools.ManagedBatchParser/BatchParser/Parser.cs
70 26 0
private void CreateOrAlterLogFile()
in src/Microsoft.SqlTools.ServiceLayer/Admin/Database/CreateDatabaseObjects.cs
111 26 1
protected override Operation GetNodeOperation()
in src/Microsoft.SqlTools.ServiceLayer/ShowPlan/ShowPlanGraph/RelOpTypeParser.cs
81 26 1
private bool ShouldParamterize()
in src/Microsoft.SqlTools.ServiceLayer/AutoParameterizaition/TsqlMultiVisitor.cs
33 25 1