facebookresearch / narwhal
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
  • 10% duplication:
    • 5,156 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 524 duplicated lines
  • 25 duplicates
system10% (524 lines)
Duplication per Extension
py17% (346 lines)
rs5% (178 lines)
Duplication per Component (primary)
benchmark17% (346 lines)
primary7% (108 lines)
worker6% (42 lines)
network5% (16 lines)
crypto7% (12 lines)
ROOT0% (0 lines)
consensus0% (0 lines)
config0% (0 lines)
node0% (0 lines)
store0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 25 duplicates...
Size#FoldersFilesLinesCode
39 x 2 benchmark/benchmark
benchmark/data/paper-data
aggregate.py
plot-script.py
138:182 (26%)
156:200 (10%)
view
27 x 2 benchmark/benchmark
benchmark/data/paper-data
aggregate.py
plot-script.py
13:43 (18%)
24:54 (7%)
view
16 x 2 benchmark/benchmark
benchmark/data/paper-data
aggregate.py
plot-script.py
48:67 (11%)
65:84 (4%)
view
14 x 2 benchmark/benchmark
benchmark/data/paper-data
aggregate.py
plot-script.py
113:126 (9%)
131:144 (3%)
view
13 x 2 primary/src
primary/src
core.rs
core.rs
26:51 (4%)
74:86 (4%)
view
11 x 2 benchmark/benchmark
benchmark/data/paper-data
plot.py
plot-script.py
67:80 (6%)
247:260 (3%)
view
11 x 2 benchmark/data/paper-data
benchmark/data/paper-data
summary-plot.py
summary-plot.py
19:29 (11%)
34:44 (11%)
view
11 x 2 benchmark/benchmark
benchmark/data/paper-data
aggregate.py
plot-script.py
70:84 (7%)
87:101 (3%)
view
9 x 2 primary/src
primary/src
header_waiter.rs
header_waiter.rs
35:52 (4%)
70:78 (4%)
view
9 x 2 benchmark/benchmark
benchmark/benchmark
local.py
remote.py
105:113 (10%)
257:265 (3%)
view
8 x 2 benchmark/benchmark
benchmark/data/paper-data
aggregate.py
plot-script.py
93:103 (5%)
114:124 (2%)
view
8 x 2 network/src
network/src
reliable_sender.rs
simple_sender.rs
2:9 (5%)
2:9 (9%)
view
8 x 2 worker/src
worker/src
synchronizer.rs
synchronizer.rs
27:42 (5%)
56:63 (5%)
view
8 x 2 benchmark/benchmark
benchmark/benchmark
local.py
remote.py
92:99 (9%)
242:249 (2%)
view
7 x 2 benchmark/benchmark
benchmark/data/paper-data
plot.py
plot-script.py
55:62 (4%)
235:242 (1%)
view
7 x 2 primary/src
worker/src
header_waiter.rs
synchronizer.rs
116:128 (3%)
96:108 (4%)
view
7 x 2 primary/src
worker/src
header_waiter.rs
synchronizer.rs
244:255 (3%)
189:201 (4%)
view
7 x 2 primary/src
primary/src
header_waiter.rs
header_waiter.rs
133:145 (3%)
178:190 (3%)
view
6 x 2 primary/src
primary/src
core.rs
core.rs
123:128 (2%)
228:233 (2%)
view
6 x 2 crypto/src
crypto/src
lib.rs
lib.rs
104:110 (3%)
147:153 (3%)
view
Duplicated Units
The list of top 6 duplicated units.
See data for all 6 unit duplicates...
Size#FoldersFilesLinesCode
24 x 2 benchmark/benchmark
benchmark/data/paper-data
aggregate.py
plot-script.py
0:0 
0:0 
view
10 x 2 benchmark/benchmark
benchmark/data/paper-data
aggregate.py
plot-script.py
0:0 
0:0 
view
9 x 2 benchmark/benchmark
benchmark/data/paper-data
aggregate.py
plot-script.py
0:0 
0:0 
view
7 x 2 benchmark/benchmark
benchmark/data/paper-data
aggregate.py
plot-script.py
0:0 
0:0 
view
7 x 2 benchmark/benchmark
benchmark/data/paper-data
aggregate.py
plot-script.py
0:0 
0:0 
view
7 x 2 crypto/src
crypto/src
lib.rs
lib.rs
104:111 
147:154 
view