microsoft / DirectXTK
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
  • 34% duplication:
    • 37,390 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 12,807 duplicated lines
  • 2,740 duplicates
system34% (12,807 lines)
Duplication per Extension
vcxproj87% (4,532 lines)
cpp19% (3,551 lines)
filters97% (2,507 lines)
fx40% (909 lines)
h12% (657 lines)
hlsl87% (379 lines)
inl10% (228 lines)
fxh7% (44 lines)
Duplication per Component (primary)
ROOT92% (5,434 lines)
Src21% (3,097 lines)
Audio29% (1,570 lines)
Src/Shaders36% (1,332 lines)
Inc13% (751 lines)
XWBTool37% (623 lines)
MakeSpriteFont0% (0 lines)
MakeSpriteFont/Properties0% (0 lines)

Duplication Between Components (50+ lines)

G Audio Audio ROOT ROOT Audio--ROOT 672 XWBTool XWBTool Audio--XWBTool 435 ROOT--XWBTool 216 Inc Inc Src Src Inc--Src 91

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 2,740 duplicates...
Size#FoldersFilesLinesCode
239 x 2 ROOT
ROOT
filters
DirectXTK_Desktop_2017_Win10.vcxproj....
DirectXTK_Desktop_2022_Win10.vcxproj....
1:357 (100%)
1:357 (100%)
view
239 x 2 ROOT
ROOT
filters
DirectXTK_Windows10_2017.vcxproj.filters
DirectXTK_Windows10_2019.vcxproj.filters
1:357 (100%)
1:357 (100%)
view
239 x 2 ROOT
ROOT
filters
DirectXTK_Windows10_2019.vcxproj.filters
DirectXTK_Windows10_2022.vcxproj.filters
1:357 (100%)
1:357 (100%)
view
239 x 2 ROOT
ROOT
filters
DirectXTK_Windows10_2017.vcxproj.filters
DirectXTK_Windows10_2022.vcxproj.filters
1:357 (100%)
1:357 (100%)
view
239 x 2 ROOT
ROOT
filters
DirectXTK_Desktop_2019_Win10.vcxproj....
DirectXTK_Desktop_2022_Win10.vcxproj....
1:357 (100%)
1:357 (100%)
view
239 x 2 ROOT
ROOT
filters
DirectXTK_Desktop_2017_Win10.vcxproj....
DirectXTK_Desktop_2019_Win10.vcxproj....
1:357 (100%)
1:357 (100%)
view
211 x 2 ROOT
ROOT
filters
DirectXTK_Desktop_2017.vcxproj.filters
DirectXTK_Desktop_2022.vcxproj.filters
1:315 (100%)
1:315 (100%)
view
211 x 2 ROOT
ROOT
filters
DirectXTK_Desktop_2017.vcxproj.filters
DirectXTK_Desktop_2019.vcxproj.filters
1:315 (100%)
1:315 (100%)
view
211 x 2 ROOT
ROOT
filters
DirectXTK_Desktop_2019.vcxproj.filters
DirectXTK_Desktop_2022.vcxproj.filters
1:315 (100%)
1:315 (100%)
view
178 x 2 ROOT
ROOT
vcxproj
DirectXTK_Windows10_2019.vcxproj
DirectXTK_Windows10_2022.vcxproj
2:213 (39%)
2:213 (39%)
view
178 x 2 ROOT
ROOT
vcxproj
DirectXTK_Windows10_2017.vcxproj
DirectXTK_Windows10_2019.vcxproj
1:212 (40%)
1:212 (39%)
view
177 x 2 ROOT
ROOT
vcxproj
DirectXTK_Windows10_2017.vcxproj
DirectXTK_Windows10_2022.vcxproj
2:212 (40%)
2:212 (39%)
view
172 x 2 ROOT
ROOT
vcxproj
DirectXTK_Windows10_2019.vcxproj
DirectXTK_Windows10_2022.vcxproj
335:538 (38%)
335:538 (38%)
view
170 x 2 ROOT
ROOT
vcxproj
DirectXTK_Desktop_2019_Win10.vcxproj
DirectXTK_Desktop_2022_Win10.vcxproj
1:202 (46%)
1:202 (46%)
view
164 x 2 ROOT
ROOT
vcxproj
DirectXTK_Desktop_2017_Win10.vcxproj
DirectXTK_Desktop_2019_Win10.vcxproj
1:195 (45%)
1:195 (44%)
view
164 x 2 ROOT
ROOT
vcxproj
DirectXTK_Desktop_2017_Win10.vcxproj
DirectXTK_Desktop_2022_Win10.vcxproj
1:195 (45%)
1:195 (44%)
view
148 x 2 ROOT
ROOT
vcxproj
DirectXTK_Desktop_2019.vcxproj
DirectXTK_Desktop_2022.vcxproj
2:179 (51%)
2:179 (51%)
view
143 x 2 ROOT
ROOT
vcxproj
DirectXTK_Desktop_2017.vcxproj
DirectXTK_Desktop_2019.vcxproj
1:172 (50%)
1:172 (49%)
view
142 x 2 ROOT
ROOT
vcxproj
DirectXTK_Desktop_2017.vcxproj
DirectXTK_Desktop_2022.vcxproj
2:172 (50%)
2:172 (49%)
view
133 x 2 ROOT
ROOT
vcxproj
DirectXTK_Desktop_2019_Win10.vcxproj
DirectXTK_Desktop_2022_Win10.vcxproj
286:442 (36%)
286:442 (36%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 21 unit duplicates...
Size#FoldersFilesLinesCode
81 x 2 Src
Src
DGSLEffectFactory.cpp
EffectFactory.cpp
372:461 
370:459 
view
70 x 2 Src
Src
DDSTextureLoader.cpp
WICTextureLoader.cpp
851:923 
734:806 
view
21 x 2 Src
Src
LoaderHelpers.h
XboxDDSTextureLoader.cpp
194:222 
178:206 
view
18 x 2 Inc
Inc
Audio.h
Audio.h
489:513 
583:607 
view
17 x 3 Src
Src
Src
DGSLEffectFactory.cpp
EffectFactory.cpp
PBREffectFactory.cpp
593:611 
521:539 
344:362 
view
17 x 2 Src
Src
Keyboard.cpp
Mouse.cpp
161:179 
239:257 
view
17 x 2 Src
Src
NormalMapEffect.cpp
PBREffect.cpp
706:728 
697:719 
view
14 x 2 Src
Src
ModelLoadCMO.cpp
ModelLoadSDKMESH.cpp
239:254 
42:57 
view
14 x 2 Src
Src
Mouse.cpp
Mouse.cpp
200:216 
546:562 
view
11 x 2 Src
Src
GamePad.cpp
GamePad.cpp
762:774 
776:788 
view
10 x 2 Src
Src
NormalMapEffect.cpp
PBREffect.cpp
731:743 
722:734 
view
9 x 4 Src
Src
Src
Src
DGSLEffect.cpp
NormalMapEffect.cpp
PBREffect.cpp
SkinnedEffect.cpp
894:904 
693:703 
684:694 
583:593 
view
8 x 2 Src
Src
Mouse.cpp
Mouse.cpp
188:198 
534:544 
view
7 x 2 Src
Src
NormalMapEffect.cpp
PBREffect.cpp
677:685 
647:655 
view
6 x 2 Audio
Audio
SoundEffect.cpp
WaveBank.cpp
485:492 
411:418 
view
6 x 2 Inc
Inc
Audio.h
Audio.h
480:487 
574:581 
view
6 x 6 Src
Src
Src
Src
Src
Src
AlphaTestEffect.cpp
BasicEffect.cpp
DualTextureEffect.cpp
EnvironmentMapEffect.cpp
NormalMapEffect.cpp
SkinnedEffect.cpp
331:338 
527:534 
234:241 
511:518 
474:481 
411:418 
view
6 x 2 Src
Src
BasicPostProcess.cpp
DualPostProcess.cpp
112:120 
88:96 
view
6 x 3 Src
Src
Src
BasicPostProcess.cpp
DualPostProcess.cpp
ToneMapPostProcess.cpp
129:137 
105:113 
219:227 
view
6 x 4 Src
Src
Src
Src
EnvironmentMapEffect.cpp
NormalMapEffect.cpp
PBREffect.cpp
SkinnedEffect.cpp
556:562 
548:554 
492:498 
485:491 
view