facebook / folly
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
  • 7% duplication:
    • 141,245 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 10,274 duplicated lines
  • 1,767 duplicates
system7% (10,274 lines)
Duplication per Extension
h7% (7,142 lines)
cpp6% (2,353 lines)
cmake13% (505 lines)
py3% (274 lines)
Duplication per Component (primary)
folly5% (1,888 lines)
folly/experimental6% (1,658 lines)
folly/container22% (1,535 lines)
folly/io4% (773 lines)
folly/hash38% (620 lines)
folly/logging14% (507 lines)
build/fbcode_builder5% (505 lines)
folly/concurrency13% (495 lines)
folly/futures11% (490 lines)
folly/gen10% (337 lines)
folly/fibers6% (275 lines)
CMake16% (274 lines)
folly/net14% (205 lines)
folly/synchronization3% (192 lines)
folly/portability4% (119 lines)
folly/detail4% (117 lines)
folly/compression4% (85 lines)
folly/executors2% (67 lines)
folly/stats2% (52 lines)
folly/lang2% (41 lines)
folly/memory1% (16 lines)
folly/tracing6% (16 lines)
folly/python<1% (7 lines)
folly/init0% (0 lines)
folly/ssl0% (0 lines)
folly/tools0% (0 lines)
folly/chrono0% (0 lines)
folly/system0% (0 lines)
folly/support0% (0 lines)
folly/functional0% (0 lines)
folly/poly0% (0 lines)

Duplication Between Components (50+ lines)

G folly/container folly/container folly folly folly/container--folly 477 CMake CMake build/fbcode_builder build/fbcode_builder CMake--build/fbcode_builder 270

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 1,767 duplicates...
Size#FoldersFilesLinesCode
60 x 2 folly
folly
425:521 (8%)
906:1002 (8%)
view
53 x 2 folly/hash
folly/hash
100:154 (22%)
101:155 (22%)
view
44 x 2 folly/hash
folly/hash
238:300 (18%)
238:300 (18%)
view
38 x 2 folly/container
folly/container
730:810 (4%)
529:610 (6%)
view
36 x 2 folly/hash
folly/hash
123:196 (31%)
124:197 (30%)
view
36 x 2 folly/hash
folly/hash
201:278 (31%)
206:283 (30%)
view
35 x 2 folly/container
folly/container/detail
244:302 (4%)
87:140 (8%)
view
33 x 2 CMake
build/fbcode_builder/CMake
2:41 (97%)
2:41 (97%)
view
32 x 2 folly/container
folly/container
305:354 (3%)
261:310 (5%)
view
29 x 2 folly/experimental/crypto/detail
folly/experimental/crypto/detail
39:80 (23%)
104:145 (23%)
view
28 x 2 folly
folly
324:355 (3%)
586:617 (3%)
view
28 x 2 folly/hash
folly/hash
57:117 (24%)
58:118 (23%)
view
28 x 2 folly/container
folly
1173:1221 (3%)
1021:1069 (3%)
view
26 x 2 folly/experimental/crypto/detail
folly/experimental/crypto/detail
47:78 (15%)
104:135 (15%)
view
26 x 2 folly/experimental/crypto/detail
folly/experimental/crypto/detail
46:77 (15%)
103:133 (15%)
view
24 x 2 folly/container
folly
1289:1313 (2%)
1130:1154 (3%)
view
24 x 2 folly/net
folly/net
63:93 (20%)
149:179 (20%)
view
23 x 2 folly/container
folly/container
459:486 (2%)
469:496 (2%)
view
22 x 2 folly/hash
folly/hash
303:335 (9%)
303:335 (9%)
view
21 x 2 folly/hash
folly/hash
63:94 (9%)
64:95 (9%)
view
21 x 2 folly/hash
folly/hash
162:189 (9%)
163:190 (9%)
view
21 x 2 folly/container
folly
615:640 (2%)
205:230 (2%)
view
20 x 2 folly/container
folly
587:611 (2%)
178:202 (2%)
view
19 x 2 folly/concurrency/detail
folly/concurrency/detail
1215:1236 (1%)
1270:1291 (1%)
view
19 x 2 folly/hash
folly/hash
352:378 (8%)
354:380 (8%)
view
19 x 2 folly/container
folly/container
1057:1083 (2%)
823:849 (3%)
view
19 x 2 folly/experimental/coro
folly/experimental/coro
629:669 (2%)
899:941 (2%)
view
19 x 2 folly/fibers
folly/fibers
146:182 (14%)
135:171 (15%)
view
18 x 2 folly/experimental/coro
folly/experimental/coro
639:672 (2%)
774:809 (2%)
view
18 x 2 folly/experimental/symbolizer
folly/experimental/symbolizer
509:528 (4%)
604:623 (4%)
view
18 x 2 folly/io/async
folly/io/async
493:513 (2%)
592:612 (2%)
view
18 x 2 folly/concurrency/detail
folly/concurrency/detail
284:308 (1%)
1190:1214 (1%)
view
18 x 2 folly/io/async
folly/io/async
52:81 (15%)
152:177 (15%)
view
17 x 2 folly/io/async
folly/io/async
2536:2558 (<1%)
1005:1024 (1%)
view
17 x 2 folly/detail
folly/detail
61:84 (17%)
138:161 (17%)
view
17 x 2 folly/container
folly
1159:1186 (1%)
510:537 (2%)
view
16 x 2 folly
folly
210:225 (3%)
273:288 (3%)
view
16 x 2 folly
folly
243:258 (3%)
273:288 (3%)
view
16 x 2 folly
folly
210:225 (3%)
243:258 (3%)
view
16 x 2 folly/experimental/coro
folly/experimental/coro
774:806 (2%)
909:941 (2%)
view
16 x 2 folly/container/detail
folly/container/detail
374:391 (4%)
188:205 (5%)
view
15 x 2 folly
folly
425:439 (3%)
481:495 (3%)
view
15 x 2 folly
folly
118:132 (3%)
331:345 (3%)
view
15 x 2 folly/experimental
folly/experimental
693:710 (2%)
742:759 (2%)
view
15 x 2 folly
folly
118:132 (3%)
282:296 (3%)
view
15 x 2 folly/container
folly/container
459:476 (1%)
479:496 (1%)
view
15 x 2 folly
folly
282:296 (3%)
331:345 (3%)
view
15 x 2 folly/experimental/coro
folly/experimental/coro
337:356 (5%)
116:135 (14%)
view
15 x 2 folly/experimental/coro
folly/experimental/coro
237:261 (3%)
296:320 (3%)
view
15 x 2 folly
folly
323:337 (3%)
363:377 (3%)
view
Duplicated Units
The list of top 23 duplicated units.
See data for all 23 unit duplicates...
Size#FoldersFilesLinesCode
17 x 2 folly/hash
folly/hash
141:159 
142:160 
view
16 x 2 folly/hash
folly/hash
177:194 
178:195 
view
14 x 2 folly/experimental/coro
folly/experimental/coro
119:136 
340:357 
view
14 x 2 folly/hash
folly/hash
221:236 
226:241 
view
13 x 2 folly/hash
folly/hash
250:264 
255:269 
view
12 x 2 folly/container
folly/container
307:320 
263:276 
view
12 x 2 folly/logging
folly/logging
30:43 
28:41 
view
10 x 2 folly
folly/container
206:217 
616:627 
view
9 x 2 folly/experimental/crypto/detail
folly/experimental/crypto/detail
219:229 
220:230 
view
7 x 2 folly/hash
folly/hash
70:78 
71:79 
view
7 x 2 folly/hash
folly/hash
83:91 
84:92 
view
7 x 2 folly/container
folly/container
323:337 
279:293 
view
7 x 2 folly/container
folly/container
1072:1080 
838:846 
view
7 x 2 folly/container/detail
folly/container/detail
141:149 
277:285 
view
7 x 2 folly/container/detail
folly/container/detail
334:342 
482:490 
view
7 x 2 folly
folly
111:119 
176:184 
view
6 x 2 folly/experimental/crypto/detail
folly/experimental/crypto/detail
256:263 
256:263 
view
6 x 2 folly/experimental
folly/experimental
160:167 
178:185 
view
6 x 2 folly
folly/container
792:799 
894:901 
view
6 x 2 folly/container
folly/container
341:351 
297:307 
view
6 x 4 folly/container
folly/container/detail
folly/container/detail
folly/container
855:862 
267:274 
421:428 
645:652 
view
6 x 2 folly/executors
folly/executors
67:74 
80:87 
view
6 x 3 folly/executors
folly/executors
folly/executors
47:54 
69:76 
50:57 
view