facebookresearch / pytorchvideo
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
  • 20% duplication:
    • 14,614 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,948 duplicated lines
  • 315 duplicates
system20% (2,948 lines)
Duplication per Extension
py18% (2,479 lines)
yaml52% (469 lines)
Duplication per Component (primary)
pytorchvideo/models28% (1,049 lines)
pytorchvideo_trainer/pytorchvideo_trainer27% (859 lines)
pytorchvideo/data18% (495 lines)
pytorchvideo/layers16% (296 lines)
tutorials/video_detection_example19% (78 lines)
pytorchvideo/transforms6% (74 lines)
pytorchvideo/accelerator22% (63 lines)
ROOT18% (17 lines)
pytorchvideo_trainer51% (17 lines)
projects/video_nerf0% (0 lines)
website/website0% (0 lines)
tutorials/video_classification_example0% (0 lines)
pytorchvideo/neural_engine0% (0 lines)
pytorchvideo0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 315 duplicates...
Size#FoldersFilesLinesCode
47 x 2 pytorchvideo_trainer/pyt...f/datamodule/transforms
pytorchvideo_trainer/pyt...f/datamodule/transforms
kinetics_contrastive.yaml
kinetics_moco_v2.yaml
10:56 (83%)
10:56 (83%)
view
37 x 2 pytorchvideo_trainer/pyt...f/datamodule/transforms
pytorchvideo_trainer/pyt...f/datamodule/transforms
kinetics_classification_slow.yaml
kinetics_contrastive.yaml
15:51 (72%)
20:56 (66%)
view
37 x 2 pytorchvideo_trainer/pyt...f/datamodule/transforms
pytorchvideo_trainer/pyt...f/datamodule/transforms
kinetics_classification_slow.yaml
kinetics_moco_v2.yaml
15:51 (72%)
20:56 (66%)
view
31 x 2 pytorchvideo_trainer/pytorchvideo_trainer/conf
pytorchvideo_trainer/pytorchvideo_trainer/conf
classification_slow_8x8_r50.yaml
classification_slowfast_8x8_r50.yaml
11:46 (77%)
11:46 (77%)
view
27 x 2 tutorials/video_detection_example
tutorials/video_detection_example
visualization.py
visualization.py
193:239 (6%)
247:292 (6%)
view
24 x 2 pytorchvideo/models
pytorchvideo/models
resnet.py
resnet.py
614:638 (3%)
853:877 (3%)
view
23 x 2 pytorchvideo/models
pytorchvideo/models
slowfast.py
slowfast.py
45:71 (5%)
383:409 (5%)
view
23 x 2 pytorchvideo/data
pytorchvideo/data
encoded_video_pyav.py
encoded_video_torchvision.py
83:116 (11%)
54:87 (12%)
view
23 x 2 pytorchvideo/models
pytorchvideo/models
resnet.py
resnet.py
30:111 (3%)
165:250 (3%)
view
22 x 2 pytorchvideo/models
pytorchvideo/models
head.py
head.py
51:123 (10%)
221:313 (10%)
view
22 x 2 pytorchvideo_trainer/pytorchvideo_trainer/module
pytorchvideo_trainer/pytorchvideo_trainer/module
byol.py
moco_v2.py
35:75 (11%)
85:124 (7%)
view
21 x 2 pytorchvideo_trainer/pytorchvideo_trainer/module
pytorchvideo_trainer/pytorchvideo_trainer/module
byol.py
ssl_helper.py
235:255 (10%)
349:369 (8%)
view
20 x 2 pytorchvideo/data
pytorchvideo/data
encoded_video_pyav.py
encoded_video_torchvision.py
173:193 (9%)
143:163 (11%)
view
20 x 2 pytorchvideo/models
pytorchvideo/models
stem.py
stem.py
87:107 (13%)
192:212 (13%)
view
20 x 2 pytorchvideo/data
pytorchvideo/data
encoded_video_pyav.py
encoded_video_torchvision.py
150:171 (9%)
121:141 (11%)
view
19 x 2 pytorchvideo_trainer/pytorchvideo_trainer/module
pytorchvideo_trainer/pytorchvideo_trainer/module
byol.py
moco_v2.py
241:259 (9%)
225:243 (6%)
view
19 x 2 pytorchvideo_trainer/pytorchvideo_trainer/module
pytorchvideo_trainer/pytorchvideo_trainer/module
byol.py
moco_v2.py
80:110 (9%)
126:156 (6%)
view
18 x 2 pytorchvideo/models
pytorchvideo/models
slowfast.py
slowfast.py
23:43 (4%)
361:381 (4%)
view
18 x 2 pytorchvideo/models
pytorchvideo/models
csn.py
r2plus1d.py
171:191 (20%)
293:313 (11%)
view
17 x 2 pytorchvideo/models
pytorchvideo/models
resnet.py
x3d.py
131:148 (2%)
211:228 (4%)
view
Duplicated Units
The list of top 4 duplicated units.
See data for all 4 unit duplicates...
Size#FoldersFilesLinesCode
9 x 2 tutorials/video_detection_example
tutorials/video_detection_example
visualization.py
visualization.py
0:0 
0:0 
view
9 x 2 pytorchvideo/layers/accelerator/mobile_cpu
pytorchvideo/layers/accelerator/mobile_cpu
convolutions.py
convolutions.py
0:0 
0:0 
view
7 x 4 pytorchvideo/data
pytorchvideo/data
pytorchvideo/data
pytorchvideo/data
labeled_video_dataset.py
json_dataset.py
ucf101.py
kinetics.py
0:0 
0:0 
0:0 
0:0 
view
10 x 2 pytorchvideo_trainer/pytorchvideo_trainer/module
pytorchvideo_trainer/pytorchvideo_trainer/module
moco_v2.py
byol.py
0:0 
0:0 
view