nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

Function Icon has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export default function Icon({ files, error, isDragOver, value, uploadIcon }) {
    if (value !== null) {
        if (!isDragOver) {
            if (error) {
                return <ErrorIcon />;
Severity: Minor
Found in src/components/FileSelector/icon.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

        values.forEach((value, index) => {
            const { result } = renderHook(() => useMarkdownToReact(value));
            expect(ReactDOMServer.renderToString(result.current)).toMatch(patterns[index]);
        });
src/components/MarkdownOutput/hooks/__test__/useMarkdownToReact.spec.js on lines 23..26
src/components/MarkdownOutput/hooks/__test__/useMarkdownToReact.spec.js on lines 39..42
src/components/MarkdownOutput/hooks/__test__/useMarkdownToReact.spec.js on lines 63..66

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

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

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

        values.forEach((value, index) => {
            const { result } = renderHook(() => useMarkdownToReact(value));
            expect(ReactDOMServer.renderToString(result.current)).toMatch(patterns[index]);
        });
src/components/MarkdownOutput/hooks/__test__/useMarkdownToReact.spec.js on lines 39..42
src/components/MarkdownOutput/hooks/__test__/useMarkdownToReact.spec.js on lines 63..66
src/components/MarkdownOutput/hooks/__test__/useMarkdownToReact.spec.js on lines 81..84

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

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

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

        values.forEach((value, index) => {
            const { result } = renderHook(() => useMarkdownToReact(value));
            expect(ReactDOMServer.renderToString(result.current)).toMatch(patterns[index]);
        });
src/components/MarkdownOutput/hooks/__test__/useMarkdownToReact.spec.js on lines 23..26
src/components/MarkdownOutput/hooks/__test__/useMarkdownToReact.spec.js on lines 63..66
src/components/MarkdownOutput/hooks/__test__/useMarkdownToReact.spec.js on lines 81..84

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

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

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

        values.forEach((value, index) => {
            const { result } = renderHook(() => useMarkdownToReact(value));
            expect(ReactDOMServer.renderToString(result.current)).toMatch(patterns[index]);
        });
src/components/MarkdownOutput/hooks/__test__/useMarkdownToReact.spec.js on lines 23..26
src/components/MarkdownOutput/hooks/__test__/useMarkdownToReact.spec.js on lines 39..42
src/components/MarkdownOutput/hooks/__test__/useMarkdownToReact.spec.js on lines 81..84

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

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 8 locations. Consider refactoring.
Open

describe('<ProgressBarExample/>', () => {
    it('should render the ProgressBar', () => {
        const component = shallow(<ProgressBarExample />);
        expect(component.find(ProgressBar).exists()).toBe(true);
    });
examples/create-react-app/src/pages/Avatar/__test__/avatar.spec.js on lines 6..11
examples/create-react-app/src/pages/Badge/__test__/badge.spec.js on lines 6..11
examples/create-react-app/src/pages/Button/__test__/button.spec.js on lines 6..11
examples/create-react-app/src/pages/ButtonIcon/__test__/buttonIcon.spec.js on lines 6..11
examples/create-react-app/src/pages/Card/__test__/card.spec.js on lines 6..11
examples/create-react-app/src/pages/Input/__test__/input.spec.js on lines 6..11
examples/create-react-app/src/pages/Spinner/__test__/spinner.spec.js on lines 6..11

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

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 8 locations. Consider refactoring.
Open

describe('<SpinnerExample/>', () => {
    it('should render the Spinner', () => {
        const component = shallow(<SpinnerExample />);
        expect(component.find(Spinner).exists()).toBe(true);
    });
examples/create-react-app/src/pages/Avatar/__test__/avatar.spec.js on lines 6..11
examples/create-react-app/src/pages/Badge/__test__/badge.spec.js on lines 6..11
examples/create-react-app/src/pages/Button/__test__/button.spec.js on lines 6..11
examples/create-react-app/src/pages/ButtonIcon/__test__/buttonIcon.spec.js on lines 6..11
examples/create-react-app/src/pages/Card/__test__/card.spec.js on lines 6..11
examples/create-react-app/src/pages/Input/__test__/input.spec.js on lines 6..11
examples/create-react-app/src/pages/ProgressBar/__test__/progressBar.spec.js on lines 6..11

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

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 8 locations. Consider refactoring.
Open

describe('<CardExample/>', () => {
    it('should render the Card', () => {
        const component = shallow(<CardExample />);
        expect(component.find(Card).exists()).toBe(true);
    });
examples/create-react-app/src/pages/Avatar/__test__/avatar.spec.js on lines 6..11
examples/create-react-app/src/pages/Badge/__test__/badge.spec.js on lines 6..11
examples/create-react-app/src/pages/Button/__test__/button.spec.js on lines 6..11
examples/create-react-app/src/pages/ButtonIcon/__test__/buttonIcon.spec.js on lines 6..11
examples/create-react-app/src/pages/Input/__test__/input.spec.js on lines 6..11
examples/create-react-app/src/pages/ProgressBar/__test__/progressBar.spec.js on lines 6..11
examples/create-react-app/src/pages/Spinner/__test__/spinner.spec.js on lines 6..11

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

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 8 locations. Consider refactoring.
Open

describe('<AvatarExample/>', () => {
    it('should render the avatar', () => {
        const component = shallow(<AvatarExample />);
        expect(component.find(Avatar).exists()).toBe(true);
    });
examples/create-react-app/src/pages/Badge/__test__/badge.spec.js on lines 6..11
examples/create-react-app/src/pages/Button/__test__/button.spec.js on lines 6..11
examples/create-react-app/src/pages/ButtonIcon/__test__/buttonIcon.spec.js on lines 6..11
examples/create-react-app/src/pages/Card/__test__/card.spec.js on lines 6..11
examples/create-react-app/src/pages/Input/__test__/input.spec.js on lines 6..11
examples/create-react-app/src/pages/ProgressBar/__test__/progressBar.spec.js on lines 6..11
examples/create-react-app/src/pages/Spinner/__test__/spinner.spec.js on lines 6..11

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

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 8 locations. Consider refactoring.
Open

describe('<ButtonExample/>', () => {
    it('should render the Button', () => {
        const component = shallow(<ButtonExample />);
        expect(component.find(Button).exists()).toBe(true);
    });
examples/create-react-app/src/pages/Avatar/__test__/avatar.spec.js on lines 6..11
examples/create-react-app/src/pages/Badge/__test__/badge.spec.js on lines 6..11
examples/create-react-app/src/pages/ButtonIcon/__test__/buttonIcon.spec.js on lines 6..11
examples/create-react-app/src/pages/Card/__test__/card.spec.js on lines 6..11
examples/create-react-app/src/pages/Input/__test__/input.spec.js on lines 6..11
examples/create-react-app/src/pages/ProgressBar/__test__/progressBar.spec.js on lines 6..11
examples/create-react-app/src/pages/Spinner/__test__/spinner.spec.js on lines 6..11

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

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 8 locations. Consider refactoring.
Open

describe('<BadgeExample/>', () => {
    it('should render the badge', () => {
        const component = shallow(<BadgeExample />);
        expect(component.find(Badge).exists()).toBe(true);
    });
examples/create-react-app/src/pages/Avatar/__test__/avatar.spec.js on lines 6..11
examples/create-react-app/src/pages/Button/__test__/button.spec.js on lines 6..11
examples/create-react-app/src/pages/ButtonIcon/__test__/buttonIcon.spec.js on lines 6..11
examples/create-react-app/src/pages/Card/__test__/card.spec.js on lines 6..11
examples/create-react-app/src/pages/Input/__test__/input.spec.js on lines 6..11
examples/create-react-app/src/pages/ProgressBar/__test__/progressBar.spec.js on lines 6..11
examples/create-react-app/src/pages/Spinner/__test__/spinner.spec.js on lines 6..11

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

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 8 locations. Consider refactoring.
Open

describe('<InputExample/>', () => {
    it('should render the Input', () => {
        const component = shallow(<InputExample />);
        expect(component.find(Input).exists()).toBe(true);
    });
examples/create-react-app/src/pages/Avatar/__test__/avatar.spec.js on lines 6..11
examples/create-react-app/src/pages/Badge/__test__/badge.spec.js on lines 6..11
examples/create-react-app/src/pages/Button/__test__/button.spec.js on lines 6..11
examples/create-react-app/src/pages/ButtonIcon/__test__/buttonIcon.spec.js on lines 6..11
examples/create-react-app/src/pages/Card/__test__/card.spec.js on lines 6..11
examples/create-react-app/src/pages/ProgressBar/__test__/progressBar.spec.js on lines 6..11
examples/create-react-app/src/pages/Spinner/__test__/spinner.spec.js on lines 6..11

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

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 8 locations. Consider refactoring.
Open

describe('<ButtonIconExample/>', () => {
    it('should render the ButtonIcon', () => {
        const component = shallow(<ButtonIconExample />);
        expect(component.find(ButtonIcon).exists()).toBe(true);
    });
examples/create-react-app/src/pages/Avatar/__test__/avatar.spec.js on lines 6..11
examples/create-react-app/src/pages/Badge/__test__/badge.spec.js on lines 6..11
examples/create-react-app/src/pages/Button/__test__/button.spec.js on lines 6..11
examples/create-react-app/src/pages/Card/__test__/card.spec.js on lines 6..11
examples/create-react-app/src/pages/Input/__test__/input.spec.js on lines 6..11
examples/create-react-app/src/pages/ProgressBar/__test__/progressBar.spec.js on lines 6..11
examples/create-react-app/src/pages/Spinner/__test__/spinner.spec.js on lines 6..11

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

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

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

        const component = mount(
            <Table data={tableData} showCheckboxColumn keyField="id">
                <Column field="name" header="Name" />
                <Column field="id" header="ID" />
            </Table>,
Severity: Major
Found in src/components/Table/__test__/table.spec.js and 1 other location - About 1 hr to fix
src/components/Table/__test__/table.spec.js on lines 1080..1085

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

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

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

        const component = mount(
            <Table data={tableData} showCheckboxColumn keyField="id">
                <Column field="name" header="Name" />
                <Column field="id" header="ID" />
            </Table>,
Severity: Major
Found in src/components/Table/__test__/table.spec.js and 1 other location - About 1 hr to fix
src/components/Table/__test__/table.spec.js on lines 1054..1059

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

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 3 locations. Consider refactoring.
Open

    it('should set isVisible to false in Marker when there is an invalid option selected initially', () => {
        const component = mount(<RadioButtonGroup options={options} value="apple juice" />);
        expect(component.find('Marker').prop('isVisible')).toBe(false);
    });
src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 13..16
src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 17..20

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

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 3 locations. Consider refactoring.
Open

export const StyledCountryCode = styled.div`
    flex: 0 0 auto;
    padding: 0 8px 0 8px;
    line-height: 2.2rem;
    ${props =>
Severity: Major
Found in src/components/PhoneInput/styled/index.js and 2 other locations - About 1 hr to fix
src/components/DatePickerModal/styled/index.js on lines 35..49
src/components/PhoneInput/styled/index.js on lines 19..35

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

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 3 locations. Consider refactoring.
Open

    it('should set isVisible to true in Marker when there is an option selected initially', () => {
        const component = mount(<RadioButtonGroup options={options} value="user" />);
        expect(component.find('Marker').prop('isVisible')).toBe(true);
    });
src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 17..20
src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 21..24

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

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 3 locations. Consider refactoring.
Open

export const Header = styled.header`
    display: flex;
    align-items: stretch;
    padding: 4px 48px 8px 20px;
    ${props =>
Severity: Major
Found in src/components/DatePickerModal/styled/index.js and 2 other locations - About 1 hr to fix
src/components/PhoneInput/styled/index.js on lines 3..17
src/components/PhoneInput/styled/index.js on lines 19..35

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

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 3 locations. Consider refactoring.
Open

                <g id="Paper">
                    <path
                        id="fill3"
                        opacity="0.4"
                        d="M50.1568 24.0547C48.9528 24.0547 47.358 24.028 45.3724 24.028C40.5299 24.028 36.5481 20.02 36.5481 15.132V6.55603C36.5481 5.88136 36.0095 5.33203 35.3414 5.33203H21.2363C14.6538 5.33203 9.33333 10.7347 9.33333 17.356V46.0894C9.33333 53.036 14.9073 58.6654 21.7855 58.6654H42.7901C49.3489 58.6654 54.6667 53.2974 54.6667 46.6707V25.2547C54.6667 24.5774 54.1307 24.0307 53.46 24.0334C52.3325 24.0414 50.9806 24.0547 50.1568 24.0547Z"
Severity: Major
Found in src/components/ImportRecordsFlow/icons/csvIcon.js and 2 other locations - About 1 hr to fix
src/components/ImportRecordsFlow/icons/mergeFiles.js on lines 39..52
src/components/ImportRecordsFlow/icons/mergeFiles.js on lines 53..66

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

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

Severity
Category
Status
Source
Language