microsoft / OpenXR-MixedReality
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
  • 23% duplication:
    • 68,510 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 16,163 duplicated lines
  • 3,099 duplicates
system23% (16,163 lines)
Duplication per Extension
inl42% (7,930 lines)
h10% (3,937 lines)
cpp24% (2,035 lines)
vcxproj91% (1,919 lines)
filters68% (212 lines)
hpp32% (88 lines)
hlsl15% (42 lines)
Duplication per Component (primary)
shared/ext/DirectXMath41% (11,414 lines)
shared/ext7% (955 lines)
shared/ext/rapidjson9% (790 lines)
shared/pbr38% (704 lines)
shared/SampleShared47% (661 lines)
shared/gltf55% (514 lines)
shared/SampleShared/DirectXTK29% (474 lines)
shared/XrSceneLib14% (268 lines)
openxr_preview/include/openxr4% (193 lines)
shared/XrUtility8% (112 lines)
shared/pbr/Shaders15% (42 lines)
shared/ext/fmt<1% (36 lines)
ROOT0% (0 lines)

Duplication Between Components (50+ lines)

G shared/SampleShared shared/SampleShared shared/pbr shared/pbr shared/SampleShared--shared/pbr 1040 shared/gltf shared/gltf shared/SampleShared--shared/gltf 702 shared/XrSceneLib shared/XrSceneLib shared/SampleShared--shared/XrSceneLib 274 shared/gltf--shared/pbr 656 shared/XrSceneLib--shared/pbr 232 shared/XrSceneLib--shared/gltf 218

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 3,099 duplicates...
Size#FoldersFilesLinesCode
120 x 2 shared/ext/DirectXMath/Extensions
shared/ext/DirectXMath/Extensions
DirectXMathAVX2.h
DirectXMathF16C.h
823:1032 (18%)
257:466 (45%)
view
115 x 2 shared/ext/DirectXMath/Extensions
shared/ext/DirectXMath/Extensions
DirectXMathAVX2.h
DirectXMathF16C.h
641:819 (18%)
75:253 (43%)
view
97 x 2 shared/ext/DirectXMath/Extensions
shared/ext/DirectXMath/Inc
DirectXMathAVX2.h
DirectXPackedVector.inl
835:994 (15%)
461:620 (3%)
view
97 x 2 shared/ext/DirectXMath/Extensions
shared/ext/DirectXMath/Inc
DirectXMathF16C.h
DirectXPackedVector.inl
269:428 (37%)
461:620 (3%)
view
86 x 2 shared/ext/DirectXMath/SHMath
shared/ext/DirectXMath/SHMath
DirectXSHD3D11.cpp
DirectXSHD3D12.cpp
41:178 (39%)
38:175 (44%)
view
85 x 2 shared/SampleShared
shared/pbr
vcxproj
SampleShared_uwp.vcxproj
pbr_uwp.vcxproj
51:160 (25%)
50:159 (24%)
view
69 x 2 shared/SampleShared
shared/pbr
vcxproj
SampleShared_win32.vcxproj
pbr_win32.vcxproj
46:132 (22%)
45:131 (21%)
view
51 x 2 shared/ext/DirectXMath/SHMath
shared/ext/DirectXMath/SHMath
DirectXSHD3D11.cpp
DirectXSHD3D12.cpp
292:360 (23%)
252:320 (26%)
view
51 x 2 shared/ext/DirectXMath/Inc
shared/ext/DirectXMath/Inc
inl
DirectXMathVector.inl
DirectXMathVector.inl
11738:11809 (<1%)
11820:11891 (<1%)
view
51 x 2 shared/ext/DirectXMath/Inc
shared/ext/DirectXMath/Inc
inl
DirectXMathVector.inl
DirectXMathVector.inl
12305:12380 (<1%)
12391:12466 (<1%)
view
50 x 2 shared/ext/DirectXMath/Extensions
shared/ext/DirectXMath/Inc
DirectXMathAVX2.h
DirectXPackedVector.inl
741:811 (7%)
183:252 (1%)
view
50 x 2 shared/ext/DirectXMath/Extensions
shared/ext/DirectXMath/Inc
DirectXMathF16C.h
DirectXPackedVector.inl
175:245 (19%)
183:252 (1%)
view
47 x 2 shared/ext/DirectXMath/Inc
shared/ext/DirectXMath/Inc
inl
DirectXMathVector.inl
DirectXMathVector.inl
10772:10843 (<1%)
10854:10925 (<1%)
view
44 x 2 shared/ext/DirectXMath/Inc
shared/ext/DirectXMath/Inc
inl
DirectXMathVector.inl
DirectXMathVector.inl
3729:3786 (<1%)
3888:3945 (<1%)
view
43 x 2 shared/SampleShared/DirectXTK
shared/SampleShared/DirectXTK
DDSTextureLoader.cpp
DDSTextureLoader.cpp
1123:1197 (5%)
1257:1331 (5%)
view
42 x 2 shared/SampleShared
shared/SampleShared
vcxproj
SampleShared_uwp.vcxproj
SampleShared_win32.vcxproj
108:167 (12%)
103:162 (13%)
view
41 x 2 shared/ext/DirectXMath/Extensions
shared/ext/DirectXMath/Inc
DirectXMathAVX2.h
DirectXPackedVector.inl
675:738 (6%)
117:180 (1%)
view
41 x 2 shared/ext/DirectXMath/Extensions
shared/ext/DirectXMath/Inc
DirectXMathF16C.h
DirectXPackedVector.inl
109:172 (15%)
117:180 (1%)
view
39 x 2 shared/ext/DirectXMath/Inc
shared/ext/DirectXMath/Inc
inl
DirectXMathVector.inl
DirectXMathVector.inl
11246:11301 (<1%)
11312:11367 (<1%)
view
39 x 2 shared/ext/DirectXMath/Extensions
shared/ext/DirectXMath/Extensions
DirectXMathAVX.h
DirectXMathAVX2.h
138:202 (30%)
482:546 (6%)
view
Duplicated Units
The list of top 17 duplicated units.
See data for all 17 unit duplicates...
Size#FoldersFilesLinesCode
60 x 2 shared/ext/DirectXMath/SHMath
shared/ext/DirectXMath/SHMath
DirectXSHD3D11.cpp
DirectXSHD3D12.cpp
95:167 
92:164 
view
25 x 2 shared/ext
shared/ext
d3dx12.h
d3dx12.h
2313:2338 
2406:2431 
view
23 x 2 shared/ext/DirectXMath/Inc
shared/ext/DirectXMath/Inc
inl
DirectXCollision.inl
DirectXCollision.inl
3072:3104 
3109:3141 
view
14 x 2 shared/ext/DirectXMath/Extensions
shared/ext/DirectXMath/Extensions
DirectXMathAVX.h
DirectXMathAVX2.h
90:110 
120:140 
view
14 x 2 shared/ext/DirectXMath/Extensions
shared/ext/DirectXMath/Extensions
DirectXMathAVX.h
DirectXMathAVX2.h
143:160 
487:504 
view
12 x 2 shared/ext
shared/ext
d3dx12.h
d3dx12.h
2940:2952 
3007:3019 
view
10 x 2 shared/ext/fmt
shared/ext/fmt
format.h
format.h
768:781 
785:798 
view
10 x 2 shared/ext/fmt
shared/ext/fmt
format.h
format.h
785:798 
768:781 
view
9 x 2 shared/ext
shared/ext
d3dx12.h
d3dx12.h
2339:2348 
2432:2441 
view
7 x 2 shared/ext/DirectXMath/Extensions
shared/ext/DirectXMath/Extensions
DirectXMathAVX.h
DirectXMathAVX2.h
80:88 
110:118 
view
7 x 2 shared/ext/DirectXMath/Extensions
shared/ext/DirectXMath/Extensions
DirectXMathAVX.h
DirectXMathAVX2.h
232:240 
576:584 
view
7 x 2 shared/ext
shared/ext
d3dx12.h
d3dx12.h
1059:1066 
1433:1440 
view
6 x 2 shared/ext
shared/ext
d3dx12.h
d3dx12.h
2954:2960 
2961:2967 
view
6 x 2 shared/ext
shared/ext
d3dx12.h
d3dx12.h
2975:2981 
3103:3109 
view
6 x 2 shared/ext
shared/ext
d3dx12.h
d3dx12.h
3082:3088 
3089:3095 
view
6 x 2 shared/ext/rapidjson
shared/ext/rapidjson
document.h
document.h
2475:2481 
2483:2489 
view
6 x 2 shared/ext
shared/ext
tiny_gltf.h
tiny_gltf.h
469:476 
481:488 
view