microsoft / Partner-Center-PowerShell
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
  • Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
  • You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
Duplication Overall
  • 7% duplication:
    • 7,158 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 546 duplicated lines
  • 51 duplicates
system7% (546 lines)
Duplication per Extension
cs8% (532 lines)
psm13% (14 lines)
Duplication per Component (primary)
src/PowerShell/Commands14% (466 lines)
src/PowerShell/Utilities10% (28 lines)
tools/HelpGeneration4% (14 lines)
src/PowerShell/Models<1% (14 lines)
src/PowerShell/Extensions12% (12 lines)
src/PowerShell/Factories6% (6 lines)
src/PowerShell/Network2% (6 lines)
ROOT0% (0 lines)
src/PowerShell/Attributes0% (0 lines)
src/PowerShell/Authenticators0% (0 lines)
src/PowerShell/Exceptions0% (0 lines)
src/PowerShell0% (0 lines)
src/PowerShell/Validations0% (0 lines)
tools0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 51 duplicates...
Size#FoldersFilesLinesCode
25 x 2 src/PowerShell/Commands
src/PowerShell/Commands
NewPartnerCustomerConfigurationPolicy.cs
SetPartnerCustomerConfigurationPolicy.cs
40:69 (58%)
45:74 (53%)
view
17 x 2 src/PowerShell/Commands
src/PowerShell/Commands
EnablePartnerAzureSubscription.cs
SuspendPartnerAzureSubscription.cs
19:39 (70%)
19:39 (62%)
view
14 x 2 src/PowerShell/Commands
src/PowerShell/Commands
RemovePartnerCustomerUser.cs
RestorePartnerCustomerUser.cs
25:40 (46%)
30:45 (32%)
view
12 x 2 src/PowerShell/Commands
src/PowerShell/Commands
GetPartnerCustomerUser.cs
RestorePartnerCustomerUser.cs
34:47 (23%)
31:44 (27%)
view
12 x 2 src/PowerShell/Commands
src/PowerShell/Commands
GetPartnerCustomerUser.cs
RemovePartnerCustomerUser.cs
34:47 (23%)
26:39 (40%)
view
10 x 2 src/PowerShell/Commands
src/PowerShell/Commands
EnablePartnerAzureSubscription.cs
SetPartnerAzureSubscription.cs
19:30 (41%)
19:30 (29%)
view
10 x 2 src/PowerShell/Commands
src/PowerShell/Commands
SetPartnerAzureSubscription.cs
SuspendPartnerAzureSubscription.cs
19:30 (29%)
19:30 (37%)
view
10 x 2 src/PowerShell/Commands
src/PowerShell/Commands
GetPartnerCustomerConfigurationPolicy.cs
RemovePartnerCustomerConfigurationPol...
24:34 (66%)
21:31 (66%)
view
9 x 2 src/PowerShell/Commands
src/PowerShell/Commands
GetPartnerInvoiceStatement.cs
GetPartnerInvoiceTaxReceiptStatement.cs
20:36 (30%)
20:36 (25%)
view
9 x 2 src/PowerShell/Commands
src/PowerShell/Commands
SetPartnerBillingProfile.cs
SetPartnerLegalProfile.cs
25:41 (9%)
26:42 (45%)
view
8 x 2 src/PowerShell/Commands
src/PowerShell/Commands
GetPartnerInvoiceStatement.cs
GetPartnerInvoiceTaxReceiptStatement.cs
41:55 (26%)
48:62 (22%)
view
8 x 2 src/PowerShell/Commands
src/PowerShell/Commands
GetPartnerCustomerSubscriptionSupport...
NewPartnerCustomerSubscriptionRegistr...
19:27 (66%)
22:30 (66%)
view
8 x 2 src/PowerShell/Commands
src/PowerShell/Commands
GetPartnerCustomerSubscriptionResourc...
GetPartnerCustomerSubscriptionUpgrade...
21:29 (66%)
24:32 (66%)
view
8 x 2 src/PowerShell/Commands
src/PowerShell/Commands
GetPartnerCustomerSubscriptionMeterUs...
GetPartnerCustomerSubscriptionUpgrade...
21:29 (66%)
24:32 (66%)
view
8 x 2 src/PowerShell/Commands
src/PowerShell/Commands
SetPartnerAzureSubscription.cs
SuspendPartnerAzureSubscription.cs
36:45 (23%)
30:39 (29%)
view
8 x 2 src/PowerShell/Commands
src/PowerShell/Commands
GetPartnerCustomerSubscriptionSupport...
NewPartnerCustomerSubscriptionActivat...
19:27 (66%)
23:31 (66%)
view
8 x 2 src/PowerShell/Commands
src/PowerShell/Commands
GetPartnerCustomerAzurePlanEntitlemen...
GetPartnerCustomerSubscriptionAddOn.cs
24:32 (66%)
24:32 (72%)
view
8 x 2 src/PowerShell/Commands
src/PowerShell/Commands
GetPartnerCustomerSubscriptionProvisi...
GetPartnerCustomerSubscriptionRegistr...
22:30 (66%)
22:30 (66%)
view
8 x 2 src/PowerShell/Commands
src/PowerShell/Commands
NewPartnerCustomerSubscriptionActivat...
NewPartnerCustomerSubscriptionRegistr...
23:31 (66%)
22:30 (66%)
view
8 x 2 src/PowerShell/Commands
src/PowerShell/Commands
GetPartnerProductUpgradeEligibility.cs
NewPartnerProductUpgrade.cs
18:26 (66%)
18:26 (66%)
view
Duplicated Units
The list of top 6 duplicated units.
See data for all 6 unit duplicates...
Size#FoldersFilesLinesCode
10 x 2 src/PowerShell/Models/Carts
src/PowerShell/Models/Orders
PSCartLineItem.cs
PSOrderLineItem.cs
99:110 
99:110 
view
7 x 2 src/PowerShell/Models/Roles
src/PowerShell/Models/Roles
PSDirectoryRole.cs
PSDirectoryRole.cs
33:41 
57:65 
view
6 x 2 src/PowerShell/Authenticators
src/PowerShell/Authenticators
DeviceCodeAuthenticator.cs
InteractiveUserAuthenticator.cs
51:57 
105:111 
view
6 x 2 src/PowerShell/Extensions
src/PowerShell/Extensions
AssertExtensions.cs
ValidationExtensions.cs
20:26 
20:26 
view
6 x 2 src/PowerShell/Extensions
src/PowerShell/Extensions
AssertExtensions.cs
ValidationExtensions.cs
33:39 
33:39 
view
6 x 2 src/PowerShell/Extensions
src/PowerShell/Extensions
AssertExtensions.cs
AssertExtensions.cs
46:52 
59:65 
view