microsoft / Dynamics-365-Fraud-Protection-Samples
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
  • 20% duplication:
    • 8,015 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,677 duplicated lines
  • 111 duplicates
system20% (1,677 lines)
Duplication per Extension
cs17% (828 lines)
cshtml38% (717 lines)
phtml32% (60 lines)
scss10% (43 lines)
css8% (29 lines)
Duplication per Component (primary)
src/Web/Views34% (499 lines)
src/Infrastructure/Data50% (356 lines)
src/Infrastructure/Identity59% (330 lines)
src/Web/Areas45% (218 lines)
src/Web/Controllers8% (104 lines)
src/Web/wwwroot9% (72 lines)
eCommerce platforms/Adobe Magento/src8% (60 lines)
src/Web/ViewModels8% (20 lines)
src/ApplicationCore/Entities2% (18 lines)
src/ApplicationCore0% (0 lines)
src/ApplicationCore/Exceptions0% (0 lines)
src/ApplicationCore/Interfaces0% (0 lines)
src/ApplicationCore/Services0% (0 lines)
src/ApplicationCore/Specifications0% (0 lines)
src/Infrastructure/Extensions0% (0 lines)
src/Infrastructure/Logging0% (0 lines)
src/Infrastructure/Services0% (0 lines)
src/Infrastructure/Utilities0% (0 lines)
src/Web0% (0 lines)
src/Web/Extensions0% (0 lines)
src/Web/Helpers0% (0 lines)
src/Web/Interfaces0% (0 lines)
src/Web/Middleware0% (0 lines)
src/Web/Services0% (0 lines)
src/Web/ViewComponents0% (0 lines)

Duplication Between Components (50+ lines)

G src/Web/Areas src/Web/Areas src/Web/Views src/Web/Views src/Web/Areas--src/Web/Views 262

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 111 duplicates...
Size#FoldersFilesLinesCode
172 x 2 src/Infrastructure/Data/Migrations
src/Infrastructure/Data/Migrations
20190302011807_Initial.Designer.cs
CatalogContextModelSnapshot.cs
18:284 (97%)
16:282 (97%)
view
156 x 2 src/Infrastructure/Identity/Migrations
src/Infrastructure/Identity/Migrations
20180916091145_Initial.Designer.cs
AppIdentityDbContextModelSnapshot.cs
18:269 (96%)
16:267 (97%)
view
48 x 2 src/Web/Areas/Admin/Views/Manage
src/Web/Areas/Admin/Views/Manage
cshtml
Details.cshtml
Edit.cshtml
15:90 (54%)
15:90 (64%)
view
41 x 2 src/Web/Views/Order
src/Web/Views/Order
cshtml
Chargeback.cshtml
Return.cshtml
11:64 (62%)
11:64 (60%)
view
26 x 2 src/Web/Views/Order
src/Web/Views/Order
cshtml
Chargeback.cshtml
Label.cshtml
12:42 (39%)
13:43 (27%)
view
26 x 2 src/Web/Views/Order
src/Web/Views/Order
cshtml
Label.cshtml
Return.cshtml
13:43 (27%)
12:42 (38%)
view
17 x 2 src/Web/Areas/Admin/Views/Shared
src/Web/Views/Shared
cshtml
_Layout.cshtml
_Layout.cshtml
8:28 (36%)
14:33 (23%)
view
17 x 2 src/Web/Views/Order
src/Web/Views/Order
cshtml
Label.cshtml
Return.cshtml
49:70 (18%)
45:69 (25%)
view
16 x 2 src/Web/Areas/Admin/Views/Shared/Components/Basket
src/Web/Views/Shared/Components/Basket
cshtml
Default.cshtml
Default.cshtml
1:20 (100%)
1:20 (100%)
view
16 x 2 eCommerce platforms...plate/dfp/customer/form
eCommerce platforms...se/default/template/dfp
phtml
edit.phtml
fingerprinting.phtml
1:16 (19%)
1:16 (72%)
view
16 x 2 eCommerce platforms...plate/dfp/customer/form
eCommerce platforms...ate/dfp/onepage/payment
phtml
edit.phtml
methods.phtml
1:16 (19%)
1:16 (21%)
view
16 x 2 eCommerce platforms...se/default/template/dfp
eCommerce platforms...ate/dfp/onepage/payment
phtml
fingerprinting.phtml
methods.phtml
1:16 (72%)
1:16 (21%)
view
14 x 2 src/Web/Views/Order
src/Web/Views/Order
cshtml
Chargeback.cshtml
Label.cshtml
45:64 (21%)
49:65 (15%)
view
14 x 2 src/Web/Areas/Admin/Views/Shared
src/Web/Views/Shared
cshtml
Error.cshtml
Error.cshtml
1:18 (100%)
1:18 (100%)
view
13 x 2 src/Web/Areas/Admin/Views/Shared
src/Web/Views/Shared
cshtml
_Layout.cshtml
_Layout.cshtml
50:74 (28%)
80:102 (18%)
view
12 x 2 src/Web/wwwroot/css/basket/basket-status
src/Web/wwwroot/css/basket/basket-status
basket-status.component.scss
basket-status.component.scss
23:34 (23%)
39:50 (23%)
view
11 x 2 src/Web/Views/Basket
src/Web/Views/Manage
cshtml
CheckoutDetails.cshtml
ManagePaymentInstrument.cshtml
95:109 (8%)
24:38 (13%)
view
11 x 2 src/Web/Areas/Admin/Views
src/Web/Views
cshtml
_ViewImports.cshtml
_ViewImports.cshtml
1:12 (100%)
1:12 (100%)
view
11 x 2 src/Web/wwwroot/css/basket/basket-status
src/Web/wwwroot/css/basket/basket-status
basket-status.component.css
basket-status.component.css
15:25 (26%)
28:38 (26%)
view
11 x 2 src/Web/Views/Account
src/Web/Views/Basket
cshtml
Register.cshtml
CheckoutDetails.cshtml
28:42 (12%)
30:44 (8%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
188 x 2 src/Infrastructure/Data/Migrations
src/Infrastructure/Data/Migrations
20190302011807_Initial.Designer.cs
CatalogContextModelSnapshot.cs
16:285 
14:283 
view
170 x 2 src/Infrastructure/Identity/Migrations
src/Infrastructure/Identity/Migrations
20180916091145_Initial.Designer.cs
AppIdentityDbContextModelSnapshot.cs
16:270 
14:268 
view