microsoft / testfx
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 1,133 units with 14,558 lines of code in units (35.9% of code).
    • 4 very long units (441 lines of code)
    • 33 long units (2,215 lines of code)
    • 168 medium size units (5,148 lines of code)
    • 211 small units (3,050 lines of code)
    • 717 very small units (3,704 lines of code)
3% | 15% | 35% | 20% | 25%
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% | 35% | 20% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Adapter3% | 15% | 37% | 21% | 20%
src/TestFramework0% | 12% | 26% | 16% | 43%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private static MSTestSettings ToSettings()
in src/Adapter/MSTest.CoreAdapter/MSTestSettings.cs
114 23 1
private Assembly OnResolveInternal()
in src/Adapter/PlatformServices.Desktop.Legacy/AssemblyResolver.cs
110 19 3
private Assembly OnResolveInternal()
in src/Adapter/PlatformServices.Desktop/AssemblyResolver.cs
110 19 3
private void ExecuteTestsInSource()
in src/Adapter/MSTest.CoreAdapter/Execution/TestExecutionManager.cs
107 21 5
internal static MethodBase SelectMethod()
in src/TestFramework/Extension.Desktop/RuntimeTypeHelper.cs
98 20 4
internal TestCase ToTestCase()
in src/Adapter/MSTest.CoreAdapter/ObjectModel/UnitTestElement.cs
97 21 0
protected IEnumerable Deploy()
in src/Adapter/PlatformServices.Shared/netstandard1.3/Utilities/ns13DeploymentUtilityBase.cs
96 15 4
internal static int FindMostSpecific()
in src/TestFramework/Extension.Desktop/RuntimeTypeHelper.cs
83 25 8
private static void SetParallelSettings()
in src/Adapter/MSTest.CoreAdapter/MSTestSettings.cs
82 11 2
public void RunClassInitialize()
in src/Adapter/MSTest.CoreAdapter/Execution/TestClassInfo.cs
75 13 1
protected IEnumerable GetSatellites()
in src/Adapter/PlatformServices.Desktop.Legacy/Utilities/DesktopDeploymentUtility.cs
75 14 3
protected IEnumerable GetSatellites()
in src/Adapter/PlatformServices.Desktop/Utilities/DesktopDeploymentUtility.cs
75 14 3
private TestResult ExecuteInternal()
in src/Adapter/MSTest.CoreAdapter/Execution/TestMethodInfo.cs
74 17 1
public override List GetDataTablesAndViews()
in src/Adapter/PlatformServices.Desktop.Legacy/Data/TestDataConnectionSql.cs
74 12 0
public override List GetDataTablesAndViews()
in src/Adapter/PlatformServices.Desktop/Data/TestDataConnectionSql.cs
74 12 0
private bool ExecuteDataSourceBasedTests()
in src/Adapter/MSTest.CoreAdapter/Execution/TestMethodRunner.cs
73 10 1
internal static UnitTestElement ToUnitTestElement()
in src/Adapter/MSTest.CoreAdapter/Extensions/TestCaseExtensions.cs
66 13 2
public string RunClassCleanup()
in src/Adapter/MSTest.CoreAdapter/Execution/TestClassInfo.cs
65 12 1
internal void SendTestCases()
in src/Adapter/MSTest.CoreAdapter/Discovery/UnitTestDiscoverer.cs
64 12 5
private LinkedList GetMethodCandidates()
in src/TestFramework/Extension.Desktop/PrivateObject.cs
63 11 5