microsoft / Windows-appsample-customers-orders-database
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:
    • 3,000 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 323 duplicated lines
  • 28 duplicates
system10% (323 lines)
Duplication per Extension
xaml18% (261 lines)
cs3% (62 lines)
Duplication per Component (primary)
ContosoApp/Views18% (287 lines)
ContosoService/Controllers25% (24 lines)
ContosoApp5% (12 lines)
ContosoApp/Properties0% (0 lines)
ContosoApp/UserControls0% (0 lines)
ContosoApp/ViewModels0% (0 lines)
ContosoModels0% (0 lines)
ContosoRepository0% (0 lines)
ContosoRepository/Rest0% (0 lines)
ContosoRepository/Sql0% (0 lines)
ContosoService0% (0 lines)

Duplication Between Components (50+ lines)

G ContosoApp ContosoApp ContosoApp/Views ContosoApp/Views ContosoApp--ContosoApp/Views 55

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 28 duplicates...
Size#FoldersFilesLinesCode
16 x 2 ContosoApp/Views
ContosoApp/Views
xaml
CustomerDetailPage.xaml
CustomerListPage.xaml
299:325 (6%)
145:168 (12%)
view
13 x 2 ContosoApp/Views
ContosoApp/Views
xaml
OrderDetailPage.xaml
OrderDetailPage.xaml
84:97 (2%)
501:514 (2%)
view
13 x 2 ContosoApp/Views
ContosoApp/Views
xaml
OrderDetailPage.xaml
OrderDetailPage.xaml
43:56 (2%)
319:332 (2%)
view
12 x 2 ContosoApp/Views
ContosoApp/Views
xaml
CustomerDetailPage.xaml
SettingsPage.xaml
309:325 (4%)
58:74 (27%)
view
12 x 2 ContosoApp
ContosoApp/Views
xaml
AppShell.xaml
CustomerListPage.xaml
112:128 (14%)
152:168 (9%)
view
12 x 2 ContosoApp
ContosoApp/Views
xaml
AppShell.xaml
SettingsPage.xaml
112:128 (14%)
58:74 (27%)
view
12 x 2 ContosoApp
ContosoApp/Views
xaml
AppShell.xaml
CustomerDetailPage.xaml
112:128 (14%)
309:325 (4%)
view
12 x 2 ContosoApp/Views
ContosoApp/Views
xaml
CustomerListPage.xaml
SettingsPage.xaml
152:168 (9%)
58:74 (27%)
view
11 x 2 ContosoApp/Views
ContosoApp/Views
xaml
CustomerListPage.xaml
OrderListPage.xaml
143:156 (8%)
250:265 (5%)
view
11 x 2 ContosoApp/Views
ContosoApp/Views
xaml
CustomerDetailPage.xaml
OrderListPage.xaml
275:288 (4%)
232:245 (5%)
view
10 x 2 ContosoApp/Views
ContosoApp/Views
OrderDetailPage.xaml.cs
OrderDetailPage.xaml.cs
100:113 (9%)
169:181 (9%)
view
10 x 2 ContosoApp/Views
ContosoApp/Views
xaml
CustomerDetailPage.xaml
OrderListPage.xaml
23:32 (3%)
23:32 (4%)
view
9 x 2 ContosoApp/Views
ContosoApp/Views
xaml
CustomerDetailPage.xaml
OrderListPage.xaml
299:313 (3%)
252:265 (4%)
view
9 x 2 ContosoApp/Views
ContosoApp/Views
CustomerListPage.xaml.cs
CustomerListPage.xaml.cs
98:106 (10%)
146:154 (10%)
view
8 x 2 ContosoApp/Views
ContosoApp/Views
xaml
CustomerDetailPage.xaml
OrderListPage.xaml
231:241 (3%)
222:232 (3%)
view
8 x 2 ContosoApp/Views
ContosoApp/Views
xaml
CustomerDetailPage.xaml
CustomerListPage.xaml
42:49 (3%)
55:62 (6%)
view
8 x 2 ContosoService/Controllers
ContosoService/Controllers
CustomerController.cs
ProductController.cs
45:65 (28%)
43:63 (32%)
view
8 x 2 ContosoService/Controllers
ContosoService/Controllers
CustomerController.cs
OrderController.cs
45:65 (28%)
43:63 (20%)
view
8 x 2 ContosoApp/Views
ContosoApp/Views
xaml
CustomerListPage.xaml
OrderListPage.xaml
28:36 (6%)
30:38 (3%)
view
8 x 2 ContosoService/Controllers
ContosoService/Controllers
OrderController.cs
ProductController.cs
43:63 (20%)
43:63 (32%)
view