facebookresearch / ic_gan
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
  • 11% duplication:
    • 19,656 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,323 duplicated lines
  • 187 duplicates
system11% (2,323 lines)
Duplication per Extension
py12% (2,266 lines)
cu7% (34 lines)
m10% (23 lines)
Duplication per Component (primary)
BigGAN_PyTorch17% (1,153 lines)
data_utils14% (389 lines)
stylegan2_ada_pytorch11% (246 lines)
stylegan2_ada_pytorch/training6% (158 lines)
inference15% (135 lines)
BigGAN_PyTorch/TFHub13% (105 lines)
stylegan2_ada_pytorch/metrics9% (68 lines)
stylegan2_ada_pytorch/torch_utils2% (46 lines)
BigGAN_PyTorch/logs7% (23 lines)
ROOT0% (0 lines)
BigGAN_PyTorch/sync_batchnorm0% (0 lines)
stylegan2_ada_pytorch/dnnlib0% (0 lines)

Duplication Between Components (50+ lines)

G BigGAN_PyTorch BigGAN_PyTorch data_utils data_utils BigGAN_PyTorch--data_utils 432 inference inference BigGAN_PyTorch--inference 58

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 187 duplicates...
Size#FoldersFilesLinesCode
45 x 2 BigGAN_PyTorch
BigGAN_PyTorch
BigGAN.py
BigGANdeep.py
44:91 (8%)
89:136 (8%)
view
39 x 2 BigGAN_PyTorch
BigGAN_PyTorch
BigGAN.py
BigGANdeep.py
300:346 (7%)
322:368 (7%)
view
38 x 2 BigGAN_PyTorch
BigGAN_PyTorch
BigGAN.py
BigGANdeep.py
571:615 (7%)
627:671 (6%)
view
34 x 2 BigGAN_PyTorch
BigGAN_PyTorch
BigGAN.py
BigGANdeep.py
576:614 (6%)
328:367 (6%)
view
34 x 2 BigGAN_PyTorch
BigGAN_PyTorch
BigGANdeep.py
BigGANdeep.py
328:367 (6%)
632:670 (6%)
view
34 x 2 BigGAN_PyTorch
BigGAN_PyTorch
BigGAN.py
BigGAN.py
306:345 (6%)
576:614 (6%)
view
34 x 2 BigGAN_PyTorch
BigGAN_PyTorch
BigGAN.py
BigGANdeep.py
306:345 (6%)
632:670 (6%)
view
31 x 2 BigGAN_PyTorch
data_utils
make_hdf5.py
make_hdf5.py
139:169 (22%)
257:287 (10%)
view
31 x 2 BigGAN_PyTorch
BigGAN_PyTorch
BigGAN.py
BigGANdeep.py
470:512 (5%)
534:576 (5%)
view
28 x 2 data_utils
data_utils
make_hdf5.py
make_hdf5_nns.py
27:54 (9%)
23:50 (19%)
view
27 x 2 BigGAN_PyTorch
data_utils
make_hdf5.py
make_hdf5.py
60:88 (19%)
106:134 (9%)
view
27 x 2 BigGAN_PyTorch
BigGAN_PyTorch
BigGAN.py
BigGANdeep.py
92:118 (5%)
138:164 (4%)
view
24 x 2 BigGAN_PyTorch
BigGAN_PyTorch
BigGAN.py
BigGANdeep.py
183:209 (4%)
212:238 (4%)
view
21 x 2 BigGAN_PyTorch
BigGAN_PyTorch
BigGAN.py
BigGANdeep.py
266:295 (3%)
288:317 (3%)
view
20 x 2 inference
inference
sample.py
test.py
35:66 (19%)
35:66 (8%)
view
20 x 2 BigGAN_PyTorch
data_utils
make_hdf5.py
make_hdf5_nns.py
36:55 (14%)
31:50 (13%)
view
20 x 2 BigGAN_PyTorch
data_utils
make_hdf5.py
make_hdf5.py
36:55 (14%)
35:54 (7%)
view
19 x 2 data_utils
data_utils
make_hdf5.py
make_hdf5_nns.py
112:130 (6%)
49:67 (13%)
view
19 x 2 BigGAN_PyTorch
data_utils
make_hdf5.py
make_hdf5_nns.py
66:84 (13%)
49:67 (13%)
view
19 x 2 stylegan2_ada_pytorch
stylegan2_ada_pytorch
calc_metrics.py
train.py
37:57 (11%)
617:636 (3%)
view
Duplicated Units
The list of top 5 duplicated units.
See data for all 5 unit duplicates...
Size#FoldersFilesLinesCode
19 x 2 BigGAN_PyTorch
BigGAN_PyTorch
BigGANdeep.py
BigGAN.py
0:0 
0:0 
view
19 x 2 BigGAN_PyTorch
BigGAN_PyTorch
BigGANdeep.py
BigGAN.py
0:0 
0:0 
view
13 x 2 BigGAN_PyTorch/TFHub
BigGAN_PyTorch/TFHub
biggan_v1.py
biggan_v1.py
0:0 
0:0 
view
7 x 2 stylegan2_ada_pytorch
stylegan2_ada_pytorch
style_mixing.py
generate.py
0:0 
0:0 
view
7 x 2 data_utils
BigGAN_PyTorch
utils.py
utils.py
0:0 
0:0 
view