facebook / draft-js
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
  • 8% duplication:
    • 11,550 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,025 duplicated lines
  • 52 duplicates
system8% (1,025 lines)
Duplication per Extension
js9% (1,025 lines)
Duplication per Component (primary)
src/model/modifier17% (292 lines)
src/component/contents21% (232 lines)
src/model/immutable10% (140 lines)
src/model/transaction9% (128 lines)
src/component/handlers5% (84 lines)
src/component/selection7% (71 lines)
src/model/encoding2% (26 lines)
ROOT7% (18 lines)
scripts/jest15% (14 lines)
website/src/components4% (14 lines)
src/component/base<1% (6 lines)
website0% (0 lines)
website/src/css0% (0 lines)
website/src/pages0% (0 lines)
scripts0% (0 lines)
src/stubs0% (0 lines)
src/util0% (0 lines)
src/component/utils0% (0 lines)
src/model/decorators0% (0 lines)
src/model/entity0% (0 lines)
src/model/constants0% (0 lines)
src/model/keys0% (0 lines)
src/model/paste0% (0 lines)
src0% (0 lines)
src/flowlib0% (0 lines)
Longest Duplicates
The list of 50 longest duplicates.
See data for all 52 duplicates...
Size#FoldersFilesLinesCode
40 x 2 src/component/contents
src/component/contents/exploration
81:136 (19%)
53:108 (31%)
view
25 x 2 src/component/contents
src/component/contents/exploration
252:280 (12%)
163:191 (19%)
view
25 x 2 src/model/modifier
src/model/modifier/exploration
157:194 (9%)
71:108 (6%)
view
25 x 2 src/model/modifier
src/model/modifier/exploration
292:329 (9%)
386:423 (6%)
view
20 x 2 src/model/immutable
src/model/immutable
58:101 (25%)
90:133 (20%)
view
20 x 2 src/model/immutable
src/model/immutable
108:133 (25%)
153:175 (20%)
view
17 x 2 src/model/modifier
src/model/modifier/exploration
87:105 (6%)
266:284 (4%)
view
16 x 2 src/component/contents
src/component/contents/exploration
112:130 (9%)
245:263 (5%)
view
15 x 2 src/model/modifier
src/model/modifier/exploration
350:365 (5%)
444:459 (3%)
view
14 x 2 src/model/transaction
src/model/transaction
27:46 (7%)
27:46 (11%)
view
13 x 2 src/model/encoding
src/model/encoding
100:112 (5%)
117:129 (5%)
view
13 x 2 src/model/transaction
src/model/transaction
25:43 (4%)
25:43 (11%)
view
12 x 2 src/model/transaction
src/model/transaction
27:43 (6%)
27:43 (4%)
view
12 x 2 src/component/selection
src/component/selection
132:144 (10%)
132:144 (12%)
view
11 x 2 src/component/contents
src/component/contents/exploration
53:67 (6%)
65:79 (3%)
view
10 x 2 src/model/immutable
src/model/immutable
524:536 (2%)
558:570 (2%)
view
10 x 2 src/model/modifier
src/model/modifier
68:77 (7%)
97:106 (7%)
view
10 x 2 src/component/contents
src/component/contents/exploration
161:170 (5%)
75:84 (10%)
view
10 x 2 src/model/transaction
src/model/transaction
80:89 (3%)
300:309 (3%)
view
9 x 2 ROOT
ROOT
45:53 (4%)
59:67 (4%)
view
9 x 2 src/model/modifier
src/model/modifier/exploration
130:142 (3%)
147:166 (2%)
view
9 x 2 src/model/modifier
src/model/modifier/exploration
31:39 (3%)
243:251 (2%)
view
9 x 2 src/model/modifier
src/model/modifier
59:67 (6%)
83:91 (6%)
view
9 x 2 src/model/transaction
src/model/transaction
44:53 (14%)
24:33 (31%)
view
9 x 2 src/component/handlers/edit
src/component/handlers/edit
64:72 (5%)
202:211 (5%)
view
9 x 2 src/component/selection
src/component/selection
157:165 (3%)
218:226 (3%)
view
8 x 2 src/component/contents
src/component/contents/exploration
138:147 (3%)
109:118 (6%)
view
7 x 2 src/component/selection
src/component/selection
157:163 (3%)
176:182 (3%)
view
7 x 2 src/component/handlers/edit
src/component/handlers/edit
132:138 (5%)
146:152 (5%)
view
7 x 2 src/model/immutable
src/model/immutable
25:31 (17%)
35:41 (17%)
view
7 x 2 src/component/handlers/edit/commands
src/component/handlers/edit/commands
26:32 (23%)
26:32 (23%)
view
7 x 2 src/model/modifier
src/model/modifier/exploration
212:219 (2%)
355:362 (1%)
view
7 x 2 website/src/components/DraftEditorExample
website/src/components/DraftEditorExample
170:176 (4%)
194:200 (4%)
view
7 x 2 scripts/jest
scripts/jest
36:42 (13%)
44:50 (13%)
view
7 x 2 src/model/immutable
src/model/immutable
39:50 (9%)
67:78 (7%)
view
7 x 2 src/component/handlers/edit/commands
src/component/handlers/edit/commands
40:49 (23%)
40:50 (23%)
view
7 x 2 src/model/modifier
src/model/modifier/exploration
336:343 (2%)
430:437 (1%)
view
7 x 2 src/component/selection
src/component/selection
176:182 (3%)
218:224 (3%)
view
7 x 2 src/model/modifier
src/model/modifier/exploration
271:280 (2%)
365:374 (1%)
view
6 x 2 src/model/transaction
src/model/transaction
96:101 (2%)
121:127 (2%)
view
6 x 2 src/component/base
src/component/contents/exploration
325:332 (1%)
97:104 (4%)
view
6 x 2 src/component/contents
src/component/contents/exploration
135:140 (3%)
267:272 (2%)
view
6 x 2 src/model/transaction
src/model/transaction
171:176 (2%)
210:215 (2%)
view
6 x 2 src/model/immutable
src/model/immutable
700:705 (1%)
724:729 (1%)
view
6 x 2 src/component/selection
src/component/selection
256:262 (2%)
337:343 (2%)
view
6 x 2 src/model/transaction
src/model/transaction
81:87 (9%)
40:46 (20%)
view
6 x 2 src/model/modifier
src/model/modifier/exploration
42:47 (2%)
254:259 (1%)
view
6 x 2 src/component/handlers/edit/commands
src/component/handlers/edit/commands
52:60 (16%)
39:47 (24%)
view
6 x 2 src/model/transaction
src/model/transaction
101:106 (2%)
124:129 (2%)
view
6 x 2 src/component/handlers/edit/commands
src/component/handlers/edit/commands
28:34 (18%)
28:34 (25%)
view