microsoft / workbooks
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 3,345 units with 44,255 lines of code in units (54.6% of code).
    • 11 very long units (1,386 lines of code)
    • 69 long units (4,394 lines of code)
    • 509 medium size units (15,707 lines of code)
    • 792 small units (11,486 lines of code)
    • 1,964 very small units (11,282 lines of code)
3% | 9% | 35% | 25% | 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% | 10% | 35% | 26% | 24%
tsx0% | 9% | 37% | 19% | 34%
cpp0% | 37% | 0% | 46% | 15%
ts0% | 2% | 36% | 20% | 40%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
build/Xamarin.Build17% | 23% | 33% | 17% | 8%
Clients/Xamarin.Interactive.Client3% | 12% | 35% | 25% | 23%
Clients/Xamarin.Interactive.Client.Windows8% | 7% | 33% | 27% | 23%
Clients/Xamarin.Interactive.Client.Mac3% | 8% | 27% | 29% | 30%
Tools/InstallerVerifier33% | 0% | 53% | 9% | 3%
ClientIntegrations/Xamarin.Workbooks.Client.iOS25% | 0% | 40% | 12% | 21%
Agents/Xamarin.Interactive1% | 8% | 34% | 30% | 25%
CodeAnalysis/Xamarin.Interactive.CodeAnalysis0% | 13% | 46% | 26% | 13%
Clients/CrossBrowser0% | 10% | 21% | 15% | 53%
Clients/Xamarin.Interactive.Client.Desktop0% | 7% | 41% | 29% | 21%
Clients/Xamarin.Interactive.Client.Web0% | 8% | 37% | 22% | 32%
Tools/Xamarin.CITooling0% | 91% | 0% | 8% | 0%
Agents/Xamarin.Interactive.iOS0% | 27% | 24% | 28% | 19%
Agents/Xamarin.Interactive.Wpf0% | 28% | 37% | 26% | 7%
Agents/Xamarin.Interactive.Mac0% | 12% | 48% | 21% | 18%
Clients/Xamarin.Interactive.Client.Windows.ShellExtension0% | 37% | 0% | 46% | 15%
WorkbookApps/Xamarin.Workbooks.WebAssembly0% | 16% | 14% | 19% | 49%
Agents/Xamarin.Interactive.Android0% | 10% | 50% | 18% | 20%
CodeAnalysis/Xamarin.Interactive.CodeAnalysis.Roslyn0% | 3% | 43% | 27% | 25%
Clients/Xamarin.Interactive.Client.Console0% | 0% | 41% | 30% | 27%
Agents/Xamarin.Interactive.Forms.Android0% | 0% | 62% | 11% | 25%
Agents/Xamarin.Interactive.Forms.iOS0% | 0% | 65% | 6% | 28%
Agents/Xamarin.Interactive.Forms0% | 0% | 56% | 28% | 15%
Tools/ApiDump0% | 0% | 34% | 21% | 44%
Agents/Xamarin.Interactive.Console0% | 0% | 60% | 34% | 4%
Agents/Xamarin.Interactive.DotNetCore0% | 0% | 100% | 0% | 0%
Clients/Xamarin.Interactive.Client.Mac.SimChecker0% | 0% | 100% | 0% | 0%
Tools/ILFixer0% | 0% | 38% | 50% | 11%
Clients/Xamarin.Interactive.MTouch0% | 0% | 22% | 60% | 17%
WorkbookApps/Xamarin.Workbooks.Mac0% | 0% | 0% | 100% | 0%
WorkbookApps/Xamarin.Workbooks.Wpf0% | 0% | 0% | 81% | 18%
WorkbookApps/Xamarin.Workbooks.iOS0% | 0% | 0% | 47% | 52%
WorkbookApps/Xamarin.Workbooks.Android0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public override void Execute()
in build/Xamarin.Build/MSBuild/PolicheckHtmlTemplate.cs
174 5 0
void WriteSingleInline()
in Clients/Xamarin.Interactive.Client/CommonMark/MarkdownFormatter.cs
143 56 2
IEnumerable GetNuGetDependencies()
in build/Xamarin.Build/MSBuild/UpdateInvertedDependencies.cs
139 15 0
static int Main()
in Tools/InstallerVerifier/Program.cs
124 16 1
static string RenderRectangle()
in Clients/Xamarin.Interactive.Client.Mac/MacHtmlResultRenderer.cs
123 3 1
async Task InitializeSimulatorAsync()
in ClientIntegrations/Xamarin.Workbooks.Client.iOS/iOSAgentProcess.cs
122 19 2
void BuildPrimaryPlane()
in Clients/Xamarin.Interactive.Client.Windows/ViewModels/InspectTreeNode3D.cs
121 12 1
public void Update()
in Clients/Xamarin.Interactive.Client.Windows/Views/MenuManager.cs
117 14 1
void WriteSingleBlock()
in Clients/Xamarin.Interactive.Client/CommonMark/MarkdownFormatter.cs
113 29 1
static Method ParseInternalMethodName()
in Agents/Xamarin.Interactive/Representations/Reflection/ReflectionRemoting.cs
106 34 1
static string RenderSize()
in Clients/Xamarin.Interactive.Client.Mac/MacHtmlResultRenderer.cs
104 2 1
public static int Run()
in Clients/Xamarin.Interactive.Client/CommandLineTool/Entry.cs
88 31 2
public override void VisitMethodDeclaration()
in Clients/CrossBrowser/Xamarin.CrossBrowser.Generator/DomBinder.cs
86 9 1
public SessionToolbarDelegate()
in Clients/Xamarin.Interactive.Client.Mac/SessionToolbarDelegate.cs
85 8 3
public FilePath GetPackageInstallPath()
in CodeAnalysis/Xamarin.Interactive.CodeAnalysis/NuGet/InteractivePackageManager.cs
85 14 1
public static int Run()
in Tools/Xamarin.CITooling/ReleaseThreadTool.cs
83 7 1
object ParseObject()
in Agents/Xamarin.Interactive/Collections/PropertyList.cs
79 26 1
int ShowContextMenu()
in Clients/CrossBrowser/Xamarin.CrossBrowser.Wpf/Internal/Com.cs
79 1 2
render()
in Clients/Xamarin.Interactive.Client.Web/ClientApp/components/CodeCellView.tsx
79 6 0
void Hyperlink_Click()
in Clients/Xamarin.Interactive.Client.Windows/Views/UpdaterWindow.xaml.cs
79 8 2