microsoft / xbox-live-developer-tools
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 269 units with 4,486 lines of code in units (53.6% of code).
    • 1 very long units (432 lines of code)
    • 14 long units (894 lines of code)
    • 39 medium size units (1,177 lines of code)
    • 69 small units (1,063 lines of code)
    • 146 very small units (920 lines of code)
9% | 19% | 26% | 23% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs9% | 19% | 26% | 23% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Tools/MultiplayerSessionHistoryViewer29% | 19% | 22% | 10% | 18%
CommandLine/XblConfig0% | 20% | 41% | 20% | 17%
CommandLine/XblConnectedStorage0% | 100% | 0% | 0% | 0%
Powershell/XblConfig0% | 19% | 29% | 24% | 27%
CommandLine/XblPlayerDataReset0% | 71% | 0% | 28% | 0%
CommandLine/GlobalStorage0% | 57% | 0% | 21% | 20%
Microsoft.Xbox.Service.DevTools/TitleStorage0% | 21% | 46% | 22% | 9%
Microsoft.Xbox.Service.DevTools/PlayerReset0% | 42% | 42% | 9% | 6%
Microsoft.Xbox.Service.DevTools/Authentication0% | 0% | 28% | 38% | 33%
CommandLine/XblDevAccount0% | 0% | 54% | 31% | 13%
Microsoft.Xbox.Service.DevTools/Common0% | 0% | 17% | 30% | 51%
Microsoft.Xbox.Service.DevTools/XblConfig0% | 0% | 0% | 81% | 18%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private void InitializeComponent()
in Tools/MultiplayerSessionHistoryViewer/Form1.Designer.cs
432 1 0
private static async Task Main()
in CommandLine/XblConfig/Program.cs
79 12 1
private static async Task OnReset()
in CommandLine/XblPlayerDataReset/Program.cs
78 13 1
private static async Task Main()
in CommandLine/GlobalStorage/Program.cs
76 16 1
private async void SaveSessionHistoryToolStripMenuItem_Click()
in Tools/MultiplayerSessionHistoryViewer/Form1.cs
73 9 2
private async void ListView2_SelectedIndexChanged()
in Tools/MultiplayerSessionHistoryViewer/Form1.cs
71 12 2
private void LoadSessionHistoryToolStripMenuItem_Click()
in Tools/MultiplayerSessionHistoryViewer/Form1.cs
71 8 2
private async Task SearchForHistoricalDocumentsAsync()
in Tools/MultiplayerSessionHistoryViewer/Form1.cs
63 8 2
internal static async Task GetGlobalStorageBlobMetaDataAsync()
in Microsoft.Xbox.Service.DevTools/TitleStorage/TitleStorage.cs
57 4 6
private static async Task SubmitJobAndPollStatus()
in Microsoft.Xbox.Service.DevTools/PlayerReset/PlayerReset.cs
56 13 3
private static async Task GetSchemasAsync()
in CommandLine/XblConfig/Program.cs
55 7 1
private static async Task Main()
in CommandLine/XblConnectedStorage/Program.cs
55 8 1
private static async Task OnDownload()
in CommandLine/XblConnectedStorage/Program.cs
54 4 1
protected override void Process()
in Powershell/XblConfig/GetSchemas.cs
54 7 0
protected override void Process()
in Powershell/XblConfig/GetDocuments.cs
52 10 0
public int Compare()
in Tools/MultiplayerSessionHistoryViewer/Form1.cs
49 9 2
private async void ListView1_SelectedIndexChanged()
in Tools/MultiplayerSessionHistoryViewer/Form1.cs
46 11 2
private static async Task GetDocumentsAsync()
in CommandLine/XblConfig/Program.cs
45 8 1
public static string Print()
in CommandLine/XblConfig/ObjectPrinter.cs
43 7 2
protected async Task FetchXstsToken()
in Microsoft.Xbox.Service.DevTools/Authentication/AuthClient.cs
43 1 2