microsoft / MCW-App-modernization
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
  • 14% duplication:
    • 7,178 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,038 duplicated lines
  • 40 duplicates
system14% (1,038 lines)
Duplication per Extension
cs18% (595 lines)
ps141% (214 lines)
scss8% (125 lines)
cshtml5% (104 lines)
Duplication per Component (primary)
src/src/PartsUnlimited.Models47% (490 lines)
src/src/PartsUnlimitedWebsite6% (314 lines)
src/env35% (70 lines)
src/env/Scripts72% (70 lines)
ARM-template30% (58 lines)
src/scripts27% (16 lines)
src-invoicing-functions/FunctionApp10% (10 lines)
src-invoicing-functions/RazorPagesApp/Pages9% (10 lines)
src-invoicing-functions/FunctionApp/Pages0% (0 lines)
src-invoicing-functions/RazorPagesApp0% (0 lines)
src-invoicing-functions/RazorPagesApp/wwwroot0% (0 lines)
src0% (0 lines)
workflow0% (0 lines)

Duplication Between Components (50+ lines)

G src/env src/env src/env/Scripts src/env/Scripts src/env--src/env/Scripts 140

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 40 duplicates...
Size#FoldersFilesLinesCode
230 x 2 Hands-on lab/lab-fi...mited.Models/Migrations
Hands-on lab/lab-fi...mited.Models/Migrations
20151222030342_InitialMigration.Desig...
PartsUnlimitedContextModelSnapshot.cs
15:380 (98%)
15:380 (98%)
view
58 x 2 Hands-on lab/lab-files/src/env
Hands-on lab/lab-files/src/env/Scripts
Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
32:104 (49%)
25:97 (60%)
view
21 x 2 Hands-on lab/lab-files/ARM-template
Hands-on lab/lab-files/ARM-template
configure-webvm.ps1
webvm-logon-install.ps1
14:34 (24%)
1:21 (45%)
view
16 x 2 Hands-on lab/lab-fi...Areas/Admin/Controllers
Hands-on lab/lab-fi...itedWebsite/Controllers
OrdersController.cs
OrdersController.cs
40:60 (55%)
73:93 (34%)
view
14 x 2 Hands-on lab/lab-fi...nlimitedWebsite/Content
Hands-on lab/lab-fi...nlimitedWebsite/Content
Site.scss
Site.scss
460:473 (1%)
526:539 (1%)
view
13 x 2 Hands-on lab/lab-fi...UnlimitedWebsite/Models
Hands-on lab/lab-fi...UnlimitedWebsite/Models
AccountViewModels.cs
AccountViewModels.cs
75:89 (17%)
94:108 (17%)
view
12 x 2 Hands-on lab/lab-fi...reas/Admin/Views/Orders
Hands-on lab/lab-fi...tedWebsite/Views/Orders
cshtml
Details.cshtml
Details.cshtml
1:14 (100%)
1:13 (100%)
view
12 x 2 Hands-on lab/lab-files/src/env
Hands-on lab/lab-files/src/env/Scripts
Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
106:119 (10%)
99:112 (12%)
view
10 x 2 Hands-on lab/lab-fi...nlimitedWebsite/Content
Hands-on lab/lab-fi...nlimitedWebsite/Content
Site.scss
Site.scss
354:363 (1%)
532:541 (1%)
view
10 x 2 Hands-on lab/lab-fi...nlimitedWebsite/Content
Hands-on lab/lab-fi...nlimitedWebsite/Content
Site.scss
Site.scss
434:443 (1%)
590:599 (1%)
view
10 x 2 Hands-on lab/lab-fi...g-functions/FunctionApp
Hands-on lab/lab-fi...ons/RazorPagesApp/Pages
GeneratePdf.cs
Index.cshtml.cs
108:120 (16%)
43:55 (34%)
view
9 x 2 Hands-on lab/lab-fi...itedWebsite/Controllers
Hands-on lab/lab-fi...itedWebsite/Controllers
OrdersController.cs
ShoppingCartController.cs
75:85 (19%)
41:51 (13%)
view
9 x 2 Hands-on lab/lab-fi...Areas/Admin/Controllers
Hands-on lab/lab-fi...itedWebsite/Controllers
OrdersController.cs
ShoppingCartController.cs
42:52 (31%)
41:51 (13%)
view
9 x 2 Hands-on lab/lab-fi...UnlimitedWebsite/Models
Hands-on lab/lab-fi...UnlimitedWebsite/Models
ManageViewModels.cs
ManageViewModels.cs
34:43 (17%)
53:62 (17%)
view
8 x 2 Hands-on lab/lab-fi...nlimitedWebsite/Content
Hands-on lab/lab-fi...nlimitedWebsite/Content
Site.scss
Site.scss
344:352 (<1%)
456:464 (<1%)
view
8 x 2 Hands-on lab/lab-fi...nlimitedWebsite/Content
Hands-on lab/lab-fi...nlimitedWebsite/Content
Site.scss
Site.scss
354:361 (<1%)
466:473 (<1%)
view
8 x 2 Hands-on lab/lab-fi...nlimitedWebsite/Content
Hands-on lab/lab-fi...nlimitedWebsite/Content
Site.scss
Site.scss
423:432 (<1%)
546:554 (<1%)
view
8 x 2 Hands-on lab/lab-files/src/scripts
Hands-on lab/lab-files/src/scripts
Call-Dnu.ps1
Call-Dnx.ps1
3:11 (50%)
3:11 (61%)
view
8 x 2 Hands-on lab/lab-files/ARM-template
Hands-on lab/lab-files/ARM-template
configure-sqlvm.ps1
configure-webvm.ps1
6:13 (13%)
5:12 (9%)
view
7 x 2 Hands-on lab/lab-fi...edWebsite/Views/Account
Hands-on lab/lab-fi...edWebsite/Views/Account
cshtml
ForgotPasswordConfirmation.cshtml
RegisterConfirmation.cshtml
3:10 (53%)
3:9 (53%)
view
Duplicated Units
The list of top 3 duplicated units.
See data for all 3 unit duplicates...
Size#FoldersFilesLinesCode
253 x 2 Hands-on lab/lab-fi...mited.Models/Migrations
Hands-on lab/lab-fi...mited.Models/Migrations
20151222030342_InitialMigration.Desig...
PartsUnlimitedContextModelSnapshot.cs
13:381 
13:381 
view
10 x 2 Hands-on lab/lab-fi...itedWebsite/Controllers
Hands-on lab/lab-fi...itedWebsite/Controllers
AccountController.cs
ManageController.cs
455:465 
373:383 
view
6 x 2 Hands-on lab/lab-fi...itedWebsite/Controllers
Hands-on lab/lab-fi...itedWebsite/Controllers
AccountController.cs
ManageController.cs
442:448 
337:343 
view