apple / learning-compressible-subspaces
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
  • 24% duplication:
    • 4,111 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 996 duplicated lines
  • 97 duplicates
system24% (996 lines)
Duplication per Extension
py22% (863 lines)
yaml47% (133 lines)
Duplication per Component (primary)
ROOT23% (430 lines)
models20% (233 lines)
models/networks23% (200 lines)
configs/structured_sparsity65% (90 lines)
configs/unstructured_sparsity39% (27 lines)
configs/quantized21% (16 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 97 duplicates...
Size#FoldersFilesLinesCode
24 x 2 ROOT
ROOT
train_curve.py
train_indep.py
322:355 (7%)
347:380 (6%)
view
18 x 2 ROOT
ROOT
train_curve.py
train_indep.py
378:401 (5%)
403:426 (5%)
view
17 x 2 configs/structured_sparsity
configs/structured_sparsity
ns.yaml
us.yaml
7:23 (56%)
7:23 (58%)
view
17 x 2 ROOT
ROOT
train_curve.py
train_indep.py
412:430 (5%)
441:459 (4%)
view
16 x 2 ROOT
ROOT
train_curve.py
train_indep.py
264:285 (5%)
247:267 (4%)
view
15 x 2 ROOT
ROOT
train_curve.py
train_indep.py
291:307 (4%)
314:330 (4%)
view
13 x 2 configs/structured_sparsity
configs/structured_sparsity
lcs_p.yaml
us.yaml
5:17 (44%)
5:17 (44%)
view
13 x 2 configs/unstructured_sparsity
configs/unstructured_sparsity
lcs_p.yaml
target_topk.yaml
5:17 (56%)
5:17 (59%)
view
13 x 2 configs/structured_sparsity
configs/structured_sparsity
lcs_p.yaml
us.yaml
21:34 (44%)
21:34 (44%)
view
12 x 2 ROOT
ROOT
train_curve.py
train_indep.py
358:372 (3%)
383:397 (3%)
view
12 x 2 models/networks
models/networks
model_profiling.py
model_profiling.py
81:92 (6%)
94:105 (6%)
view
12 x 2 models
models
quantize_affine.py
quantize_affine.py
120:132 (5%)
141:153 (5%)
view
12 x 2 ROOT
ROOT
model_logging.py
model_logging.py
65:78 (8%)
133:146 (8%)
view
11 x 2 configs/structured_sparsity
configs/structured_sparsity
lcs_p.yaml
ns.yaml
7:17 (37%)
7:17 (36%)
view
10 x 2 models
models
builder.py
builder.py
125:135 (5%)
149:159 (5%)
view
10 x 2 ROOT
ROOT
train_curve.py
train_indep.py
164:175 (3%)
179:189 (2%)
view
10 x 2 ROOT
ROOT
model_logging.py
model_logging.py
52:61 (7%)
82:91 (7%)
view
10 x 2 models
models
quantized_modules.py
quantized_modules.py
43:53 (3%)
71:80 (3%)
view
10 x 2 ROOT
ROOT
model_logging.py
model_logging.py
52:61 (7%)
150:159 (7%)
view
10 x 2 ROOT
ROOT
model_logging.py
model_logging.py
52:61 (7%)
120:129 (7%)
view
Duplicated Units
The list of top 4 duplicated units.
See data for all 4 unit duplicates...
Size#FoldersFilesLinesCode
8 x 2 ROOT
ROOT
model_logging.py
model_logging.py
0:0 
0:0 
view
8 x 2 models
models
builder.py
builder.py
0:0 
0:0 
view
8 x 2 ROOT
ROOT
train_indep.py
train_indep.py
0:0 
0:0 
view
7 x 2 models/networks
models/networks
resnet.py
resnet.py
0:0 
0:0 
view