Function CustomWorkIcon
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CustomWorkIcon = props => {
const { className } = props;
return (
<svg className={className} width="24px" height="22px" viewBox="0 0 24 22" version="1.1">
<g id="pages" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
Similar blocks of code found in 2 locations. Consider refactoring. Open
<g id="Group-215">
<path
d="M12.0959274,5.94786169 C12.9666214,5.07716773 13.0802237,3.71428274 12.1716623,2.80572133 C10.3923641,1.02642309 9.37024321,1.21571744 7.36382606,1.21571744 C10.3923641,-0.109257223 12.5880756,-0.412111024 14.7837871,0.610009834 C15.7302159,1.02642309 16.1088046,1.40501178 16.8659391,2.16214629 L18.2287812,3.52498839 C18.5695025,3.86570964 18.7966214,4.31999034 18.8723563,4.77427104 C18.9859157,5.4935381 18.7966214,5.644965 19.2887695,6.17498059 C19.4401964,6.32640749 19.6673582,6.32640749 19.8187851,6.17498059 C19.970212,6.02355369 20.1973738,6.02355369 20.3488007,6.17498059 L21.6738183,7.5 C21.9766721,7.80285194 21.9766721,8.25713264 21.6738183,8.55998644 L18.9859586,11.2478461 C18.6831048,11.5506999 18.2288241,11.5506999 17.9259703,11.2478461 L16.6766877,9.96069599 C16.5252608,9.80926909 16.5252608,9.5821073 16.6766877,9.4306804 C16.8281146,9.2792535 16.8281146,9.01426714 16.6766877,8.86284024 C16.1466721,8.33282465 15.9952452,8.522119 15.2759781,8.44642699 C14.78383,8.37069209 14.3674167,8.14357319 14.0266955,7.80285194 L12.0959274,5.94786169"
id="Path"
fill="#7F7C79"
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 63.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76