facebookincubator / RapiD
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:
    • 61,207 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 5,167 duplicated lines
  • 555 duplicates
system8% (5,167 lines)
Duplication per Extension
js10% (5,079 lines)
css1% (88 lines)
Duplication per Component (primary)
modules/ui10% (2,143 lines)
modules/svg23% (1,117 lines)
modules/services10% (570 lines)
modules/modes18% (346 lines)
modules/validations11% (296 lines)
modules/operations18% (230 lines)
css1% (88 lines)
modules/osm4% (85 lines)
modules/renderer2% (65 lines)
modules/behavior3% (54 lines)
modules/core2% (53 lines)
config80% (50 lines)
scripts4% (30 lines)
modules/geo14% (24 lines)
modules/presets2% (16 lines)
ROOT0% (0 lines)
modules/util0% (0 lines)
modules0% (0 lines)
modules/actions0% (0 lines)
data0% (0 lines)
Longest Duplicates
The list of 50 longest duplicates.
See data for all 555 duplicates...
Size#FoldersFilesLinesCode
42 x 2 modules/ui
modules/ui
22:77 (54%)
28:82 (52%)
view
35 x 2 modules/svg
modules/svg
198:242 (17%)
255:301 (15%)
view
29 x 2 modules/ui
modules/ui
112:155 (21%)
122:166 (20%)
view
28 x 2 modules/operations
modules/operations
24:64 (53%)
42:83 (47%)
view
28 x 2 modules/operations
modules/operations
24:64 (53%)
24:64 (53%)
view
28 x 2 modules/operations
modules/operations
42:83 (47%)
24:64 (53%)
view
25 x 2 modules/svg
modules/svg
35:74 (12%)
45:92 (10%)
view
23 x 2 modules/svg
modules/svg
53:86 (17%)
54:87 (17%)
view
21 x 2 modules/ui
modules/ui
17:41 (37%)
19:43 (37%)
view
21 x 2 modules/svg
modules/svg
126:154 (13%)
126:153 (13%)
view
20 x 2 modules/operations
modules/operations
74:102 (27%)
102:130 (22%)
view
20 x 2 modules/operations
modules/operations
31:59 (27%)
53:81 (22%)
view
20 x 2 modules/svg
modules/svg
38:69 (9%)
37:68 (9%)
view
20 x 2 modules/ui
modules/ui
43:65 (35%)
45:68 (35%)
view
20 x 2 modules/svg
modules/svg
38:69 (9%)
47:84 (8%)
view
19 x 2 modules/ui
modules/ui
82:111 (24%)
87:116 (23%)
view
19 x 2 modules/operations
modules/operations
96:123 (21%)
103:130 (21%)
view
19 x 2 modules/operations
modules/operations
75:102 (26%)
96:123 (21%)
view
19 x 2 modules/ui/sections
modules/ui/sections
78:102 (22%)
53:77 (28%)
view
18 x 2 modules/svg
modules/svg
100:124 (11%)
100:124 (11%)
view
18 x 2 modules/services
modules/services
130:152 (5%)
265:290 (5%)
view
18 x 2 modules/svg
modules/svg
41:65 (12%)
53:77 (7%)
view
18 x 2 modules/ui/sections
modules/ui/sections
103:126 (5%)
155:177 (5%)
view
17 x 2 modules/svg
modules/svg
269:294 (8%)
260:285 (8%)
view
17 x 2 modules/svg
modules/svg
158:179 (10%)
157:178 (10%)
view
17 x 2 modules/ui/tools
modules/ui/tools
102:123 (17%)
77:98 (21%)
view
16 x 2 modules/behavior
modules/modes
76:97 (5%)
93:114 (5%)
view
16 x 2 modules/operations
modules/operations
77:101 (21%)
170:194 (11%)
view
16 x 2 modules/ui/sections
modules/ui/sections
379:401 (5%)
539:562 (4%)
view
16 x 2 modules/operations
modules/operations
170:194 (11%)
105:129 (18%)
view
16 x 2 modules/svg
modules/svg
221:241 (7%)
94:114 (15%)
view
16 x 2 modules/ui/intro
modules/ui/intro
855:872 (2%)
877:894 (2%)
view
16 x 2 modules/operations
modules/operations
170:194 (11%)
98:122 (18%)
view
15 x 2 modules/ui
modules/ui/sections
84:102 (6%)
111:129 (14%)
view
15 x 2 modules/ui/intro
modules/ui/intro
489:509 (4%)
766:786 (2%)
view
15 x 2 modules/svg
modules/svg
77:96 (9%)
77:96 (9%)
view
15 x 2 modules/services
modules/services
433:452 (4%)
458:475 (4%)
view
15 x 2 modules/services
modules/services
147:163 (2%)
172:188 (2%)
view
15 x 2 modules/ui
modules/ui
63:82 (11%)
73:92 (10%)
view
15 x 2 modules/ui/sections
modules/ui/sections
339:358 (5%)
514:533 (3%)
view
15 x 2 modules/svg
modules/svg
189:203 (10%)
184:198 (6%)
view
15 x 2 modules/svg
modules/svg
77:96 (10%)
77:96 (9%)
view
15 x 2 modules/svg
modules/svg
77:96 (9%)
77:96 (10%)
view
15 x 2 modules/ui
modules/ui
260:281 (6%)
317:338 (6%)
view
14 x 2 modules/ui/fields
modules/ui/sections
622:641 (2%)
296:312 (5%)
view
14 x 2 modules/ui/intro
modules/ui/intro
210:229 (2%)
260:278 (2%)
view
14 x 2 modules/ui
modules/ui
41:57 (10%)
41:57 (10%)
view
14 x 2 modules/ui/intro
modules/ui/intro
257:274 (3%)
295:312 (3%)
view
14 x 2 modules/ui/intro
modules/ui/intro
257:274 (3%)
329:346 (3%)
view
14 x 2 modules/ui/intro
modules/ui/intro
295:312 (3%)
329:346 (3%)
view
Duplicated Units
The list of top 28 duplicated units.
See data for all 28 unit duplicates...
Size#FoldersFilesLinesCode
23 x 3 modules/svg
modules/svg
modules/svg
174:203 
183:212 
184:213 
view
22 x 2 modules/svg
modules/svg
57:83 
58:84 
view
12 x 3 modules/svg
modules/svg
modules/svg
73:87 
73:87 
73:87 
view
12 x 2 modules/svg
modules/svg
206:221 
216:231 
view
11 x 2 modules/services
modules/services
272:285 
137:149 
view
10 x 3 modules/ui/sections
modules/ui/sections
modules/ui/sections
344:355 
519:530 
434:445 
view
10 x 2 modules/modes
modules/modes
95:110 
93:108 
view
10 x 4 modules/operations
modules/operations
modules/operations
modules/operations
94:105 
42:53 
61:72 
42:53 
view
10 x 4 modules/operations
modules/operations
modules/operations
modules/operations
113:124 
106:117 
178:189 
85:96 
view
9 x 2 modules/svg
modules/svg
48:59 
60:71 
view
9 x 3 modules/svg
modules/svg
modules/svg
48:58 
48:58 
48:58 
view
9 x 2 modules/svg
modules/svg
45:57 
35:47 
view
9 x 2 modules/behavior
modules/modes
76:86 
93:103 
view
9 x 2 modules/behavior
modules/modes
89:99 
106:116 
view
9 x 2 modules/services
modules/services
565:575 
962:972 
view
8 x 5 modules/ui/intro
modules/ui/intro
modules/ui/intro
modules/ui/intro
modules/ui/intro
1048:1057 
752:761 
526:535 
475:484 
463:472 
view
7 x 3 modules/svg
modules/svg
modules/svg
20:28 
24:33 
21:29 
view
7 x 3 modules/svg
modules/svg
modules/svg
61:70 
61:70 
61:70 
view
7 x 2 modules/ui/intro
modules/ui/intro
769:777 
492:500 
view
7 x 2 modules/validations
modules/validations
196:204 
112:120 
view
7 x 2 modules/services
modules/services
39:47 
36:44 
view
6 x 3 modules/svg
modules/svg
modules/svg
51:59 
62:70 
50:58 
view
14 x 2 modules/operations
modules/operations
53:71 
31:49 
view
6 x 2 modules/operations
modules/operations
56:63 
34:41 
view
6 x 9 modules/validations
modules/validations
modules/validations
modules/validations
modules/validations
modules/validations
modules/validations
modules/validations
modules/validations
157:164 
123:130 
25:32 
136:143 
283:290 
79:86 
89:96 
85:92 
43:50 
view
6 x 2 modules/validations
modules/validations
103:110 
84:91 
view
6 x 2 modules/services
modules/services
91:98 
96:103 
view
27 x 3 modules/operations
modules/operations
modules/operations
27:59 
46:78 
27:59 
view