guardian/interactive-travel-countries
Duplication Places in code with 6 or more lines that are exactly the same. |
Duplication Overall
- 54% duplication:
- 3,180 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
- 1,722 duplicated lines
- 44 duplicates
Duplication per Extension
Duplication per Component (primary)
Longest Duplicates
The list of 44 longest duplicates.
| Size | # | Folders | Files | Lines | Code |
|---|---|---|---|---|---|
| 233 | x 2 | atoms/europe-map/client/cssatoms/red-list-countries/client/css | 1:283 (100%)1:283 (100%) | view | |
| 233 | x 2 | atoms/map/client/cssatoms/scatterplot/client/css | 1:283 (100%)1:283 (100%) | view | |
| 233 | x 2 | atoms/europe-map/client/cssatoms/map/client/css | 1:283 (100%)1:283 (100%) | view | |
| 233 | x 2 | atoms/red-list-countries/client/cssatoms/scatterplot/client/css | 1:283 (100%)1:283 (100%) | view | |
| 233 | x 2 | atoms/europe-map/client/cssatoms/scatterplot/client/css | 1:283 (100%)1:283 (100%) | view | |
| 233 | x 2 | atoms/map/client/cssatoms/red-list-countries/client/css | 1:283 (100%)1:283 (100%) | view | |
| 75 | x 2 | atoms/europe-map/client/cssatoms/map/client/css | 1:95 (100%)1:95 (100%) | view | |
| 69 | x 2 | atoms/red-list-countries/client/cssatoms/scatterplot/client/css | 1:89 (50%)1:89 (44%) | view | |
| 56 | x 2 | atoms/europe-map/client/jsatoms/map/client/js | 116:191 (34%)112:187 (33%) | view | |
| 39 | x 2 | atoms/red-list-countries/client/cssatoms/scatterplot/client/css | 93:142 (28%)98:147 (25%) | view | |
| 25 | x 2 | atoms/red-list-countries/client/cssatoms/scatterplot/client/css | 145:180 (18%)149:184 (16%) | view | |
| 22 | x 2 | atoms/europe-map/client/jsatoms/scatterplot/client/js | 154:176 (13%)250:272 (7%) | view | |
| 22 | x 2 | atoms/map/client/jsatoms/scatterplot/client/js | 150:172 (13%)250:272 (7%) | view | |
| 20 | x 2 | atoms/map/client/cssatoms/red-list-countries/client/css | 19:41 (26%)28:50 (14%) | view | |
| 20 | x 2 | atoms/europe-map/client/cssatoms/scatterplot/client/css | 19:41 (26%)28:50 (12%) | view | |
| 20 | x 2 | atoms/europe-map/client/jsatoms/map/client/js | 87:114 (12%)84:111 (11%) | view | |
| 20 | x 2 | atoms/map/client/cssatoms/scatterplot/client/css | 19:41 (26%)28:50 (12%) | view | |
| 20 | x 2 | atoms/europe-map/client/cssatoms/red-list-countries/client/css | 19:41 (26%)28:50 (14%) | view | |
| 18 | x 2 | atoms/europe-map/client/jsatoms/map/client/js | 57:85 (11%)55:83 (10%) | view | |
| 15 | x 2 | atoms/map/client/cssatoms/red-list-countries/client/css | 67:84 (20%)99:116 (11%) | view | |
| 15 | x 2 | atoms/europe-map/client/cssatoms/scatterplot/client/css | 67:84 (20%)104:121 (9%) | view | |
| 15 | x 2 | atoms/map/client/jsatoms/red-list-countries/client/js | 1:22 (100%)1:22 (100%) | view | |
| 15 | x 2 | atoms/map/client/cssatoms/scatterplot/client/css | 67:84 (20%)104:121 (9%) | view | |
| 15 | x 2 | atoms/europe-map/client/cssatoms/red-list-countries/client/css | 67:84 (20%)99:116 (11%) | view | |
| 15 | x 2 | atoms/red-list-countries/client/jsatoms/scatterplot/client/js | 1:22 (100%)1:22 (100%) | view | |
| 15 | x 2 | atoms/map/client/jsatoms/scatterplot/client/js | 1:22 (100%)1:22 (100%) | view | |
| 15 | x 2 | atoms/europe-map/client/jsatoms/scatterplot/client/js | 1:22 (100%)1:22 (100%) | view | |
| 15 | x 2 | atoms/europe-map/client/jsatoms/map/client/js | 1:22 (100%)1:22 (100%) | view | |
| 15 | x 2 | atoms/europe-map/client/jsatoms/red-list-countries/client/js | 1:22 (100%)1:22 (100%) | view | |
| 13 | x 2 | atoms/europe-map/client/jsatoms/map/client/js | 31:53 (7%)30:51 (7%) | view | |
| 8 | x 2 | atoms/map/client/cssatoms/red-list-countries/client/css | 1:9 (10%)1:9 (5%) | view | |
| 8 | x 2 | atoms/europe-map/client/cssatoms/scatterplot/client/css | 1:9 (10%)1:9 (5%) | view | |
| 8 | x 2 | atoms/map/client/cssatoms/scatterplot/client/css | 1:9 (10%)1:9 (5%) | view | |
| 8 | x 2 | atoms/europe-map/client/cssatoms/red-list-countries/client/css | 1:9 (10%)1:9 (5%) | view | |
| 7 | x 2 | atoms/map/client/cssatoms/red-list-countries/client/css | 46:56 (9%)53:63 (5%) | view | |
| 7 | x 2 | atoms/europe-map/client/cssatoms/scatterplot/client/css | 46:56 (9%)53:63 (4%) | view | |
| 7 | x 2 | atoms/europe-map/client/jsatoms/map/client/js | 198:209 (4%)202:213 (4%) | view | |
| 7 | x 2 | atoms/europe-map/client/jsatoms/map/client/js | 231:240 (4%)236:245 (4%) | view | |
| 7 | x 2 | atoms/map/client/cssatoms/scatterplot/client/css | 46:56 (9%)53:63 (4%) | view | |
| 7 | x 2 | atoms/europe-map/client/cssatoms/red-list-countries/client/css | 46:56 (9%)53:63 (5%) | view | |
| 7 | x 2 | atoms/europe-map/server/templatesatoms/map/server/templates | 1:10 (100%)1:10 (100%) | view | |
| 6 | x 2 | shared/css/guss-typographyshared/css/guss-typography | 188:193 (5%)200:205 (5%) | view | |
| 6 | x 2 | shared/cssshared/css | 56:61 (10%)72:77 (10%) | view | |
| 6 | x 2 | atoms/europe-map/client/jsatoms/map/client/js | 244:253 (3%)253:262 (3%) | view |
Most Frequent Duplicates
The list of 50 most frequently found duplicates.
| Size | # | Folders | Files | Lines | Code |
|---|---|---|---|---|---|
| 6 | x 4 | atoms/map/client/cssatoms/red-list-countries/client/cssatoms/scatterplot/client/cssatoms/europe-map/client/css | 68:73 (8%)100:105 (4%)105:110 (3%)68:73 (8%) | view | |
| 6 | x 4 | atoms/map/client/cssatoms/red-list-countries/client/cssatoms/scatterplot/client/cssatoms/europe-map/client/css | 35:40 (8%)44:49 (4%)44:49 (3%)35:40 (8%) | view | |
| 6 | x 4 | atoms/map/client/cssatoms/red-list-countries/client/cssatoms/scatterplot/client/cssatoms/europe-map/client/css | 20:26 (8%)29:35 (4%)29:35 (3%)20:26 (8%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 118:125 (2%)118:125 (2%)118:125 (2%)118:125 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 116:122 (2%)116:122 (2%)116:122 (2%)116:122 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 231:236 (2%)231:236 (2%)231:236 (2%)231:236 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 176:181 (2%)176:181 (2%)176:181 (2%)176:181 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/jsatoms/red-list-countries/client/jsatoms/map/client/jsatoms/scatterplot/client/js | 7:13 (40%)7:13 (40%)7:13 (40%)7:13 (40%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 1:10 (2%)1:10 (2%)1:10 (2%)1:10 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 193:198 (2%)193:198 (2%)193:198 (2%)193:198 (2%) | view | |
| 6 | x 4 | atoms/map/client/cssatoms/red-list-countries/client/cssatoms/scatterplot/client/cssatoms/europe-map/client/css | 67:72 (8%)99:104 (4%)104:109 (3%)67:72 (8%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 174:180 (2%)174:180 (2%)174:180 (2%)174:180 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 260:265 (2%)260:265 (2%)260:265 (2%)260:265 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 62:70 (2%)62:70 (2%)62:70 (2%)62:70 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 136:142 (2%)136:142 (2%)136:142 (2%)136:142 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 143:149 (2%)143:149 (2%)143:149 (2%)143:149 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 266:271 (2%)266:271 (2%)266:271 (2%)266:271 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 222:228 (2%)222:228 (2%)222:228 (2%)222:228 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 258:263 (2%)258:263 (2%)258:263 (2%)258:263 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 270:276 (2%)270:276 (2%)270:276 (2%)270:276 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 185:190 (2%)185:190 (2%)185:190 (2%)185:190 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 112:118 (2%)112:118 (2%)112:118 (2%)112:118 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 156:163 (2%)156:163 (2%)156:163 (2%)156:163 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 251:257 (2%)251:257 (2%)251:257 (2%)251:257 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 215:220 (2%)215:220 (2%)215:220 (2%)215:220 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 44:49 (2%)44:49 (2%)44:49 (2%)44:49 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 73:79 (2%)73:79 (2%)73:79 (2%)73:79 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 9:15 (2%)9:15 (2%)9:15 (2%)9:15 (2%) | view | |
| 6 | x 4 | atoms/map/client/cssatoms/red-list-countries/client/cssatoms/scatterplot/client/cssatoms/europe-map/client/css | 73:80 (8%)105:112 (4%)110:117 (3%)73:80 (8%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 133:139 (2%)133:139 (2%)133:139 (2%)133:139 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 46:51 (2%)46:51 (2%)46:51 (2%)46:51 (2%) | view | |
| 6 | x 4 | atoms/map/client/cssatoms/red-list-countries/client/cssatoms/scatterplot/client/cssatoms/europe-map/client/css | 46:54 (8%)53:61 (4%)53:61 (3%)46:54 (8%) | view | |
| 6 | x 4 | atoms/map/client/cssatoms/red-list-countries/client/cssatoms/scatterplot/client/cssatoms/europe-map/client/css | 28:35 (8%)37:44 (4%)37:44 (3%)28:35 (8%) | view | |
| 6 | x 4 | atoms/map/client/cssatoms/red-list-countries/client/cssatoms/scatterplot/client/cssatoms/europe-map/client/css | 69:74 (8%)101:106 (4%)106:111 (3%)69:74 (8%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 88:94 (2%)88:94 (2%)88:94 (2%)88:94 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 191:196 (2%)191:196 (2%)191:196 (2%)191:196 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 142:148 (2%)142:148 (2%)142:148 (2%)142:148 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 257:262 (2%)257:262 (2%)257:262 (2%)257:262 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 263:268 (2%)263:268 (2%)263:268 (2%)263:268 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 218:223 (2%)218:223 (2%)218:223 (2%)218:223 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 213:219 (2%)213:219 (2%)213:219 (2%)213:219 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 208:215 (2%)208:215 (2%)208:215 (2%)208:215 (2%) | view | |
| 6 | x 4 | atoms/map/client/cssatoms/red-list-countries/client/cssatoms/scatterplot/client/cssatoms/europe-map/client/css | 76:84 (8%)108:116 (4%)113:121 (3%)76:84 (8%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 148:154 (2%)148:154 (2%)148:154 (2%)148:154 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 247:252 (2%)247:252 (2%)247:252 (2%)247:252 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 58:64 (2%)58:64 (2%)58:64 (2%)58:64 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 74:80 (2%)74:80 (2%)74:80 (2%)74:80 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 196:201 (2%)196:201 (2%)196:201 (2%)196:201 (2%) | view | |
| 6 | x 4 | atoms/europe-map/client/cssatoms/red-list-countries/client/cssatoms/map/client/cssatoms/scatterplot/client/css | 261:266 (2%)261:266 (2%)261:266 (2%)261:266 (2%) | view | |
| 6 | x 4 | atoms/map/client/cssatoms/red-list-countries/client/cssatoms/scatterplot/client/cssatoms/europe-map/client/css | 21:27 (8%)30:36 (4%)30:36 (3%)21:27 (8%) | view |
About This Analysis
- 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...
- To learn more about duplications and techniques for eliminating duplication, Sokrates recommends the following resources:
- Avoid Repetition, MartinFlower.com (IEEE Software article)
- Refactoring duplicated code, sourcemaking.com
- Beck Design Rules, MartinFowler.com
- DRY (Don't Repeat Yourself) Principle, Wikipedia
- The Cut-and-Paste Programming Software Development Anti-Pattern, sourcemaking.com
- Code Smells / Duplicated Code, Jeff Atwood, codinghorror.com:
- "Duplicated code is the bane of software development. Stamp out duplication whenever possible. You should always be on the lookout for more subtle cases of near-duplication, too. Don't Repeat Yourself!"
- Reducing Coupling, MartinFlower.com (IEEE Software article):
- "There are several ways to describe coupling, but it boils down to this: If changing one module in a program requires changing another module, then coupling exists. ... Duplication always implies coupling, because changing one piece of duplicate code implies changing the other."