bazelbuild / rules_dotnet
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 267 units with 3,484 lines of code in units (9.5% of code).
    • 0 very long units (0 lines of code)
    • 9 long units (599 lines of code)
    • 33 medium size units (1,110 lines of code)
    • 64 small units (943 lines of code)
    • 161 very small units (832 lines of code)
0% | 17% | 31% | 27% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 20% | 20% | 28% | 30%
c0% | 6% | 65% | 23% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tools/simpleresgen/mono0% | 20% | 14% | 28% | 36%
tools/nuget2bazel0% | 23% | 21% | 27% | 27%
tools/nuget2bazel/rules0% | 15% | 36% | 25% | 22%
dotnet/tools/common0% | 14% | 46% | 36% | 2%
dotnet/tools/launcher_core_xunit0% | 0% | 100% | 0% | 0%
dotnet/tools/launcher_core_nunit30% | 0% | 100% | 0% | 0%
dotnet/tools/launcher_core0% | 0% | 100% | 0% | 0%
dotnet/tools/md50% | 0% | 84% | 0% | 15%
dotnet/tools/md5sum0% | 0% | 76% | 23% | 0%
dotnet/tools/symlink0% | 0% | 45% | 54% | 0%
tools/simpleresgen0% | 0% | 0% | 100% | 0%
dotnet/tools/copy0% | 0% | 0% | 48% | 51%
dotnet/tools/empty0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private WorkspaceEntry ParseEntry()
in tools/nuget2bazel/WorkspaceParser.cs
97 27 0
public void AddMetadata()
in tools/simpleresgen/mono/ResXResourceWriter.cs
78 18 2
public WorkspaceEntry()
in tools/nuget2bazel/WorkspaceEntry.cs
77 13 12
public string Generate()
in tools/nuget2bazel/WorkspaceEntry.cs
67 24 1
unsafe static string AbsoluteToRelativePath()
in tools/simpleresgen/mono/ResXResourceWriter.cs
63 16 2
private async Task Handle()
in tools/nuget2bazel/rules/RuntimeCoreGenerator.cs
56 9 2
int cp()
in dotnet/tools/common/copyfile.c
55 10 2
private void LoadData()
in tools/simpleresgen/mono/ResXResourceReader.cs
55 15 0
private void AddResource()
in tools/simpleresgen/mono/ResXResourceWriter.cs
51 17 3
void CreateLinkIfNeeded()
in dotnet/tools/common/manifest.c
48 12 2
private async Task GenerateBazelFile()
in tools/nuget2bazel/rules/StdlibCoreGenerator3.cs
48 9 2
private async Task GenerateBazelFile()
in tools/nuget2bazel/rules/StdlibCoreGenerator.cs
46 6 2
static void LaunchProcess()
in dotnet/tools/launcher_core_xunit/main.c
45 6 3
static void LaunchProcess()
in dotnet/tools/launcher_core_nunit3/main.c
45 6 3
void CreateLinkIfNeeded()
in dotnet/tools/common/manifest.c
45 12 2
static void Execute()
in dotnet/tools/launcher_core/main.c
43 8 3
int main()
in dotnet/tools/md5sum/main.c
43 7 2
private static async Task Main()
in tools/nuget2bazel/Program.cs
41 1 1
public override async Task InstallPackageAsync()
in tools/nuget2bazel/ProjectBazelManipulator.cs
41 4 4
void ReadManifestFromPath()
in dotnet/tools/common/manifest.c
38 6 1