microsoft / sqltoolsservice
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 4,690 units with 69,334 lines of code in units (31.8% of code).
    • 27 very long units (5,384 lines of code)
    • 127 long units (8,402 lines of code)
    • 767 medium size units (23,626 lines of code)
    • 1,158 small units (17,006 lines of code)
    • 2,611 very small units (14,916 lines of code)
7% | 12% | 34% | 24% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs7% | 12% | 34% | 24% | 21%
cake0% | 20% | 45% | 16% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Microsoft.SqlTools.ServiceLayer9% | 13% | 34% | 23% | 18%
src/Microsoft.Kusto.ServiceLayer4% | 9% | 34% | 27% | 23%
src/Microsoft.SqlTools.Credentials31% | 0% | 9% | 29% | 30%
src/Microsoft.SqlTools.ManagedBatchParser1% | 16% | 33% | 23% | 24%
src/Microsoft.SqlTools.Hosting0% | 2% | 35% | 30% | 31%
scripts0% | 20% | 45% | 16% | 16%
src/Microsoft.SqlTools.ResourceProvider.Core0% | 0% | 22% | 23% | 54%
src/Microsoft.InsightsGenerator0% | 0% | 37% | 40% | 22%
src/Microsoft.SqlTools.ResourceProvider.DefaultImpl0% | 0% | 32% | 20% | 46%
src/Microsoft.SqlTools.ResourceProvider0% | 0% | 40% | 30% | 28%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
internal static extern OSStatus SecKeychainAddGenericPassword()
in src/Microsoft.SqlTools.Credentials/Credentials/OSX/Interop.Security.cs
386 1 8
public override void ParseProperties()
in src/Microsoft.SqlTools.ServiceLayer/ShowPlan/ShowPlanGraph/RelOpTypeParser.cs
375 84 3
internal static AdminServicesProviderOptions BuildAdminServicesProviderOptions()
in src/Microsoft.SqlTools.ServiceLayer/Admin/AdminServicesProviderOptionsHelper.cs
352 1 0
private RestoreOptionFactory()
in src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/RestoreOperation/RestoreOptionFactory.cs
340 3 0
private void AddToParameterCollection()
in src/Microsoft.SqlTools.ServiceLayer/AutoParameterizaition/ScalarExpressionTransformer.cs
311 59 4
public DatabaseData()
in src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype.cs
310 54 2
internal static ConnectionProviderOptions BuildConnectionProviderOptions()
in src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionProviderOptionsHelper.cs
305 1 0
internal static ConnectionProviderOptions BuildConnectionProviderOptions()
in src/Microsoft.Kusto.ServiceLayer/Connection/ConnectionProviderOptionsHelper.cs
285 1 0
static OperationTable()
in src/Microsoft.SqlTools.ServiceLayer/ShowPlan/ShowPlanGraph/OperationTable.cs
220 1 0
public bool ApplyChanges()
in src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepData.cs
203 67 2
public virtual Database ApplyChanges()
in src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype.cs
197 52 0
private void HandleUpdateItemRequest()
in src/Microsoft.SqlTools.ServiceLayer/TableDesigner/TableDesignerService.cs
192 43 1
public static SqlConnectionStringBuilder CreateConnectionStringBuilder()
in src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs
182 43 1
private void ProcessQueue()
in src/Microsoft.Kusto.ServiceLayer/LanguageServices/BindingQueue.cs
153 23 0
private void ProcessQueue()
in src/Microsoft.SqlTools.ServiceLayer/LanguageServices/BindingQueue.cs
153 23 0
public void ApplyChanges()
in src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobData.cs
147 50 1
public override void Execute()
in src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/BackupOperation/BackupOperation.cs
135 25 0
public DatabaseData()
in src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype.cs
127 15 1
public void ApplyChanges()
in src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/AgentOperatorData.cs
125 28 1
private void CreateOrAlterDataFile()
in src/Microsoft.SqlTools.ServiceLayer/Admin/Database/CreateDatabaseObjects.cs
117 29 1