microsoft / Partner-Center-PowerShell
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 416 units with 3,884 lines of code in units (33.4% of code).
    • 1 very long units (140 lines of code)
    • 3 long units (159 lines of code)
    • 44 medium size units (1,306 lines of code)
    • 60 small units (845 lines of code)
    • 308 very small units (1,434 lines of code)
3% | 4% | 33% | 21% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs3% | 4% | 33% | 21% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/PowerShell/Commands9% | 3% | 47% | 20% | 18%
src/PowerShell/Attributes0% | 48% | 0% | 10% | 41%
src/PowerShell/Models0% | 5% | 2% | 14% | 77%
src/PowerShell/Authenticators0% | 0% | 47% | 27% | 25%
src/PowerShell/Utilities0% | 0% | 44% | 26% | 28%
src/PowerShell/Network0% | 0% | 45% | 37% | 17%
src/PowerShell/Factories0% | 0% | 53% | 42% | 3%
src/PowerShell/Validations0% | 0% | 72% | 0% | 27%
src/PowerShell/Extensions0% | 0% | 0% | 25% | 74%
src/PowerShell/Exceptions0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public override void ExecuteCmdlet()
in src/PowerShell/Commands/NewPartnerAccessToken.cs
140 20 0
public override void ExecuteCmdlet()
in src/PowerShell/Commands/GetPartnerInvoiceLineItem.cs
55 10 0
public void PrintCustomAttributeInfo()
in src/PowerShell/Attributes/BreakingChangeBaseAttribute.cs
53 7 3
private static IDictionary InitializeEnvironments()
in src/PowerShell/Models/Authentication/PartnerEnvironment.cs
51 1 0
public override void ExecuteCmdlet()
in src/PowerShell/Commands/GetPartnerUserSignInActivity.cs
50 8 0
public override async Task AuthenticateAsync()
in src/PowerShell/Authenticators/InteractiveUserAuthenticator.cs
49 4 2
public override void ExecuteCmdlet()
in src/PowerShell/Commands/GetPartnerProductSku.cs
47 8 0
private static string GetUserHomeDirOnUnix()
in src/PowerShell/Utilities/SharedUtilities.cs
47 12 0
protected override void ProcessRecord()
in src/PowerShell/Commands/TestPartnerSecurityRequirement.cs
44 4 0
public async Task IsValidAsync()
in src/PowerShell/Validations/AddressValidator.cs
44 11 2
public override void ExecuteCmdlet()
in src/PowerShell/Commands/GetPartnerInvoiceTaxReceiptStatement.cs
39 5 0
public override void ExecuteCmdlet()
in src/PowerShell/Commands/GetPartnerProductAvailability.cs
37 7 0
private static IConfidentialClientApplication CreateConfidentialClient()
in src/PowerShell/Authenticators/DelegatingAuthenticator.cs
36 6 6
private async void RunConcurrentTaskAsync()
in src/PowerShell/Utilities/ConcurrencyTaskScheduler.cs
36 5 2
public async Task CreateLockAsync()
in src/PowerShell/Utilities/CrossPlatformLock.cs
34 5 1
public async Task ListenToSingleRequestAndRespondAsync()
in src/PowerShell/Network/HttpListenerInterceptor.cs
33 2 3
public override void ExecuteCmdlet()
in src/PowerShell/Commands/GetPartnerInvoiceStatement.cs
32 5 0
private AuthenticationParameters GetAuthenticationParameters()
in src/PowerShell/Factories/AuthenticationFactory.cs
32 9 4
public override void ExecuteCmdlet()
in src/PowerShell/Commands/GetPartnerProduct.cs
31 6 0
private async Task ParseBatchResponseAsync()
in src/PowerShell/Commands/GetPartnerUserSignInActivity.cs
31 5 5