tensorflow / quantum
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:
    • 9,736 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 3,395 duplicated lines
  • 499 duplicates
system34% (3,395 lines)
Duplication per Extension
cc50% (2,328 lines)
py22% (990 lines)
h17% (77 lines)
Duplication per Component (primary)
tensorflow_quantum/core/ops48% (2,080 lines)
tensorflow_quantum/python/layers57% (408 lines)
tensorflow_quantum/core/src26% (393 lines)
tensorflow_quantum/core/serialize18% (209 lines)
tensorflow_quantum/datasets44% (139 lines)
tensorflow_quantum/python/optimizers33% (74 lines)
benchmarks/scripts18% (66 lines)
tensorflow_quantum/python/differentiators6% (26 lines)
scripts0% (0 lines)
tensorflow_quantum/core0% (0 lines)
tensorflow_quantum/core/proto0% (0 lines)
tensorflow_quantum/python0% (0 lines)
tensorflow_quantum0% (0 lines)
release0% (0 lines)
benchmarks/scripts/models0% (0 lines)
benchmarks0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 499 duplicates...
Size#FoldersFilesLinesCode
79 x 2 tensorflow_quantum/core/ops/noise
tensorflow_quantum/core/ops/noise
tfq_noisy_expectation.cc
tfq_noisy_sampled_expectation.cc
59:176 (30%)
60:177 (30%)
view
47 x 2 tensorflow_quantum/python/layers/high_level
tensorflow_quantum/python/layers/high_level
noisy_controlled_pqc.py
noisy_pqc.py
179:238 (61%)
187:244 (47%)
view
40 x 2 tensorflow_quantum/core/ops/noise
tensorflow_quantum/core/ops
tfq_noisy_sampled_expectation.cc
tfq_simulate_sampled_expectation_op.cc
59:109 (15%)
51:101 (19%)
view
39 x 2 tensorflow_quantum/core/ops/noise
tensorflow_quantum/core/ops
tfq_noisy_expectation.cc
tfq_simulate_sampled_expectation_op.cc
59:108 (15%)
52:101 (18%)
view
35 x 2 tensorflow_quantum/core/ops
tensorflow_quantum/core/ops
tfq_calculate_unitary_op.cc
tfq_simulate_state_op.cc
49:99 (34%)
50:98 (25%)
view
33 x 2 tensorflow_quantum/python/layers/high_level
tensorflow_quantum/python/layers/high_level
noisy_pqc.py
pqc.py
141:207 (33%)
140:211 (28%)
view
33 x 2 tensorflow_quantum/core/ops/noise
tensorflow_quantum/core/ops/noise
tfq_noisy_expectation.cc
tfq_noisy_sampled_expectation.cc
231:281 (12%)
235:285 (12%)
view
33 x 2 tensorflow_quantum/python/layers/high_level
tensorflow_quantum/python/layers/high_level
controlled_pqc.py
pqc.py
171:214 (34%)
191:229 (28%)
view
32 x 2 tensorflow_quantum/core/ops/math_ops
tensorflow_quantum/core/ops/math_ops
tfq_inner_product.cc
tfq_inner_product_grad.cc
99:138 (16%)
127:166 (10%)
view
30 x 2 tensorflow_quantum/datasets
tensorflow_quantum/datasets
spin_system.py
spin_system.py
265:300 (10%)
502:536 (10%)
view
30 x 2 tensorflow_quantum/core/ops/math_ops
tensorflow_quantum/core/ops
tfq_simulate_1d_sampled_expectation.cc
tfq_simulate_sampled_expectation_op.cc
86:122 (16%)
78:114 (14%)
view
29 x 2 tensorflow_quantum/python/layers/high_level
tensorflow_quantum/python/layers/high_level
controlled_pqc.py
noisy_controlled_pqc.py
131:193 (29%)
144:201 (38%)
view
26 x 2 tensorflow_quantum/core/ops/math_ops
tensorflow_quantum/core/ops/math_ops
tfq_simulate_1d_sampled_expectation.cc
tfq_simulate_1d_samples.cc
112:147 (14%)
84:119 (19%)
view
25 x 2 tensorflow_quantum/core/ops/noise
tensorflow_quantum/core/ops/noise
tfq_noisy_expectation.cc
tfq_noisy_sampled_expectation.cc
350:388 (9%)
356:394 (9%)
view
25 x 2 tensorflow_quantum/core/ops/noise
tensorflow_quantum/core/ops/noise
tfq_noisy_expectation.cc
tfq_noisy_sampled_expectation.cc
313:347 (9%)
319:353 (9%)
view
24 x 2 tensorflow_quantum/core/ops/noise
tensorflow_quantum/core/ops
tfq_noisy_expectation.cc
tfq_simulate_sampled_expectation_op.cc
393:422 (9%)
308:337 (11%)
view
24 x 2 tensorflow_quantum/python/layers/high_level
tensorflow_quantum/python/layers/high_level
noisy_pqc.py
pqc.py
244:289 (24%)
256:301 (20%)
view
24 x 2 tensorflow_quantum/core/ops/noise
tensorflow_quantum/core/ops/noise
tfq_noisy_expectation.cc
tfq_noisy_sampled_expectation.cc
393:422 (9%)
399:428 (9%)
view
24 x 2 tensorflow_quantum/core/ops/noise
tensorflow_quantum/core/ops
tfq_noisy_sampled_expectation.cc
tfq_simulate_sampled_expectation_op.cc
399:428 (9%)
308:337 (11%)
view
23 x 2 tensorflow_quantum/python/layers/circuit_executors
tensorflow_quantum/python/layers/circuit_executors
expectation.py
sampled_expectation.py
310:349 (27%)
300:339 (34%)
view
Duplicated Units
The list of top 4 duplicated units.
See data for all 4 unit duplicates...
Size#FoldersFilesLinesCode
64 x 2 tensorflow_quantum/core/ops/noise
tensorflow_quantum/core/ops/noise
tfq_noisy_expectation.cc
tfq_noisy_sampled_expectation.cc
61:152 
62:153 
view
10 x 2 tensorflow_quantum/python/optimizers
tensorflow_quantum/python/optimizers
spsa_minimizer.py
rotosolve_minimizer.py
0:0 
0:0 
view
6 x 2 tensorflow_quantum/python/layers/high_level
tensorflow_quantum/python/layers/high_level
noisy_pqc.py
pqc.py
0:0 
0:0 
view
8 x 2 tensorflow_quantum/python/optimizers
tensorflow_quantum/python/optimizers
spsa_minimizer.py
rotosolve_minimizer.py
0:0 
0:0 
view