Function PhoneSolid
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PhoneSolid = props => {
const { className, style } = props;
return (
<svg
className={className}
Similar blocks of code found in 2 locations. Consider refactoring. Open
<g id="phone" transform="translate(5.000000, 5.000000)">
<path
d="M8.07180144,11.9084727 C6.40362144,11.5368327 4.58970144,10.5255927 3.02895144,8.9648427 C1.46799144,7.4038827 0.456751444,5.5899327 0.0851414439,3.9216927 C-0.245458556,2.4375327 0.406261444,0.907472703 1.70058144,0.109472703 C1.99071144,-0.0694172966 2.36574144,-0.0255272966 2.60676144,0.215492703 L4.39683144,2.0055627 C4.73262144,2.3413527 4.66698144,2.9026227 4.26273144,3.1518327 L3.53127144,3.6028227 C3.22428144,3.7920927 3.09930144,4.1759127 3.23709144,4.5091827 C3.53616144,5.2324527 4.07655144,6.2334627 5.04375144,7.1640027 C5.90889144,7.9963227 6.81060144,8.4789627 7.48737144,8.7581127 C7.81959144,8.8951527 8.20224144,8.7687327 8.39085144,8.4628227 L8.84199144,7.7310927 C9.09123144,7.3268427 9.65247144,7.2612027 9.98826144,7.5969927 L11.7780614,9.3867927 C12.0190814,9.6278127 12.0629414,10.0028427 11.8840814,10.2929727 C11.0860214,11.5873227 9.55596144,12.2391027 8.07180144,11.9084727 Z"
id="Path"
fill="#9398A5"
- 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 71.
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