facebook / CacheLib
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
  • 5% duplication:
    • 36,413 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,098 duplicated lines
  • 176 duplicates
system5% (2,098 lines)
Duplication per Extension
cpp7% (952 lines)
h3% (744 lines)
rs22% (307 lines)
cmake4% (45 lines)
js4% (24 lines)
in59% (13 lines)
plt31% (13 lines)
Duplication per Component (primary)
cachelib/allocator4% (573 lines)
cachelib/benchmarks18% (485 lines)
cachelib/rust21% (353 lines)
cachelib/cachebench7% (282 lines)
cachelib/navy3% (193 lines)
cachelib/cmake6% (58 lines)
cachelib/common1% (52 lines)
cachelib/datatype2% (38 lines)
cachelib/shm2% (26 lines)
website7% (24 lines)
cachelib/experimental2% (14 lines)
website/src0% (0 lines)
cachelib/persistence0% (0 lines)
cachelib/compact_cache0% (0 lines)

Duplication Between Components (50+ lines)

G cachelib/cachebench cachelib/cachebench cachelib/cmake cachelib/cmake cachelib/cachebench--cachelib/cmake 64

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 50 longest duplicates.
See data for all 176 duplicates...
Size#FoldersFilesLinesCode
36 x 2 cachelib/rust/readonly
cachelib/rust/src
118:159 (24%)
1157:1198 (4%)
view
30 x 2 cachelib/allocator
cachelib/allocator
347:456 (12%)
234:341 (19%)
view
27 x 2 cachelib/benchmarks
cachelib/benchmarks
240:285 (13%)
318:363 (9%)
view
26 x 2 cachelib/cachebench/runner
cachelib/cachebench/runner
143:171 (10%)
281:309 (10%)
view
22 x 2 cachelib/rust/readonly
cachelib/rust/src
123:144 (14%)
1122:1143 (2%)
view
22 x 2 cachelib/rust/src
cachelib/rust/src
1122:1143 (2%)
1162:1183 (2%)
view
21 x 2 cachelib/cachebench/runner
cachelib/cachebench/runner
110:139 (8%)
248:277 (8%)
view
19 x 2 cachelib/cachebench/runner
cachelib/cachebench/runner
102:139 (17%)
173:210 (17%)
view
19 x 2 cachelib/common/piecewise
cachelib/common/piecewise
92:110 (15%)
114:132 (15%)
view
17 x 2 cachelib/benchmarks
cachelib/benchmarks
233:257 (6%)
289:313 (6%)
view
17 x 2 cachelib/benchmarks
cachelib/benchmarks
101:124 (8%)
93:116 (6%)
view
16 x 2 cachelib/cmake
cachelib/cmake
1:17 (40%)
1:17 (42%)
view
16 x 2 cachelib/benchmarks
cachelib/benchmarks
62:83 (12%)
73:94 (13%)
view
15 x 2 cachelib/rust/src
cachelib/rust/src
1:15 (31%)
1:15 (1%)
view
15 x 2 cachelib/rust/readonly
cachelib/rust/src
1:15 (10%)
1:15 (31%)
view
15 x 2 cachelib/rust
cachelib/rust/src
1:15 (65%)
1:15 (31%)
view
15 x 2 cachelib/rust
cachelib/rust/readonly
1:15 (65%)
1:15 (10%)
view
15 x 2 cachelib/rust
cachelib/rust/src
1:15 (65%)
1:15 (1%)
view
15 x 2 cachelib/rust/src
cachelib/rust/src
1:15 (31%)
1:15 (11%)
view
15 x 2 cachelib/rust/readonly
cachelib/rust/src
1:15 (10%)
1:15 (11%)
view
15 x 2 cachelib/rust/readonly
cachelib/rust/src
1:15 (10%)
1:15 (1%)
view
15 x 2 cachelib/rust/src
cachelib/rust/src
1:15 (13%)
1:15 (31%)
view
15 x 2 cachelib/rust
cachelib/rust/src
1:15 (65%)
1:15 (13%)
view
15 x 2 cachelib/rust/src
cachelib/rust/src
1:15 (13%)
1:15 (1%)
view
15 x 2 cachelib/rust/readonly
cachelib/rust/src
1:15 (10%)
1:15 (13%)
view
15 x 2 cachelib/rust
cachelib/rust/src
1:15 (65%)
1:15 (11%)
view
15 x 2 cachelib/rust/src
cachelib/rust/src
1:15 (13%)
1:15 (11%)
view
15 x 2 cachelib/rust/src
cachelib/rust/src
1:15 (11%)
1:15 (1%)
view
14 x 2 cachelib/benchmarks
cachelib/benchmarks
200:223 (6%)
250:273 (5%)
view
13 x 2 cachelib/cmake
cachelib/cmake
1:13 (28%)
1:13 (34%)
view
13 x 2 cachelib/cachebench/vizualize
cachelib/cmake
1:13 (31%)
1:13 (28%)
view
13 x 2 cachelib/cmake
cachelib/cmake
1:13 (28%)
1:13 (32%)
view
13 x 2 cachelib/cachebench/vizualize
cachelib/cmake
1:13 (31%)
1:13 (32%)
view
13 x 2 cachelib/cachebench/vizualize
cachelib/cmake
1:13 (31%)
1:13 (34%)
view
13 x 2 cachelib/allocator
cachelib/allocator
82:103 (21%)
81:102 (24%)
view
13 x 2 cachelib/benchmarks
cachelib/benchmarks
318:336 (6%)
425:443 (4%)
view
12 x 2 cachelib/benchmarks
cachelib/benchmarks
144:158 (9%)
154:168 (9%)
view
12 x 2 cachelib/benchmarks
cachelib/benchmarks
174:188 (9%)
183:197 (9%)
view
11 x 2 cachelib/cachebench/runner
cachelib/cachebench/runner
43:58 (4%)
124:139 (4%)
view
11 x 2 cachelib/cachebench/runner
cachelib/cachebench/runner
43:58 (4%)
262:277 (4%)
view
11 x 2 cachelib/cachebench/workload
cachelib/cachebench/workload
297:307 (3%)
259:269 (7%)
view
11 x 2 cachelib/benchmarks
cachelib/benchmarks
54:70 (23%)
92:108 (23%)
view
11 x 2 cachelib/allocator
cachelib/allocator
45:58 (4%)
66:79 (4%)
view
10 x 2 cachelib/benchmarks
cachelib/benchmarks
36:50 (8%)
47:61 (8%)
view
10 x 2 cachelib/allocator
cachelib/allocator
436:448 (3%)
333:346 (4%)
view
10 x 2 cachelib/allocator
cachelib/allocator
494:516 (3%)
583:605 (3%)
view
10 x 2 cachelib/navy/block_cache
cachelib/navy/block_cache
26:35 (3%)
78:87 (9%)
view
10 x 2 cachelib/cachebench/runner
cachelib/cachebench/runner
61:78 (9%)
173:190 (9%)
view
10 x 2 cachelib/allocator
cachelib/allocator
353:365 (3%)
333:346 (4%)
view
10 x 2 cachelib/cachebench/runner
cachelib/cachebench/runner
61:78 (9%)
102:119 (9%)
view
Duplicated Units
The list of top 5 duplicated units.
See data for all 5 unit duplicates...
Size#FoldersFilesLinesCode
33 x 2 cachelib/rust/readonly
cachelib/rust/src
122:157 
1161:1196 
view
11 x 3 cachelib/allocator
cachelib/allocator
cachelib/allocator
352:366 
332:347 
435:449 
view
9 x 2 cachelib/cachebench/workload
cachelib/cachebench/workload
135:145 
127:137 
view
7 x 2 cachelib/allocator
cachelib/allocator
258:266 
297:305 
view
6 x 2 cachelib/benchmarks
cachelib/benchmarks
72:79 
61:68 
view