microsoft / AMBROSIA
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,669 units with 33,488 lines of code in units (75.5% of code).
    • 42 very long units (6,868 lines of code)
    • 130 long units (8,762 lines of code)
    • 243 medium size units (7,792 lines of code)
    • 334 small units (4,852 lines of code)
    • 920 very small units (5,214 lines of code)
20% | 26% | 23% | 14% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs19% | 27% | 22% | 14% | 16%
ts24% | 21% | 25% | 13% | 14%
c0% | 47% | 23% | 21% | 8%
js0% | 0% | 100% | 0% | 0%
h0% | 0% | 0% | 76% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Clients23% | 21% | 24% | 15% | 14%
AmbrosiaTest21% | 42% | 23% | 3% | 8%
InternalImmortals27% | 12% | 13% | 20% | 27%
AmbrosiaLib21% | 27% | 26% | 17% | 7%
GenericLogPicker0% | 18% | 28% | 22% | 30%
Ambrosia0% | 61% | 15% | 13% | 10%
AzureBlobsLogPicker0% | 27% | 9% | 13% | 49%
ImmortalCoordinator0% | 47% | 20% | 25% | 6%
SharedAmbrosiaTools0% | 0% | 29% | 37% | 32%
DevTools0% | 0% | 100% | 0% | 0%
ICGUI0% | 0% | 21% | 9% | 68%
UWPLogPicker0% | 0% | 7% | 43% | 49%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public override async Task DispatchToMethod()
in InternalImmortals/XamarinSample/GeneratedSourceFiles/XamarinSampleCommAPIGened/latest/Dispatcher_IXamarinSampleComm.cs
362 52 6
function runUnitTests()
in Clients/AmbrosiaJS/Ambrosia-Node/src/UnitTests.ts
291 52 1
private async Task ReplayAsync()
in AmbrosiaLib/Ambrosia/Program.cs
285 44 2
async function main()
in Clients/AmbrosiaJS/PTI-Node/App/src/Main.ts
274 61 0
protected async Task Dispatch()
in Clients/CSharp/AmbrosiaLibCS/Immortal.cs
267 35 1
private static walkAST()
in Clients/AmbrosiaJS/Ambrosia-Node/src/Meta.ts
256 81 2
function emitConsumerTypeScriptFile()
in Clients/AmbrosiaJS/Ambrosia-Node/src/Meta.ts
246 44 3
public static unsafe void BlockCopy()
in AmbrosiaLib/Ambrosia/xxHash.cs
219 39 5
export function processLogPage()
in Clients/AmbrosiaJS/Ambrosia-Node/src/Messages.ts
210 34 3
function dispatcher()
in Clients/AmbrosiaJS/Ambrosia-Node/src/ICTest.ts
204 38 1
private static void RunCodeGen()
in Clients/CSharp/AmbrosiaCS/Program.cs
197 37 0
public void AMB_ActiveActive_Kill_All_Test()
in AmbrosiaTest/AmbrosiaTest/ActiveActive_Test.cs
193 1 0
public void VerifyAmbrosiaLogFile()
in AmbrosiaTest/AmbrosiaTest/Utilities.cs
179 27 9
public override async Task DispatchToMethod()
in InternalImmortals/XamarinCommandShell/GeneratedSourceFiles/ICommandShellImmortalGenerated/latest/Dispatcher_ICommandShellImmortal.cs
172 32 6
private static tokenizeComplexType()
in Clients/AmbrosiaJS/Ambrosia-Node/src/Meta.ts
171 54 2
public void AMB_ActiveActive_Kill_Client_And_Server_Test()
in AmbrosiaTest/AmbrosiaTest/ActiveActive_Test.cs
167 1 0
public void JS_VerifyTimeTravelDebugging()
in AmbrosiaTest/AmbrosiaTest/JS_Utilities.cs
148 39 13
internal async Task SendAsync()
in AmbrosiaLib/Ambrosia/Program.cs
145 22 2
function dispatcher()
in Clients/AmbrosiaJS/PTI-Node/App/src/PublisherFramework.g.ts
144 27 1
public async Task AddRow()
in AmbrosiaLib/Ambrosia/Program.cs
143 20 6