microsoft / vstest
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 2,611 units with 36,017 lines of code in units (35.4% of code).
    • 7 very long units (1,227 lines of code)
    • 85 long units (5,728 lines of code)
    • 395 medium size units (11,855 lines of code)
    • 616 small units (8,960 lines of code)
    • 1,508 very small units (8,247 lines of code)
3% | 15% | 32% | 24% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs3% | 15% | 32% | 24% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Microsoft.TestPlatform.CrossPlatEngine6% | 10% | 32% | 29% | 20%
src/Microsoft.TestPlatform.ObjectModel6% | 18% | 27% | 20% | 28%
src/vstest.console4% | 21% | 28% | 26% | 19%
src/Microsoft.TestPlatform.Build49% | 0% | 21% | 19% | 10%
src/Microsoft.TestPlatform.Client8% | 14% | 42% | 16% | 17%
src/Microsoft.TestPlatform.CoreUtilities8% | 0% | 26% | 17% | 47%
src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer0% | 26% | 28% | 34% | 10%
src/Microsoft.TestPlatform.Common0% | 14% | 33% | 30% | 21%
src/Microsoft.TestPlatform.Extensions.BlameDataCollector0% | 32% | 41% | 14% | 11%
src/Microsoft.TestPlatform.CommunicationUtilities0% | 19% | 28% | 24% | 26%
src/Microsoft.TestPlatform.Utilities0% | 27% | 37% | 25% | 10%
src/DataCollectors0% | 32% | 36% | 15% | 16%
src/Microsoft.TestPlatform.Extensions.TrxLogger0% | 4% | 34% | 24% | 37%
src/Microsoft.TestPlatform.TestHostProvider0% | 15% | 35% | 23% | 24%
src/AttachVS0% | 38% | 29% | 19% | 12%
src/SettingsMigrator0% | 28% | 44% | 20% | 5%
src/Microsoft.TestPlatform.PlatformAbstractions0% | 5% | 25% | 25% | 43%
src/Microsoft.TestPlatform.Extensions.HtmlLogger0% | 20% | 46% | 17% | 16%
src/datacollector0% | 47% | 21% | 14% | 16%
src/Microsoft.TestPlatform.AdapterUtilities0% | 6% | 64% | 17% | 11%
src/testhost.x860% | 0% | 65% | 20% | 13%
src/Microsoft.TestPlatform.Execution.Shared0% | 0% | 60% | 15% | 24%
playground/TestPlatform.Playground0% | 0% | 48% | 0% | 51%
playground/MSTest10% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static RunConfiguration FromXml()
in src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs
278 49 1
public void OnMessageReceived()
in src/Microsoft.TestPlatform.CrossPlatEngine/EventHandlers/TestRequestHandler.cs
218 32 2
private void TestRunCompleteHandler()
in src/vstest.console/Internal/ConsoleLogger.cs
198 43 2
private List AddArgs()
in src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs
152 43 0
private bool RunTestInternalWithExecutors()
in src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs
140 24 2
private void ProcessRequests()
in src/Microsoft.TestPlatform.Client/DesignMode/DesignModeClient.cs
123 21 1
public bool TryGetDotnetPathByArchitecture()
in src/Microsoft.TestPlatform.CoreUtilities/Helpers/DotnetHostHelper.cs
118 28 2
private void CollectDumpAndAbortTesthost()
in src/Microsoft.TestPlatform.Extensions.BlameDataCollector/BlameCollector.cs
96 14 0
internal static LoggerSettings FromXml()
in src/Microsoft.TestPlatform.ObjectModel/Logger/LoggerSettings.cs
96 16 1
public virtual TestProcessStartInfo GetTestHostProcessStartInfo()
in src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs
94 24 3
public void RunTests()
in src/vstest.console/TestPlatformHelpers/TestRequestManager.cs
94 12 4
private static bool AttachVs()
in src/AttachVS/AttachVs.cs
93 18 2
public void OnEventLogEntryWritten()
in src/DataCollectors/Microsoft.TestPlatform.Extensions.EventLogCollector/EventLogContainer.cs
91 14 2
internal static FilterExpression Parse()
in src/Microsoft.TestPlatform.Common/Filtering/FilterExpression.cs
91 23 2
public virtual bool SetupChannel()
in src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs
89 14 2
private void TestResultHandler()
in src/vstest.console/Internal/ConsoleLogger.cs
88 16 2
private void AddNewFileTransfer()
in src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionAttachmentManager.cs
87 12 4
private bool UpdateRunSettingsIfRequired()
in src/vstest.console/TestPlatformHelpers/TestRequestManager.cs
87 12 4
public IProxyExecutionManager GetExecutionManager()
in src/Microsoft.TestPlatform.CrossPlatEngine/TestEngine.cs
85 10 3
public virtual int StartTestRun()
in src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManager.cs
84 11 2