nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

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

    it('should return the InputRadio component when type radio is passed', () => {
        const component = mount(<Input type="radio" />);
        expect(component.find('InputRadio').exists()).toBe(true);
    });
Severity: Major
Found in src/components/Input/__test__/input.spec.js and 14 other locations - About 1 hr to fix
src/components/AssistiveText/__test__/assistiveText.spec.js on lines 6..9
src/components/Avatar/__test__/avatarContent.spec.js on lines 7..10
src/components/Avatar/__test__/avatarContent.spec.js on lines 19..22
src/components/Breadcrumb/__test__/breadcrumb.spec.js on lines 12..16
src/components/GMap/__test__/component.spec.js on lines 28..31
src/components/ImportRecordsFlow/stepOne/__test__/stepOne.spec.js on lines 9..12
src/components/ImportRecordsFlow/stepOne/__test__/stepOne.spec.js on lines 13..16
src/components/Input/__test__/input.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 14..17
src/components/Notification/__test__/icon.spec.js on lines 18..21
src/components/Notification/__test__/icon.spec.js on lines 22..25
src/components/Notification/__test__/icon.spec.js on lines 27..30
src/components/TimePicker/__test__/ampmSelect.spec.js on lines 6..9

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

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

    it('should render the "SuccessIcon" when the string "success" is passed as icon', () => {
        const component = mount(<Icon icon="success" />);
        expect(component.find('SuccessIcon').exists()).toBe(true);
    });
Severity: Major
Found in src/components/Notification/__test__/icon.spec.js and 14 other locations - About 1 hr to fix
src/components/AssistiveText/__test__/assistiveText.spec.js on lines 6..9
src/components/Avatar/__test__/avatarContent.spec.js on lines 7..10
src/components/Avatar/__test__/avatarContent.spec.js on lines 19..22
src/components/Breadcrumb/__test__/breadcrumb.spec.js on lines 12..16
src/components/GMap/__test__/component.spec.js on lines 28..31
src/components/ImportRecordsFlow/stepOne/__test__/stepOne.spec.js on lines 9..12
src/components/ImportRecordsFlow/stepOne/__test__/stepOne.spec.js on lines 13..16
src/components/Input/__test__/input.spec.js on lines 6..9
src/components/Input/__test__/input.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 14..17
src/components/Notification/__test__/icon.spec.js on lines 18..21
src/components/Notification/__test__/icon.spec.js on lines 27..30
src/components/TimePicker/__test__/ampmSelect.spec.js on lines 6..9

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

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

    it('should render StyledPickerInput when readOnly is not passed', () => {
        const component = mount(<Input label="Input label" />);
        expect(component.find(StyledPickerInput).exists()).toBe(true);
    });
Severity: Major
Found in src/components/Input/pickerInput/__test__/input.spec.js and 16 other locations - About 1 hr to fix
src/components/ButtonGroupPicker/__test__/buttonGroupPicker.spec.js on lines 47..50
src/components/ButtonIcon/__test__/buttonIcon.spec.js on lines 65..68
src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 55..58
src/components/CodeInput/__test__/codeInput.spec.js on lines 39..42
src/components/CodeInput/__test__/codeInput.spec.js on lines 47..50
src/components/FileSelector/__test__/fileSelector.spec.js on lines 57..60
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 12..15
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 17..20
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 22..25
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 27..30
src/components/Option/__test__/option.spec.js on lines 131..134
src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 60..63
src/components/RadioGroup/__test__/radioGroup.spec.js on lines 39..42
src/components/Rating/__test__/rating.spec.js on lines 20..23
src/components/Slider/__test__/slider.spec.js on lines 34..37
src/components/WeekDayPicker/__test__/weekDayPicker.spec.js on lines 51..54

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

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

    it('should have error rendered if is sent as param', () => {
        const component = mount(<CodeInput error="error-test" />);
        expect(component.find(StyledErrorMessage).exists()).toBe(true);
    });
Severity: Major
Found in src/components/CodeInput/__test__/codeInput.spec.js and 16 other locations - About 1 hr to fix
src/components/ButtonGroupPicker/__test__/buttonGroupPicker.spec.js on lines 47..50
src/components/ButtonIcon/__test__/buttonIcon.spec.js on lines 65..68
src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 55..58
src/components/CodeInput/__test__/codeInput.spec.js on lines 39..42
src/components/FileSelector/__test__/fileSelector.spec.js on lines 57..60
src/components/Input/pickerInput/__test__/input.spec.js on lines 82..85
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 12..15
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 17..20
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 22..25
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 27..30
src/components/Option/__test__/option.spec.js on lines 131..134
src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 60..63
src/components/RadioGroup/__test__/radioGroup.spec.js on lines 39..42
src/components/Rating/__test__/rating.spec.js on lines 20..23
src/components/Slider/__test__/slider.spec.js on lines 34..37
src/components/WeekDayPicker/__test__/weekDayPicker.spec.js on lines 51..54

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

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

    it('should render a label when label prop is passed', () => {
        const component = mount(<RadioButtonGroup label="RadioButtonGroup Label" />);
        expect(component.find(StyledLabel).exists()).toBe(true);
    });
src/components/ButtonGroupPicker/__test__/buttonGroupPicker.spec.js on lines 47..50
src/components/ButtonIcon/__test__/buttonIcon.spec.js on lines 65..68
src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 55..58
src/components/CodeInput/__test__/codeInput.spec.js on lines 39..42
src/components/CodeInput/__test__/codeInput.spec.js on lines 47..50
src/components/FileSelector/__test__/fileSelector.spec.js on lines 57..60
src/components/Input/pickerInput/__test__/input.spec.js on lines 82..85
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 12..15
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 17..20
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 22..25
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 27..30
src/components/Option/__test__/option.spec.js on lines 131..134
src/components/RadioGroup/__test__/radioGroup.spec.js on lines 39..42
src/components/Rating/__test__/rating.spec.js on lines 20..23
src/components/Slider/__test__/slider.spec.js on lines 34..37
src/components/WeekDayPicker/__test__/weekDayPicker.spec.js on lines 51..54

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

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

    it('should have bottomHelpText rendered if is sent as param', () => {
        const component = mount(<CodeInput bottomHelpText="help-text-test" />);
        expect(component.find(StyledHelpText).exists()).toBe(true);
    });
Severity: Major
Found in src/components/CodeInput/__test__/codeInput.spec.js and 16 other locations - About 1 hr to fix
src/components/ButtonGroupPicker/__test__/buttonGroupPicker.spec.js on lines 47..50
src/components/ButtonIcon/__test__/buttonIcon.spec.js on lines 65..68
src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 55..58
src/components/CodeInput/__test__/codeInput.spec.js on lines 47..50
src/components/FileSelector/__test__/fileSelector.spec.js on lines 57..60
src/components/Input/pickerInput/__test__/input.spec.js on lines 82..85
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 12..15
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 17..20
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 22..25
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 27..30
src/components/Option/__test__/option.spec.js on lines 131..134
src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 60..63
src/components/RadioGroup/__test__/radioGroup.spec.js on lines 39..42
src/components/Rating/__test__/rating.spec.js on lines 20..23
src/components/Slider/__test__/slider.spec.js on lines 34..37
src/components/WeekDayPicker/__test__/weekDayPicker.spec.js on lines 51..54

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

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

    it('should render a label when label prop is passed', () => {
        const component = mount(<CheckboxGroup label="CheckboxGroup Label" />);
        expect(component.find(StyledLabel).exists()).toBe(true);
    });
src/components/ButtonGroupPicker/__test__/buttonGroupPicker.spec.js on lines 47..50
src/components/ButtonIcon/__test__/buttonIcon.spec.js on lines 65..68
src/components/CodeInput/__test__/codeInput.spec.js on lines 39..42
src/components/CodeInput/__test__/codeInput.spec.js on lines 47..50
src/components/FileSelector/__test__/fileSelector.spec.js on lines 57..60
src/components/Input/pickerInput/__test__/input.spec.js on lines 82..85
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 12..15
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 17..20
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 22..25
src/components/MultiSelect/__test__/multiSelect.spec.js on lines 27..30
src/components/Option/__test__/option.spec.js on lines 131..134
src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 60..63
src/components/RadioGroup/__test__/radioGroup.spec.js on lines 39..42
src/components/Rating/__test__/rating.spec.js on lines 20..23
src/components/Slider/__test__/slider.spec.js on lines 34..37
src/components/WeekDayPicker/__test__/weekDayPicker.spec.js on lines 51..54

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

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

    it('should not render a Select when actionOption is set to other value than "merge-records"', () => {
        const component = mount(<StepOne actionOption="add-records" />);
        expect(component.find('Select').exists()).toBe(false);
    });
src/components/AssistiveText/__test__/assistiveText.spec.js on lines 6..9
src/components/Avatar/__test__/avatarContent.spec.js on lines 7..10
src/components/Avatar/__test__/avatarContent.spec.js on lines 19..22
src/components/Breadcrumb/__test__/breadcrumb.spec.js on lines 12..16
src/components/GMap/__test__/component.spec.js on lines 28..31
src/components/ImportRecordsFlow/stepOne/__test__/stepOne.spec.js on lines 9..12
src/components/Input/__test__/input.spec.js on lines 6..9
src/components/Input/__test__/input.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 14..17
src/components/Notification/__test__/icon.spec.js on lines 18..21
src/components/Notification/__test__/icon.spec.js on lines 22..25
src/components/Notification/__test__/icon.spec.js on lines 27..30
src/components/TimePicker/__test__/ampmSelect.spec.js on lines 6..9

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

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

    it('should render the "ErrorIcon" when the string "error" is passed as icon', () => {
        const component = mount(<Icon icon="error" />);
        expect(component.find('ErrorIcon').exists()).toBe(true);
    });
Severity: Major
Found in src/components/Notification/__test__/icon.spec.js and 14 other locations - About 1 hr to fix
src/components/AssistiveText/__test__/assistiveText.spec.js on lines 6..9
src/components/Avatar/__test__/avatarContent.spec.js on lines 7..10
src/components/Avatar/__test__/avatarContent.spec.js on lines 19..22
src/components/Breadcrumb/__test__/breadcrumb.spec.js on lines 12..16
src/components/GMap/__test__/component.spec.js on lines 28..31
src/components/ImportRecordsFlow/stepOne/__test__/stepOne.spec.js on lines 9..12
src/components/ImportRecordsFlow/stepOne/__test__/stepOne.spec.js on lines 13..16
src/components/Input/__test__/input.spec.js on lines 6..9
src/components/Input/__test__/input.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 18..21
src/components/Notification/__test__/icon.spec.js on lines 22..25
src/components/Notification/__test__/icon.spec.js on lines 27..30
src/components/TimePicker/__test__/ampmSelect.spec.js on lines 6..9

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

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

    it('should render the right markup when isFocused prop is false', () => {
        const component = mount(<AmPmSelect tabIndex="-1" />);
        expect(component.find('input[aria-label="am-pm selector"]').exists()).toBe(true);
    });
Severity: Major
Found in src/components/TimePicker/__test__/ampmSelect.spec.js and 14 other locations - About 1 hr to fix
src/components/AssistiveText/__test__/assistiveText.spec.js on lines 6..9
src/components/Avatar/__test__/avatarContent.spec.js on lines 7..10
src/components/Avatar/__test__/avatarContent.spec.js on lines 19..22
src/components/Breadcrumb/__test__/breadcrumb.spec.js on lines 12..16
src/components/GMap/__test__/component.spec.js on lines 28..31
src/components/ImportRecordsFlow/stepOne/__test__/stepOne.spec.js on lines 9..12
src/components/ImportRecordsFlow/stepOne/__test__/stepOne.spec.js on lines 13..16
src/components/Input/__test__/input.spec.js on lines 6..9
src/components/Input/__test__/input.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 14..17
src/components/Notification/__test__/icon.spec.js on lines 18..21
src/components/Notification/__test__/icon.spec.js on lines 22..25
src/components/Notification/__test__/icon.spec.js on lines 27..30

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

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

    it('should render a Select when actionOption is set to "merge-records"', () => {
        const component = mount(<StepOne actionOption="merge-records" />);
        expect(component.find('Select').exists()).toBe(true);
    });
src/components/AssistiveText/__test__/assistiveText.spec.js on lines 6..9
src/components/Avatar/__test__/avatarContent.spec.js on lines 7..10
src/components/Avatar/__test__/avatarContent.spec.js on lines 19..22
src/components/Breadcrumb/__test__/breadcrumb.spec.js on lines 12..16
src/components/GMap/__test__/component.spec.js on lines 28..31
src/components/ImportRecordsFlow/stepOne/__test__/stepOne.spec.js on lines 13..16
src/components/Input/__test__/input.spec.js on lines 6..9
src/components/Input/__test__/input.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 14..17
src/components/Notification/__test__/icon.spec.js on lines 18..21
src/components/Notification/__test__/icon.spec.js on lines 22..25
src/components/Notification/__test__/icon.spec.js on lines 27..30
src/components/TimePicker/__test__/ampmSelect.spec.js on lines 6..9

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

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

    it('should render the "WarningIcon" when the string "warning" is passed as icon', () => {
        const component = mount(<Icon icon="warning" />);
        expect(component.find('WarningIcon').exists()).toBe(true);
    });
Severity: Major
Found in src/components/Notification/__test__/icon.spec.js and 14 other locations - About 1 hr to fix
src/components/AssistiveText/__test__/assistiveText.spec.js on lines 6..9
src/components/Avatar/__test__/avatarContent.spec.js on lines 7..10
src/components/Avatar/__test__/avatarContent.spec.js on lines 19..22
src/components/Breadcrumb/__test__/breadcrumb.spec.js on lines 12..16
src/components/GMap/__test__/component.spec.js on lines 28..31
src/components/ImportRecordsFlow/stepOne/__test__/stepOne.spec.js on lines 9..12
src/components/ImportRecordsFlow/stepOne/__test__/stepOne.spec.js on lines 13..16
src/components/Input/__test__/input.spec.js on lines 6..9
src/components/Input/__test__/input.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 10..13
src/components/Notification/__test__/icon.spec.js on lines 14..17
src/components/Notification/__test__/icon.spec.js on lines 22..25
src/components/Notification/__test__/icon.spec.js on lines 27..30
src/components/TimePicker/__test__/ampmSelect.spec.js on lines 6..9

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

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 render the datetime passed', () => {
        const component = mount(<BasicTimelineMarker datetime="Yesterday" />);
        expect(component.find(StyledDatetime).text()).toBe('Yesterday');
    });
src/components/TimelineMarker/__test__/basicTimelineMarker.spec.js on lines 27..30
src/components/TimelineMarker/__test__/basicTimelineMarker.spec.js on lines 35..42

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

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 render the description passed', () => {
        const component = mount(
            <BasicTimelineMarker description="testing description on TimelineMarker" />,
        );
        expect(component.find(StyledDescription).text()).toBe(
src/components/TimelineMarker/__test__/basicTimelineMarker.spec.js on lines 27..30
src/components/TimelineMarker/__test__/basicTimelineMarker.spec.js on lines 31..34

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

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 render the children passed', () => {
        const component = mount(<VerticalSection>the children text</VerticalSection>);
        expect(component.find('ul').text()).toBe('the children text');
    });
src/components/Badge/__tests__/badge.spec.js on lines 10..13
src/components/Badge/__tests__/content.spec.js on lines 26..29

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

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 render the label passed', () => {
        const component = mount(<BasicTimelineMarker label="testing label on TimelineMarker" />);
        expect(component.find(StyledLabel).text()).toBe('testing label on TimelineMarker');
    });
src/components/TimelineMarker/__test__/basicTimelineMarker.spec.js on lines 31..34
src/components/TimelineMarker/__test__/basicTimelineMarker.spec.js on lines 35..42

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

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 return children when label is not passed', () => {
        const component = mount(<Content>Children in Content</Content>);
        expect(component.find('span').text()).toBe('Children in Content');
    });
Severity: Major
Found in src/components/Badge/__tests__/content.spec.js and 2 other locations - About 1 hr to fix
src/components/Badge/__tests__/badge.spec.js on lines 10..13
src/components/VerticalSection/__test__/verticalSection.spec.js on lines 11..14

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

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 render the "Badge" with the children passed', () => {
        const component = mount(<Badge>Testing children in Badge</Badge>);
        expect(component.find('Content').text()).toBe('Testing children in Badge');
    });
Severity: Major
Found in src/components/Badge/__tests__/badge.spec.js and 2 other locations - About 1 hr to fix
src/components/Badge/__tests__/content.spec.js on lines 26..29
src/components/VerticalSection/__test__/verticalSection.spec.js on lines 11..14

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

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

const Heading = ({ level, children }) => {
    return (
        <StyledHeading as={`h${level}`} level={level}>
            {children}
        </StyledHeading>
Severity: Major
Found in src/components/MarkdownOutput/renderers/index.js and 1 other location - About 1 hr to fix
src/components/MarkdownOutput/renderers/index.js on lines 33..39

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

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

    it('should call disableBodyScroll when open the drawer', () => {
        mount(
            <Drawer isOpen>
                <p />
            </Drawer>,
Severity: Major
Found in src/components/Drawer/__test__/drawer.spec.js and 1 other location - About 1 hr to fix
src/components/Modal/__test__/modal.spec.js on lines 126..133

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

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