microsoft / Windows-AppConsult-Samples-UWP
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
  • 43% duplication:
    • 2,169 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 947 duplicated lines
  • 102 duplicates
system43% (947 lines)
Duplication per Extension
cs44% (473 lines)
vcxproj59% (168 lines)
m72% (80 lines)
filters85% (72 lines)
java55% (38 lines)
xaml13% (36 lines)
bzl100% (34 lines)
js15% (22 lines)
props100% (12 lines)
cpp22% (12 lines)
Duplication per Component (primary)
GeolocationSample/windows42% (138 lines)
NativeModulesSample/windows57% (138 lines)
UWP-Advanced-Inking/XAMLShapesAdvancedManipulations36% (67 lines)
UWP-Advanced-Inking/XAMLShapesLineCurving35% (67 lines)
PlaneIdentifier/PlaneIdentifier54% (63 lines)
UWP-Advanced-Inking/XAMLShapesManipulations61% (61 lines)
UWP-Advanced-Inking/StrokesToShapes77% (59 lines)
UWP-Advanced-Inking/UnprocessedInput27% (53 lines)
PlaneIdentifier/PlaneIdentifier.Desktop43% (42 lines)
GeolocationSample/ios63% (40 lines)
NativeModulesSample/ios74% (40 lines)
UWP-Advanced-Inking/InkingAndZoom63% (40 lines)
GeolocationSample/android60% (36 lines)
NativeModulesSample/android85% (36 lines)
UWP-Advanced-Inking/CurveALine33% (27 lines)
XamlIslands/ComplexCustomControl13% (12 lines)
GeolocationSample16% (11 lines)
NativeModulesSample14% (11 lines)
XamlIslands/SimpleCustomControl10% (6 lines)

Duplication Between Components (50+ lines)

G GeolocationSample/windows GeolocationSample/windows NativeModulesSample/windows NativeModulesSample/windows GeolocationSample/windows--NativeModulesSample/windows 264 UWP-Advanced-Inking/XAMLShapesAdvancedManipulations UWP-Advanced-Inking/XAMLShapesAdvancedManipulations UWP-Advanced-Inking/XAMLShapesLineCurving UWP-Advanced-Inking/XAMLShapesLineCurving UWP-Advanced-Inking/XAMLShapesAdvancedManipulations--UWP-Advanced-Inking/XAMLShapesLineCurving 134 UWP-Advanced-Inking/XAMLShapesManipulations UWP-Advanced-Inking/XAMLShapesManipulations UWP-Advanced-Inking/XAMLShapesAdvancedManipulations--UWP-Advanced-Inking/XAMLShapesManipulations 118 UWP-Advanced-Inking/XAMLShapesLineCurving--UWP-Advanced-Inking/XAMLShapesManipulations 118 UWP-Advanced-Inking/StrokesToShapes UWP-Advanced-Inking/StrokesToShapes UWP-Advanced-Inking/StrokesToShapes--UWP-Advanced-Inking/XAMLShapesAdvancedManipulations 116 UWP-Advanced-Inking/StrokesToShapes--UWP-Advanced-Inking/XAMLShapesLineCurving 116 UWP-Advanced-Inking/StrokesToShapes--UWP-Advanced-Inking/XAMLShapesManipulations 116 UWP-Advanced-Inking/UnprocessedInput UWP-Advanced-Inking/UnprocessedInput UWP-Advanced-Inking/StrokesToShapes--UWP-Advanced-Inking/UnprocessedInput 106 UWP-Advanced-Inking/UnprocessedInput--UWP-Advanced-Inking/XAMLShapesManipulations 104 UWP-Advanced-Inking/UnprocessedInput--UWP-Advanced-Inking/XAMLShapesLineCurving 104 UWP-Advanced-Inking/UnprocessedInput--UWP-Advanced-Inking/XAMLShapesAdvancedManipulations 104 PlaneIdentifier/PlaneIdentifier.Desktop PlaneIdentifier/PlaneIdentifier.Desktop PlaneIdentifier/PlaneIdentifier PlaneIdentifier/PlaneIdentifier PlaneIdentifier/PlaneIdentifier.Desktop--PlaneIdentifier/PlaneIdentifier 84 GeolocationSample/ios GeolocationSample/ios NativeModulesSample/ios NativeModulesSample/ios GeolocationSample/ios--NativeModulesSample/ios 80 UWP-Advanced-Inking/InkingAndZoom UWP-Advanced-Inking/InkingAndZoom UWP-Advanced-Inking/InkingAndZoom--UWP-Advanced-Inking/XAMLShapesManipulations 80 UWP-Advanced-Inking/InkingAndZoom--UWP-Advanced-Inking/XAMLShapesAdvancedManipulations 66 UWP-Advanced-Inking/InkingAndZoom--UWP-Advanced-Inking/UnprocessedInput 66 UWP-Advanced-Inking/InkingAndZoom--UWP-Advanced-Inking/XAMLShapesLineCurving 66 UWP-Advanced-Inking/InkingAndZoom--UWP-Advanced-Inking/StrokesToShapes 66 GeolocationSample/android GeolocationSample/android NativeModulesSample/android NativeModulesSample/android GeolocationSample/android--NativeModulesSample/android 72 UWP-Advanced-Inking/CurveALine UWP-Advanced-Inking/CurveALine UWP-Advanced-Inking/CurveALine--UWP-Advanced-Inking/XAMLShapesAdvancedManipulations 54 UWP-Advanced-Inking/CurveALine--UWP-Advanced-Inking/StrokesToShapes 54 UWP-Advanced-Inking/CurveALine--UWP-Advanced-Inking/InkingAndZoom 54 UWP-Advanced-Inking/CurveALine--UWP-Advanced-Inking/UnprocessedInput 54 UWP-Advanced-Inking/CurveALine--UWP-Advanced-Inking/XAMLShapesLineCurving 54 UWP-Advanced-Inking/CurveALine--UWP-Advanced-Inking/XAMLShapesManipulations 54

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 102 duplicates...
Size#FoldersFilesLinesCode
28 x 2 GeolocationSample/ios/GeolocationSampleTests
NativeModulesSample/ios/NativeModulesSampleTests
GeolocationSampleTests.m
NativeModulesSampleTests.m
16:65 (90%)
23:68 (90%)
view
27 x 2 GeolocationSample/windows/GeolocationSample
NativeModulesSample/windows/NativeModulesSample
vcxproj
GeolocationSample.vcxproj
NativeModulesSample.vcxproj
27:62 (17%)
23:58 (20%)
view
27 x 2 UWP-Advanced-Inking/XAML...esAdvancedManipulations
UWP-Advanced-Inking/XAML...g/XAMLShapesLineCurving
MainPage.xaml.cs
MainPage.xaml.cs
1:66 (20%)
1:78 (19%)
view
26 x 2 UWP-Advanced-Inking/Stro...oShapes/StrokesToShapes
UWP-Advanced-Inking/Unpr...dInput/UnprocessedInput
MainPage.xaml.cs
MainPage.xaml.cs
1:62 (100%)
1:68 (19%)
view
25 x 2 UWP-Advanced-Inking/XAML...g/XAMLShapesLineCurving
UWP-Advanced-Inking/XAML...XAMLShapesManipulations
MainPage.xaml.cs
MainPage.xaml.cs
1:73 (18%)
1:64 (50%)
view
25 x 2 UWP-Advanced-Inking/Stro...oShapes/StrokesToShapes
UWP-Advanced-Inking/XAML...esAdvancedManipulations
MainPage.xaml.cs
MainPage.xaml.cs
1:60 (96%)
1:61 (18%)
view
25 x 2 UWP-Advanced-Inking/Unpr...dInput/UnprocessedInput
UWP-Advanced-Inking/XAML...XAMLShapesManipulations
MainPage.xaml.cs
MainPage.xaml.cs
1:66 (19%)
1:64 (50%)
view
25 x 2 UWP-Advanced-Inking/XAML...esAdvancedManipulations
UWP-Advanced-Inking/XAML...XAMLShapesManipulations
MainPage.xaml.cs
MainPage.xaml.cs
1:61 (18%)
1:64 (50%)
view
25 x 2 UWP-Advanced-Inking/Stro...oShapes/StrokesToShapes
UWP-Advanced-Inking/XAML...g/XAMLShapesLineCurving
MainPage.xaml.cs
MainPage.xaml.cs
1:60 (96%)
1:73 (18%)
view
25 x 2 GeolocationSample/windows/GeolocationSample
NativeModulesSample/windows/NativeModulesSample
filters
GeolocationSample.vcxproj.filters
NativeModulesSample.vcxproj.filters
22:58 (56%)
20:56 (62%)
view
25 x 2 UWP-Advanced-Inking/Stro...oShapes/StrokesToShapes
UWP-Advanced-Inking/XAML...XAMLShapesManipulations
MainPage.xaml.cs
MainPage.xaml.cs
1:60 (96%)
1:64 (50%)
view
25 x 2 UWP-Advanced-Inking/Unpr...dInput/UnprocessedInput
UWP-Advanced-Inking/XAML...g/XAMLShapesLineCurving
MainPage.xaml.cs
MainPage.xaml.cs
1:66 (19%)
1:73 (18%)
view
25 x 2 UWP-Advanced-Inking/Unpr...dInput/UnprocessedInput
UWP-Advanced-Inking/XAML...esAdvancedManipulations
MainPage.xaml.cs
MainPage.xaml.cs
1:66 (19%)
1:61 (18%)
view
22 x 2 PlaneIdentifier/PlaneIdentifier.Desktop
PlaneIdentifier/PlaneIdentifier
Planes.cs
Planes.cs
11:42 (100%)
11:42 (100%)
view
21 x 2 UWP-Advanced-Inking/Stro...oShapes/StrokesToShapes
UWP-Advanced-Inking/XAML...XAMLShapesManipulations
App.xaml.cs
App.xaml.cs
1:97 (100%)
1:97 (100%)
view
21 x 2 UWP-Advanced-Inking/InkingAndZoom/InkingAndZoom
UWP-Advanced-Inking/XAML...esAdvancedManipulations
App.xaml.cs
App.xaml.cs
1:97 (100%)
1:97 (100%)
view
21 x 2 UWP-Advanced-Inking/Unpr...dInput/UnprocessedInput
UWP-Advanced-Inking/XAML...XAMLShapesManipulations
App.xaml.cs
App.xaml.cs
1:97 (100%)
1:97 (100%)
view
21 x 2 UWP-Advanced-Inking/InkingAndZoom/InkingAndZoom
UWP-Advanced-Inking/Unpr...dInput/UnprocessedInput
App.xaml.cs
App.xaml.cs
1:97 (100%)
1:97 (100%)
view
21 x 2 UWP-Advanced-Inking/Unpr...dInput/UnprocessedInput
UWP-Advanced-Inking/XAML...g/XAMLShapesLineCurving
App.xaml.cs
App.xaml.cs
1:97 (100%)
1:97 (100%)
view
21 x 2 PlaneIdentifier/PlaneIdentifier
UWP-Advanced-Inking/XAML...XAMLShapesManipulations
App.xaml.cs
App.xaml.cs
1:97 (100%)
1:97 (100%)
view
Duplicated Units
The list of top 8 duplicated units.
See data for all 8 unit duplicates...
Size#FoldersFilesLinesCode
27 x 2 PlaneIdentifier/PlaneIdentifier.Desktop
PlaneIdentifier/PlaneIdentifier
MainWindow.xaml.cs
MainPage.xaml.cs
67:97 
72:102 
view
20 x 8 PlaneIdentifier/PlaneIdentifier
UWP-Advanced-Inking/CurveALine/CurveALine
UWP-Advanced-Inking/InkingAndZoom/InkingAndZoom
UWP-Advanced-Inking/Stro...oShapes/StrokesToShapes
UWP-Advanced-Inking/Unpr...dInput/UnprocessedInput
UWP-Advanced-Inking/XAML...esAdvancedManipulations
UWP-Advanced-Inking/XAML...g/XAMLShapesLineCurving
UWP-Advanced-Inking/XAML...XAMLShapesManipulations
App.xaml.cs
App.xaml.cs
App.xaml.cs
App.xaml.cs
App.xaml.cs
App.xaml.cs
App.xaml.cs
App.xaml.cs
40:74 
40:74 
40:74 
40:74 
40:74 
40:74 
40:74 
40:74 
view
11 x 2 UWP-Advanced-Inking/XAML...esAdvancedManipulations
UWP-Advanced-Inking/XAML...g/XAMLShapesLineCurving
MainPage.xaml.cs
MainPage.xaml.cs
51:67 
63:79 
view
10 x 2 UWP-Advanced-Inking/Stro...oShapes/StrokesToShapes
UWP-Advanced-Inking/Unpr...dInput/UnprocessedInput
MainPage.xaml.cs
MainPage.xaml.cs
50:63 
56:69 
view
9 x 5 UWP-Advanced-Inking/Stro...oShapes/StrokesToShapes
UWP-Advanced-Inking/Unpr...dInput/UnprocessedInput
UWP-Advanced-Inking/XAML...esAdvancedManipulations
UWP-Advanced-Inking/XAML...g/XAMLShapesLineCurving
UWP-Advanced-Inking/XAML...XAMLShapesManipulations
MainPage.xaml.cs
MainPage.xaml.cs
MainPage.xaml.cs
MainPage.xaml.cs
MainPage.xaml.cs
34:48 
42:54 
35:49 
47:61 
38:52 
view
8 x 2 PlaneIdentifier/PlaneIdentifier.Desktop
PlaneIdentifier/PlaneIdentifier
Planes.cs
Planes.cs
35:43 
35:43 
view
8 x 5 UWP-Advanced-Inking/Stro...oShapes/StrokesToShapes
UWP-Advanced-Inking/Unpr...dInput/UnprocessedInput
UWP-Advanced-Inking/XAML...esAdvancedManipulations
UWP-Advanced-Inking/XAML...g/XAMLShapesLineCurving
UWP-Advanced-Inking/XAML...XAMLShapesManipulations
MainPage.xaml.cs
MainPage.xaml.cs
MainPage.xaml.cs
MainPage.xaml.cs
MainPage.xaml.cs
20:32 
28:40 
21:33 
33:45 
24:36 
view
7 x 2 PlaneIdentifier/PlaneIdentifier.Desktop
PlaneIdentifier/PlaneIdentifier
Planes.cs
Planes.cs
27:34 
27:34 
view