microsoft / MSBuildSdks
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 41 units with 540 lines of code in units (33.6% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (153 lines of code)
    • 5 medium size units (140 lines of code)
    • 8 small units (114 lines of code)
    • 26 very small units (133 lines of code)
0% | 28% | 25% | 21% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 28% | 25% | 21% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Artifacts/Tasks0% | 39% | 29% | 26% | 4%
src/Shared0% | 0% | 23% | 12% | 63%
src/Artifacts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public bool IsMatch()
in src/Artifacts/Tasks/RobocopyMetadata.cs
84 34 3
public static bool TryParse()
in src/Artifacts/Tasks/RobocopyMetadata.cs
69 11 4
private void CopySearch()
in src/Artifacts/Tasks/Robocopy.cs
36 11 5
private void CopyFile()
in src/Artifacts/Tasks/Robocopy.cs
29 5 4
private string DumpString()
in src/Artifacts/Tasks/RobocopyMetadata.cs
27 7 2
protected virtual void Dispose()
in src/Shared/MSBuildSdkTestBase.cs
25 5 1
private void CopyItems()
in src/Artifacts/Tasks/Robocopy.cs
23 6 2
private void LogCopyFailureAndSleep()
in src/Artifacts/Tasks/Robocopy.cs
20 4 3
private void CopyItems()
in src/Artifacts/Tasks/Robocopy.cs
16 3 1
private void CreateDirectoryWithRetries()
in src/Artifacts/Tasks/Robocopy.cs
15 3 1
public void Dump()
in src/Artifacts/Tasks/RobocopyMetadata.cs
14 1 3
public override bool Execute()
in src/Artifacts/Tasks/Robocopy.cs
13 3 0
public MSBuildSdkTestBase()
in src/Shared/MSBuildSdkTestBase.cs
13 1 0
private bool Verify()
in src/Artifacts/Tasks/Robocopy.cs
12 4 3
public bool ShouldCopy()
in src/Artifacts/Tasks/RobocopyMetadata.cs
11 6 3
protected DirectoryInfo CreateFiles()
in src/Shared/MSBuildSdkTestBase.cs
10 2 2
public static bool GetMetadataBoolean()
in src/Artifacts/ExtensionMethods.cs
9 2 3
private string GetMatchString()
in src/Artifacts/Tasks/Robocopy.cs
9 2 1
protected string GetTempFile()
in src/Shared/MSBuildSdkTestBase.cs
8 2 1
public string GetMetadata()
in src/Shared/MockTaskItem.cs
8 2 1