nexxtway/react-rainbow

View on GitHub
src/components/HelpText/icons/error.js

Summary

Maintainability
A
2 hrs
Test Coverage

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

    return (
        <svg width={size} height={size} viewBox="0 0 22 22" className={className} style={style}>
            <path
                fill={background}
                d="M10.979 0c6.063 0 10.978 4.915 10.978 10.979 0 6.063-4.915 10.978-10.978 10.978C4.915 21.957 0 17.042 0 10.98 0 4.915 4.915 0 10.979 0zm.229 14.993c-.367 0-.676.127-.93.38-.252.253-.378.56-.378.92 0 .413.132.734.396.963.264.23.574.344.929.344.349 0 .654-.116.915-.348.262-.233.393-.552.393-.959 0-.36-.13-.668-.388-.92-.26-.253-.57-.38-.937-.38zm.07-10.593c-.413 0-.746.135-1 .406-.252.27-.378.646-.378 1.129 0 .354.026.938.078 1.752l.28 4.176c.051.54.139.944.261 1.208s.34.396.654.396c.307 0 .529-.136.662-.41.134-.273.222-.665.262-1.177l.375-4.298c.04-.394.06-.784.06-1.168 0-.65-.084-1.15-.252-1.495-.168-.346-.503-.519-1.003-.519z"
Severity: Major
Found in src/components/HelpText/icons/error.js and 1 other location - About 1 hr to fix
src/components/HelpText/icons/question.js on lines 11..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 67.

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

Similar blocks of code found in 4 locations. Consider refactoring.
Open

ErrorIcon.propTypes = {
    className: PropTypes.string,
    style: PropTypes.object,
    isFocused: PropTypes.bool,
    iconSize: PropTypes.oneOf(['small', 'medium']),
Severity: Major
Found in src/components/HelpText/icons/error.js and 3 other locations - About 1 hr to fix
src/components/HelpText/icons/info.js on lines 24..29
src/components/HelpText/icons/question.js on lines 20..25
src/components/HelpText/icons/warning.js on lines 20..25

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

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