microsoft / MCW-Migrating-Oracle-to-Azure-SQL-and-PostgreSQL
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
  • 10% duplication:
    • 13,980 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,419 duplicated lines
  • 114 duplicates
system10% (1,419 lines)
Duplication per Extension
cshtml67% (1,011 lines)
js1% (196 lines)
cs18% (186 lines)
ps16% (26 lines)
Duplication per Component (primary)
lab-files/starter-project/NorthwindMVC/Views/Employees74% (318 lines)
lab-files/starter-project/NorthwindMVC/Views/Suppliers83% (256 lines)
lab-files/starter-project/NorthwindMVC/Views/Customers83% (240 lines)
lab-files/starter-project/NorthwindMVC/wwwroot/lib1% (196 lines)
lab-files/starter-project/NorthwindMVC/Views/Products49% (120 lines)
lab-files/starter-project/NorthwindMVC/Data18% (110 lines)
lab-files/starter-project/NorthwindMVC/Views/Shippers61% (77 lines)
lab-files/starter-project/NorthwindMVC/Controllers20% (76 lines)
lab-files6% (26 lines)
lab-files/starter-project/NorthwindMVC/Models0% (0 lines)
lab-files/starter-project/NorthwindMVC0% (0 lines)
lab-files/starter-project/NorthwindMVC/Views/Home0% (0 lines)
lab-files/starter-project/NorthwindMVC/Views/Shared0% (0 lines)
lab-files/starter-project/NorthwindMVC/Views0% (0 lines)
lab-files/starter-project/NorthwindMVC/wwwroot/css0% (0 lines)
lab-files/starter-project/NorthwindMVC/wwwroot/js0% (0 lines)

Duplication Between Components (50+ lines)

G lab-files/starter-project/NorthwindMVC/Views/Customers lab-files/starter-project/NorthwindMVC/Views/Customers lab-files/starter-project/NorthwindMVC/Views/Suppliers lab-files/starter-project/NorthwindMVC/Views/Suppliers lab-files/starter-project/NorthwindMVC/Views/Customers--lab-files/starter-project/NorthwindMVC/Views/Suppliers 474 lab-files/starter-project/NorthwindMVC/Views/Employees lab-files/starter-project/NorthwindMVC/Views/Employees lab-files/starter-project/NorthwindMVC/Views/Customers--lab-files/starter-project/NorthwindMVC/Views/Employees 268 lab-files/starter-project/NorthwindMVC/Views/Shippers lab-files/starter-project/NorthwindMVC/Views/Shippers lab-files/starter-project/NorthwindMVC/Views/Customers--lab-files/starter-project/NorthwindMVC/Views/Shippers 102 lab-files/starter-project/NorthwindMVC/Views/Products lab-files/starter-project/NorthwindMVC/Views/Products lab-files/starter-project/NorthwindMVC/Views/Customers--lab-files/starter-project/NorthwindMVC/Views/Products 56 lab-files/starter-project/NorthwindMVC/Views/Employees--lab-files/starter-project/NorthwindMVC/Views/Suppliers 268 lab-files/starter-project/NorthwindMVC/Views/Employees--lab-files/starter-project/NorthwindMVC/Views/Shippers 56 lab-files/starter-project/NorthwindMVC/Views/Employees--lab-files/starter-project/NorthwindMVC/Views/Products 56 lab-files/starter-project/NorthwindMVC/Views/Shippers--lab-files/starter-project/NorthwindMVC/Views/Suppliers 102 lab-files/starter-project/NorthwindMVC/Views/Products--lab-files/starter-project/NorthwindMVC/Views/Shippers 56 lab-files/starter-project/NorthwindMVC/Views/Products--lab-files/starter-project/NorthwindMVC/Views/Suppliers 56

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 114 duplicates...
Size#FoldersFilesLinesCode
72 x 2 Hands-on lab/lab-fi...windMVC/Views/Employees
Hands-on lab/lab-fi...windMVC/Views/Employees
cshtml
Delete.cshtml
Details.cshtml
10:114 (87%)
9:113 (90%)
view
62 x 2 Hands-on lab/lab-fi...windMVC/Views/Employees
Hands-on lab/lab-fi...windMVC/Views/Employees
cshtml
Create.cshtml
Edit.cshtml
20:96 (69%)
16:92 (71%)
view
48 x 2 Hands-on lab/lab-fi...windMVC/Views/Suppliers
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Delete.cshtml
Details.cshtml
10:78 (82%)
9:77 (85%)
view
45 x 2 Hands-on lab/lab-fi...windMVC/Views/Suppliers
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Create.cshtml
Edit.cshtml
20:75 (68%)
16:71 (71%)
view
44 x 2 Hands-on lab/lab-fi...windMVC/Views/Customers
Hands-on lab/lab-fi...windMVC/Views/Customers
cshtml
Delete.cshtml
Details.cshtml
10:72 (81%)
9:71 (84%)
view
42 x 2 Hands-on lab/lab-fi...windMVC/Views/Customers
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Delete.cshtml
Delete.cshtml
12:72 (77%)
12:72 (72%)
view
42 x 2 Hands-on lab/lab-fi...windMVC/Views/Customers
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Details.cshtml
Delete.cshtml
11:71 (80%)
12:72 (72%)
view
42 x 2 Hands-on lab/lab-fi...windMVC/Views/Customers
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Details.cshtml
Details.cshtml
11:71 (80%)
11:71 (75%)
view
42 x 2 Hands-on lab/lab-fi...windMVC/Views/Customers
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Delete.cshtml
Details.cshtml
12:72 (77%)
11:71 (75%)
view
41 x 2 Hands-on lab/lab-fi...windMVC/Views/Customers
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Create.cshtml
Create.cshtml
20:70 (66%)
20:70 (62%)
view
41 x 2 Hands-on lab/lab-fi...windMVC/Views/Customers
Hands-on lab/lab-fi...windMVC/Views/Customers
cshtml
Create.cshtml
Edit.cshtml
20:70 (66%)
16:66 (69%)
view
41 x 2 Hands-on lab/lab-fi...windMVC/Views/Customers
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Create.cshtml
Edit.cshtml
20:70 (66%)
16:66 (65%)
view
41 x 2 Hands-on lab/lab-fi...windMVC/Views/Customers
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Edit.cshtml
Create.cshtml
16:66 (69%)
20:70 (62%)
view
41 x 2 Hands-on lab/lab-fi...windMVC/Views/Customers
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Edit.cshtml
Edit.cshtml
16:66 (69%)
16:66 (65%)
view
40 x 2 Hands-on lab/lab-fi...hwindMVC/Views/Products
Hands-on lab/lab-fi...hwindMVC/Views/Products
cshtml
Delete.cshtml
Details.cshtml
10:66 (80%)
9:65 (83%)
view
32 x 2 Hands-on lab/lab-fi...VC/wwwroot/lib/Chart.js
Hands-on lab/lab-fi...VC/wwwroot/lib/Chart.js
chart.js
chart.js
8194:8228 (<1%)
8501:8535 (<1%)
view
27 x 2 Hands-on lab/lab-fi...windMVC/Views/Customers
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Index.cshtml
Index.cshtml
5:43 (45%)
5:43 (42%)
view
25 x 2 Hands-on lab/lab-fi...windMVC/Views/Customers
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Index.cshtml
Index.cshtml
45:81 (42%)
48:84 (39%)
view
21 x 2 Hands-on lab/lab-fi...windMVC/Views/Employees
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Create.cshtml
Edit.cshtml
50:75 (23%)
31:56 (33%)
view
21 x 2 Hands-on lab/lab-fi...windMVC/Views/Employees
Hands-on lab/lab-fi...windMVC/Views/Suppliers
cshtml
Edit.cshtml
Edit.cshtml
46:71 (24%)
31:56 (33%)
view
Duplicated Units
The list of top 6 duplicated units.
See data for all 6 unit duplicates...
Size#FoldersFilesLinesCode
19 x 2 Hands-on lab/lab-fi...VC/wwwroot/lib/Chart.js
Hands-on lab/lab-fi...VC/wwwroot/lib/Chart.js
chart.js
chart.js
8198:8217 
8505:8524 
view
15 x 2 Hands-on lab/lab-fi...orthwindMVC/Controllers
Hands-on lab/lab-fi...orthwindMVC/Controllers
ProductsController.cs
ProductsController.cs
29:46 
130:147 
view
14 x 2 Hands-on lab/lab-fi...orthwindMVC/Controllers
Hands-on lab/lab-fi...orthwindMVC/Controllers
EmployeesController.cs
EmployeesController.cs
29:45 
125:141 
view
13 x 2 Hands-on lab/lab-fi...orthwindMVC/Controllers
Hands-on lab/lab-fi...orthwindMVC/Controllers
CustomersController.cs
CustomersController.cs
28:43 
119:134 
view
13 x 2 Hands-on lab/lab-fi...orthwindMVC/Controllers
Hands-on lab/lab-fi...orthwindMVC/Controllers
ShippersController.cs
ShippersController.cs
28:43 
119:134 
view
13 x 2 Hands-on lab/lab-fi...orthwindMVC/Controllers
Hands-on lab/lab-fi...orthwindMVC/Controllers
SuppliersController.cs
SuppliersController.cs
28:43 
119:134 
view