bastienrobert/la-ferme

View on GitHub
packages/components/src/elements/Button/Background.native.tsx

Summary

Maintainability
A
0 mins
Test Coverage

Similar blocks of code found in 2 locations. Consider refactoring.
Invalid

const Background: FC<ButtonBackgroundProps> = ({ color }) => {
  return (
    <SVG viewBox="0 0 111 44" preserveAspectRatio="none">
      <Path
        d="M111 22.0215C111 11.8364 106.069 3.25938 99.6136 1.38317C96.2962 -0.493044 73.7923 0.311048 68.5922 0.311048C65.9025 0.311048 59.5369 0.713093 53.6195 0.981124H36.764C31.026 0.579078 21.8809 0.311048 20.5361 0.0430172C18.6533 -0.225013 12.9152 0.847108 12.9152 0.847108C11.0325 0.981124 9.32897 2.05325 7.89446 3.25938C6.5496 4.3315 5.38406 5.67166 4.30818 7.14582C3.77023 7.94991 3.32195 8.48598 3.05298 8.61999C1.97709 9.5581 -0.89193 15.5888 0.273611 25.7739C1.17018 33.8148 3.85989 36.8972 5.11509 37.9693C7.62548 41.1857 10.7635 43.0619 14.2601 43.0619H15.7843C20.9844 43.732 28.0673 44 30.6673 44C34.6122 44 77.1993 42.7939 80.9649 43.598C84.8202 44.402 98.8963 43.0619 98.8963 43.0619C98.8963 43.0619 110.731 40.1136 110.731 25.1039C110.91 23.8977 111 22.9596 111 22.0215Z"
packages/components/src/elements/Icon/Background.native.tsx on lines 9..18

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 79.

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

Further Reading

There are no issues that match your filters.

Category
Status