microsoft / Win2D-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
  • 4% duplication:
    • 21,499 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 940 duplicated lines
  • 511 duplicates
system4% (940 lines)
Duplication per Extension
xaml29% (587 lines)
cs1% (353 lines)
Duplication per Component (primary)
ExampleGallery4% (903 lines)
ExampleGallery/Infrastructure3% (37 lines)
CompositionExample0% (0 lines)
CompositionExample/Properties0% (0 lines)
CoreWindowExample0% (0 lines)
CoreWindowExample/Properties0% (0 lines)
ExampleGallery/BackgroundTask0% (0 lines)
ExampleGallery/Direct3DInterop0% (0 lines)
ExampleGallery/Effects0% (0 lines)
ExampleGallery/Particles0% (0 lines)
ExampleGallery/Shaders0% (0 lines)
ExampleGallery/SpriteSheets0% (0 lines)
SimpleSample0% (0 lines)

Duplication Between Components (50+ lines)

G ExampleGallery/Infrastructure ExampleGallery/Infrastructure ExampleGallery ExampleGallery ExampleGallery/Infrastructure--ExampleGallery 70

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 511 duplicates...
Size#FoldersFilesLinesCode
32 x 2 ExampleGallery
ExampleGallery
SubscriptSuperscript.xaml.cs
TypographyExample.xaml.cs
283:331 (15%)
165:209 (13%)
view
31 x 2 ExampleGallery
ExampleGallery
FontMetrics.xaml.cs
SubscriptSuperscript.xaml.cs
134:175 (11%)
287:331 (14%)
view
31 x 2 ExampleGallery
ExampleGallery
FontMetrics.xaml.cs
TypographyExample.xaml.cs
134:175 (11%)
170:209 (13%)
view
17 x 2 ExampleGallery
ExampleGallery
FontMetrics.xaml.cs
SubscriptSuperscript.xaml.cs
420:457 (6%)
374:411 (7%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
BitmapRotation.xaml
StrokeStyles.xaml
10:29 (44%)
10:29 (32%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
StrokeStyles.xaml
TextOutlines.xaml
10:29 (32%)
10:29 (34%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
SubscriptSuperscript.xaml
TextOutlines.xaml
10:29 (43%)
10:29 (34%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
StrokeStyles.xaml
SubscriptSuperscript.xaml
10:29 (32%)
10:29 (43%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
GeometryOperations.xaml
TextOutlines.xaml
10:29 (30%)
10:29 (34%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
BitmapRotation.xaml
TextOutlines.xaml
10:29 (44%)
10:29 (34%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
FontMetrics.xaml
TextOutlines.xaml
10:29 (33%)
10:29 (34%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
GeometryOperations.xaml
SubscriptSuperscript.xaml
10:29 (30%)
10:29 (43%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
FontMetrics.xaml
StrokeStyles.xaml
10:29 (33%)
10:29 (32%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
GeometryOperations.xaml
StrokeStyles.xaml
10:29 (30%)
10:29 (32%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
BitmapRotation.xaml
GeometryOperations.xaml
10:29 (44%)
10:29 (30%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
FontMetrics.xaml
GeometryOperations.xaml
10:29 (33%)
10:29 (30%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
BitmapRotation.xaml
FontMetrics.xaml
10:29 (44%)
10:29 (33%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
FontMetrics.xaml
SubscriptSuperscript.xaml
10:29 (33%)
10:29 (43%)
view
17 x 2 ExampleGallery
ExampleGallery
xaml
BitmapRotation.xaml
SubscriptSuperscript.xaml
10:29 (44%)
10:29 (43%)
view
16 x 2 ExampleGallery
ExampleGallery
xaml
CustomTextLayouts.xaml
TextLayouts.xaml
10:26 (29%)
10:26 (36%)
view
Duplicated Units
The list of top 5 duplicated units.
See data for all 5 unit duplicates...
Size#FoldersFilesLinesCode
12 x 3 ExampleGallery
ExampleGallery
ExampleGallery
FontMetrics.xaml.cs
SubscriptSuperscript.xaml.cs
TypographyExample.xaml.cs
147:159 
301:314 
183:195 
view
11 x 3 ExampleGallery
ExampleGallery
ExampleGallery
FontMetrics.xaml.cs
SubscriptSuperscript.xaml.cs
TypographyExample.xaml.cs
134:145 
287:299 
170:181 
view
8 x 5 ExampleGallery
ExampleGallery
ExampleGallery
ExampleGallery
ExampleGallery
FontMetrics.xaml.cs
GlyphRotation.xaml.cs
SubscriptSuperscript.xaml.cs
TextOutlines.xaml.cs
TypographyExample.xaml.cs
161:169 
189:198 
316:325 
186:194 
197:205 
view
7 x 2 ExampleGallery
ExampleGallery
FontMetrics.xaml.cs
SubscriptSuperscript.xaml.cs
430:438 
384:392 
view
7 x 2 ExampleGallery
ExampleGallery
GlowTextCustomControl.cs
TextDirectionControl.cs
105:113 
54:62 
view