microsoft / DirectML
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
  • 9% duplication:
    • 21,101 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,011 duplicated lines
  • 128 duplicates
system9% (2,011 lines)
Duplication per Extension
py9% (780 lines)
h12% (734 lines)
cpp6% (419 lines)
yaml51% (78 lines)
Duplication per Component (primary)
Python/src15% (573 lines)
TensorFlow/squeezenet14% (382 lines)
DxDispatch/src6% (362 lines)
Libraries9% (218 lines)
PyTorch/yolov33% (132 lines)
TensorFlow/VisionTransformer41% (128 lines)
TensorFlow/yolov310% (122 lines)
PyTorch/resnet5078% (32 lines)
PyTorch/squeezenet78% (32 lines)
PyTorch/torchvision_classification31% (22 lines)
PyTorch/classification4% (8 lines)
DxDispatch/cmake0% (0 lines)
DxDispatch/models0% (0 lines)
DxDispatch/tools0% (0 lines)
PyTorch/data0% (0 lines)
Python0% (0 lines)
ROOT0% (0 lines)

Duplication Between Components (50+ lines)

G PyTorch/resnet50 PyTorch/resnet50 PyTorch/squeezenet PyTorch/squeezenet PyTorch/resnet50--PyTorch/squeezenet 64

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 128 duplicates...
Size#FoldersFilesLinesCode
54 x 2 TensorFlow/VisionTransformer
TensorFlow/VisionTransformer
train_cifar10.py
train_cifar100.py
33:101 (76%)
33:101 (76%)
view
44 x 2 TensorFlow/squeezenet/src
TensorFlow/squeezenet/sr.../research/slim/datasets
generate_cifar_tfrecords.py
download_and_convert_cifar10.py
74:162 (44%)
64:152 (50%)
view
33 x 2 Python/src
Python/src
d3dx12.h
d3dx12.h
2333:2369 (1%)
2426:2462 (1%)
view
24 x 2 TensorFlow/squeezenet/src
TensorFlow/squeezenet/sr.../research/slim/datasets
generate_cifar_tfrecords.py
download_and_convert_cifar10.py
174:207 (24%)
165:198 (27%)
view
22 x 2 PyTorch/yolov3/models
PyTorch/yolov3/models
yolov3-spp.yaml
yolov3.yaml
2:30 (55%)
2:30 (55%)
view
21 x 2 Python/src
Python/src
device.cpp
device.cpp
233:265 (5%)
470:502 (5%)
view
21 x 2 Python/src
Python/src
d3dx12.h
d3dx12.h
2311:2331 (<1%)
2405:2425 (<1%)
view
20 x 2 Python/src
Python/src
d3dx12.h
d3dx12.h
2280:2299 (<1%)
2377:2396 (<1%)
view
19 x 2 Python/src
Python/src
d3dx12.h
d3dx12.h
2961:2989 (<1%)
3028:3056 (<1%)
view
17 x 2 Libraries
Libraries
DirectMLX.h
DirectMLX.h
1554:1572 (<1%)
1573:1591 (<1%)
view
17 x 2 PyTorch/yolov3/models
PyTorch/yolov3/models
yolov3-spp.yaml
yolov3.yaml
32:51 (42%)
32:51 (42%)
view
16 x 2 DxDispatch/src/dxdispatch
DxDispatch/src/model
Device.cpp
JsonParsers.cpp
315:334 (7%)
8:27 (2%)
view
16 x 2 TensorFlow/squeezenet/src
TensorFlow/squeezenet/sr.../research/slim/datasets
generate_cifar_tfrecords.py
download_and_convert_cifar10.py
15:62 (16%)
15:61 (18%)
view
15 x 2 TensorFlow/squeezenet/sr.../research/slim/datasets
TensorFlow/squeezenet/sr.../research/slim/datasets
cifar10.py
flowers.py
82:99 (38%)
82:99 (38%)
view
15 x 2 PyTorch/resnet50
PyTorch/squeezenet
train.py
train.py
10:30 (83%)
10:30 (83%)
view
15 x 2 DxDispatch/src/model
Python/src
BucketAllocator.h
typeconvert.h
93:120 (24%)
67:94 (12%)
view
15 x 2 Libraries
Libraries
DirectMLX.h
DirectMLX.h
2841:2856 (<1%)
2943:2958 (<1%)
view
14 x 2 TensorFlow/yolov3
TensorFlow/yolov3
detect.py
detect_video.py
27:45 (15%)
29:47 (13%)
view
14 x 2 Python/src
Python/src
d3dx12.h
d3dx12.h
1109:1123 (<1%)
1170:1184 (<1%)
view
14 x 2 Python/src
Python/src
d3dx12.h
d3dx12.h
210:223 (<1%)
283:296 (<1%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 26 unit duplicates...
Size#FoldersFilesLinesCode
25 x 2 Python/src
Python/src
d3dx12.h
d3dx12.h
2333:2358 
2426:2451 
view
33 x 2 TensorFlow/squeezenet/src
TensorFlow/squeezenet/sr.../research/slim/datasets
generate_cifar_tfrecords.py
download_and_convert_cifar10.py
0:0 
0:0 
view
13 x 2 DxDispatch/src/model
DxDispatch/src/model
JsonParsersGenerated.cpp
JsonParsersGenerated.cpp
3283:3296 
3817:3830 
view
12 x 2 DxDispatch/src/model
DxDispatch/src/model
JsonParsersGenerated.cpp
JsonParsersGenerated.cpp
2118:2130 
2151:2163 
view
12 x 2 DxDispatch/src/model
DxDispatch/src/model
JsonParsersGenerated.cpp
JsonParsersGenerated.cpp
2289:2301 
2369:2381 
view
12 x 2 Python/src
Python/src
d3dx12.h
d3dx12.h
2961:2973 
3028:3040 
view
16 x 2 TensorFlow/squeezenet/src
TensorFlow/squeezenet/sr.../research/slim/datasets
generate_cifar_tfrecords.py
download_and_convert_cifar10.py
0:0 
0:0 
view
9 x 3 DxDispatch/src/model
Python/src
Python/src
BucketAllocator.h
typeconvert.h
util.h
94:105 
68:79 
201:212 
view
9 x 2 DxDispatch/src/model
DxDispatch/src/model
JsonParsersGenerated.cpp
JsonParsersGenerated.cpp
3253:3262 
3319:3328 
view
9 x 2 Python/src
Python/src
d3dx12.h
d3dx12.h
2359:2368 
2452:2461 
view
8 x 2 DxDispatch/src/model
DxDispatch/src/model
JsonParsersGenerated.cpp
JsonParsersGenerated.cpp
1478:1486 
1502:1510 
view
8 x 2 DxDispatch/src/model
DxDispatch/src/model
JsonParsersGenerated.cpp
JsonParsersGenerated.cpp
1536:1544 
1565:1573 
view
8 x 2 DxDispatch/src/model
DxDispatch/src/model
JsonParsersGenerated.cpp
JsonParsersGenerated.cpp
2183:2191 
3203:3211 
view
8 x 2 TensorFlow/VisionTransformer
TensorFlow/VisionTransformer
train_cifar10.py
train_cifar100.py
0:0 
0:0 
view
7 x 2 DxDispatch/src/model
DxDispatch/src/model
JsonParsers.cpp
JsonParsers.cpp
401:408 
421:428 
view
7 x 2 DxDispatch/src/model
DxDispatch/src/model
JsonParsers.cpp
JsonParsers.cpp
493:500 
513:520 
view
7 x 2 DxDispatch/src/model
DxDispatch/src/model
JsonParsersGenerated.cpp
JsonParsersGenerated.cpp
689:696 
823:830 
view
7 x 2 DxDispatch/src/model
DxDispatch/src/model
JsonParsersGenerated.cpp
JsonParsersGenerated.cpp
1739:1746 
3082:3089 
view
7 x 2 DxDispatch/src/model
DxDispatch/src/model
JsonParsersGenerated.cpp
JsonParsersGenerated.cpp
2059:2066 
3131:3138 
view
7 x 2 Python/src
Python/src
d3dx12.h
d3dx12.h
1067:1074 
1441:1448 
view