nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

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

function SvgQatar({ className, style }) {
    return (
        <svg width={32} height={32} viewBox="0 0 32 32" className={className} style={style}>
            <g fillRule="nonzero" fill="none">
                <circle fill="#F0F0F0" cx={16} cy={16} r={16} />
Severity: Major
Found in src/components/PhoneInput/flags/Qatar.js and 11 other locations - About 5 hrs to fix
src/components/PhoneInput/flags/Bahrain.js on lines 4..16
src/components/PhoneInput/flags/Finland.js on lines 4..16
src/components/PhoneInput/flags/Indonesia.js on lines 4..13
src/components/PhoneInput/flags/IsleOfMan.js on lines 4..16
src/components/PhoneInput/flags/Monaco.js on lines 4..13
src/components/PhoneInput/flags/Morocco.js on lines 4..16
src/components/PhoneInput/flags/Poland.js on lines 4..13
src/components/PhoneInput/flags/Somalia.js on lines 4..16
src/components/PhoneInput/flags/Switzerland.js on lines 4..16
src/components/PhoneInput/flags/Ukraine.js on lines 4..13
src/components/PhoneInput/flags/Vietnam.js on lines 4..16

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

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

function SvgSwitzerland({ className, style }) {
    return (
        <svg width={32} height={32} viewBox="0 0 32 32" className={className} style={style}>
            <g fillRule="nonzero" fill="none">
                <circle fill="#D80027" cx={16} cy={16} r={16} />
Severity: Major
Found in src/components/PhoneInput/flags/Switzerland.js and 11 other locations - About 5 hrs to fix
src/components/PhoneInput/flags/Bahrain.js on lines 4..16
src/components/PhoneInput/flags/Finland.js on lines 4..16
src/components/PhoneInput/flags/Indonesia.js on lines 4..13
src/components/PhoneInput/flags/IsleOfMan.js on lines 4..16
src/components/PhoneInput/flags/Monaco.js on lines 4..13
src/components/PhoneInput/flags/Morocco.js on lines 4..16
src/components/PhoneInput/flags/Poland.js on lines 4..13
src/components/PhoneInput/flags/Qatar.js on lines 4..16
src/components/PhoneInput/flags/Somalia.js on lines 4..16
src/components/PhoneInput/flags/Ukraine.js on lines 4..13
src/components/PhoneInput/flags/Vietnam.js on lines 4..16

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

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

function SvgUkraine({ className, style }) {
    return (
        <svg width={32} height={32} viewBox="0 0 32 32" className={className} style={style}>
            <g fillRule="nonzero" fill="none">
                <circle fill="#FFDA44" cx={16} cy={16} r={16} />
Severity: Major
Found in src/components/PhoneInput/flags/Ukraine.js and 11 other locations - About 5 hrs to fix
src/components/PhoneInput/flags/Bahrain.js on lines 4..16
src/components/PhoneInput/flags/Finland.js on lines 4..16
src/components/PhoneInput/flags/Indonesia.js on lines 4..13
src/components/PhoneInput/flags/IsleOfMan.js on lines 4..16
src/components/PhoneInput/flags/Monaco.js on lines 4..13
src/components/PhoneInput/flags/Morocco.js on lines 4..16
src/components/PhoneInput/flags/Poland.js on lines 4..13
src/components/PhoneInput/flags/Qatar.js on lines 4..16
src/components/PhoneInput/flags/Somalia.js on lines 4..16
src/components/PhoneInput/flags/Switzerland.js on lines 4..16
src/components/PhoneInput/flags/Vietnam.js on lines 4..16

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

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

function SvgMonaco({ className, style }) {
    return (
        <svg width={32} height={32} viewBox="0 0 32 32" className={className} style={style}>
            <g fillRule="nonzero" fill="none">
                <circle fill="#F0F0F0" cx={16} cy={16} r={16} />
Severity: Major
Found in src/components/PhoneInput/flags/Monaco.js and 11 other locations - About 5 hrs to fix
src/components/PhoneInput/flags/Bahrain.js on lines 4..16
src/components/PhoneInput/flags/Finland.js on lines 4..16
src/components/PhoneInput/flags/Indonesia.js on lines 4..13
src/components/PhoneInput/flags/IsleOfMan.js on lines 4..16
src/components/PhoneInput/flags/Morocco.js on lines 4..16
src/components/PhoneInput/flags/Poland.js on lines 4..13
src/components/PhoneInput/flags/Qatar.js on lines 4..16
src/components/PhoneInput/flags/Somalia.js on lines 4..16
src/components/PhoneInput/flags/Switzerland.js on lines 4..16
src/components/PhoneInput/flags/Ukraine.js on lines 4..13
src/components/PhoneInput/flags/Vietnam.js on lines 4..16

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

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

function SvgSomalia({ className, style }) {
    return (
        <svg width={32} height={32} viewBox="0 0 32 32" className={className} style={style}>
            <g fillRule="nonzero" fill="none">
                <circle fill="#338AF3" cx={16} cy={16} r={16} />
Severity: Major
Found in src/components/PhoneInput/flags/Somalia.js and 11 other locations - About 5 hrs to fix
src/components/PhoneInput/flags/Bahrain.js on lines 4..16
src/components/PhoneInput/flags/Finland.js on lines 4..16
src/components/PhoneInput/flags/Indonesia.js on lines 4..13
src/components/PhoneInput/flags/IsleOfMan.js on lines 4..16
src/components/PhoneInput/flags/Monaco.js on lines 4..13
src/components/PhoneInput/flags/Morocco.js on lines 4..16
src/components/PhoneInput/flags/Poland.js on lines 4..13
src/components/PhoneInput/flags/Qatar.js on lines 4..16
src/components/PhoneInput/flags/Switzerland.js on lines 4..16
src/components/PhoneInput/flags/Ukraine.js on lines 4..13
src/components/PhoneInput/flags/Vietnam.js on lines 4..16

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

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

function SvgVietnam({ className, style }) {
    return (
        <svg width={32} height={32} viewBox="0 0 32 32" className={className} style={style}>
            <g fillRule="nonzero" fill="none">
                <circle fill="#D80027" cx={16} cy={16} r={16} />
Severity: Major
Found in src/components/PhoneInput/flags/Vietnam.js and 11 other locations - About 5 hrs to fix
src/components/PhoneInput/flags/Bahrain.js on lines 4..16
src/components/PhoneInput/flags/Finland.js on lines 4..16
src/components/PhoneInput/flags/Indonesia.js on lines 4..13
src/components/PhoneInput/flags/IsleOfMan.js on lines 4..16
src/components/PhoneInput/flags/Monaco.js on lines 4..13
src/components/PhoneInput/flags/Morocco.js on lines 4..16
src/components/PhoneInput/flags/Poland.js on lines 4..13
src/components/PhoneInput/flags/Qatar.js on lines 4..16
src/components/PhoneInput/flags/Somalia.js on lines 4..16
src/components/PhoneInput/flags/Switzerland.js on lines 4..16
src/components/PhoneInput/flags/Ukraine.js on lines 4..13

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

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

function SvgMorocco({ className, style }) {
    return (
        <svg width={32} height={32} viewBox="0 0 32 32" className={className} style={style}>
            <g fillRule="nonzero" fill="none">
                <circle fill="#D80027" cx={16} cy={16} r={16} />
Severity: Major
Found in src/components/PhoneInput/flags/Morocco.js and 11 other locations - About 5 hrs to fix
src/components/PhoneInput/flags/Bahrain.js on lines 4..16
src/components/PhoneInput/flags/Finland.js on lines 4..16
src/components/PhoneInput/flags/Indonesia.js on lines 4..13
src/components/PhoneInput/flags/IsleOfMan.js on lines 4..16
src/components/PhoneInput/flags/Monaco.js on lines 4..13
src/components/PhoneInput/flags/Poland.js on lines 4..13
src/components/PhoneInput/flags/Qatar.js on lines 4..16
src/components/PhoneInput/flags/Somalia.js on lines 4..16
src/components/PhoneInput/flags/Switzerland.js on lines 4..16
src/components/PhoneInput/flags/Ukraine.js on lines 4..13
src/components/PhoneInput/flags/Vietnam.js on lines 4..16

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

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

function SvgFinland({ className, style }) {
    return (
        <svg width={32} height={32} viewBox="0 0 32 32" className={className} style={style}>
            <g fillRule="nonzero" fill="none">
                <circle fill="#F0F0F0" cx={16} cy={16} r={16} />
Severity: Major
Found in src/components/PhoneInput/flags/Finland.js and 11 other locations - About 5 hrs to fix
src/components/PhoneInput/flags/Bahrain.js on lines 4..16
src/components/PhoneInput/flags/Indonesia.js on lines 4..13
src/components/PhoneInput/flags/IsleOfMan.js on lines 4..16
src/components/PhoneInput/flags/Monaco.js on lines 4..13
src/components/PhoneInput/flags/Morocco.js on lines 4..16
src/components/PhoneInput/flags/Poland.js on lines 4..13
src/components/PhoneInput/flags/Qatar.js on lines 4..16
src/components/PhoneInput/flags/Somalia.js on lines 4..16
src/components/PhoneInput/flags/Switzerland.js on lines 4..16
src/components/PhoneInput/flags/Ukraine.js on lines 4..13
src/components/PhoneInput/flags/Vietnam.js on lines 4..16

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

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 {
        id,
        className,
        style,
        label,
Severity: Major
Found in src/components/MultiSelect/index.js and 1 other location - About 5 hrs to fix
src/components/TimePicker/index.js on lines 19..46

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

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 {
        placeholder,
        label,
        required,
        style,
Severity: Major
Found in src/components/TimePicker/index.js and 1 other location - About 5 hrs to fix
src/components/MultiSelect/index.js on lines 34..61

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

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

File lookup.spec.js has 386 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import { mount } from 'enzyme';
import ButtonIcon from '../../ButtonIcon';
import Lookup from '..';
import StyledTextError from '../../Input/styled/errorText';
Severity: Minor
Found in src/components/Lookup/__test__/lookup.spec.js - About 5 hrs to fix

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

    const Text = props => {
        const { className, style } = props;
        return (
            <svg className={className} style={style} width="328px" height="376px" viewBox="0 0 328 376">
                <g
    Severity: Major
    Found in library/exampleComponents/Icons/text.js and 2 other locations - About 5 hrs to fix
    library/exampleComponents/Icons/list.js on lines 4..24
    library/exampleComponents/Icons/one.js on lines 4..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 140.

    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

    const One = props => {
        const { className, style } = props;
        return (
            <svg className={className} style={style} width="81px" height="201px" viewBox="0 0 81 201">
                <g
    Severity: Major
    Found in library/exampleComponents/Icons/one.js and 2 other locations - About 5 hrs to fix
    library/exampleComponents/Icons/list.js on lines 4..24
    library/exampleComponents/Icons/text.js on lines 4..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 140.

    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

    const List = props => {
        const { className, style } = props;
        return (
            <svg className={className} style={style} width="461px" height="352px" viewBox="0 0 461 352">
                <g
    Severity: Major
    Found in library/exampleComponents/Icons/list.js and 2 other locations - About 5 hrs to fix
    library/exampleComponents/Icons/one.js on lines 4..24
    library/exampleComponents/Icons/text.js on lines 4..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 140.

    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 not open the modal when enter key or space key is pressed while input is focused and readOnly is passed', () => {
            const values = [ENTER_KEY, SPACE_KEY];
            values.forEach(value => {
                const component = mount(<TimePicker label="unit-testing-timePicker" readOnly />);
                const timePickerInput = component.find('input');
    Severity: Major
    Found in src/components/TimePicker/__test__/timePicker.spec.js and 1 other location - About 5 hrs to fix
    src/components/DateTimePicker/__test__/dateTimePicker.spec.js on lines 90..101

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

    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

                    <g
                        id="sidebar-component"
                        transform="translate(-157.000000, -820.000000)"
                        fillRule="nonzero"
                    >
    Severity: Major
    Found in library/exampleComponents/Icons/charts.js and 1 other location - About 5 hrs to fix
    library/exampleComponents/Icons/dashboardPurple.js on lines 22..47

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

    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 not open the modal when enter key or space key is pressed while input is focused and readOnly is passed', () => {
            const values = [ENTER_KEY, SPACE_KEY];
            values.forEach(keyCode => {
                const component = mount(
                    <DateTimePicker label="unit-testing-dateTimePicker" readOnly />,
    src/components/TimePicker/__test__/timePicker.spec.js on lines 75..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 140.

    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

                        <g id="Group-31" transform="translate(124.000000, 458.000000)">
                            <g id="Group-37" transform="translate(19.000000, 30.000000)">
                                <g id="dashboard" transform="translate(16.000000, 8.000000)">
                                    <path
                                        d="M7.0625,11 L0.625,11 C0.2798125,11 0,11.2798125 0,11.625 L0,15.375 C0,15.7201875 0.2798125,16 0.625,16 L7.0625,16 C7.4076875,16 7.6875,15.7201875 7.6875,15.375 L7.6875,11.625 C7.6875,11.2798125 7.4076875,11 7.0625,11 Z"
    Severity: Major
    Found in library/exampleComponents/Icons/dashboardPurple.js and 1 other location - About 5 hrs to fix
    library/exampleComponents/Icons/charts.js on lines 17..46

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

    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

    Function DatePicker has 130 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const DatePicker = React.forwardRef((props, ref) => {
        const {
            value,
            minDate,
            maxDate,
    Severity: Major
    Found in src/components/DatePicker/index.js - About 5 hrs to fix

      Function Drawer has 130 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function Drawer(props) {
          const {
              id,
              isOpen,
              hideCloseButton,
      Severity: Major
      Found in src/components/Drawer/index.js - About 5 hrs to fix
        Severity
        Category
        Status
        Source
        Language