nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

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

    it('should set as active the first option that is not a header when other is active and close the menu and open it again', async () => {
        const lookup = new PageLookup(LOOKUP);
        const logoElement = $(REACT_LOGO);
        await lookup.click();
        await lookup.setQuery('a');
Severity: Major
Found in integration/specs/Lookup/lookup-5.spec.js and 1 other location - About 1 day to fix
integration/specs/Lookup/lookup-1.spec.js on lines 98..113

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

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 index.js has 571 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable react/no-unused-prop-types */
import React, { useRef, useImperativeHandle, useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { useOutsideClick, useScrollingIntent } from '@rainbow-modules/hooks';
import Label from '../Input/label';
Severity: Major
Found in src/components/PhoneInput/index.js - About 1 day to fix

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

    describe('useRangeStartDate', () => {
        it('should return true', () => {
            const date = new Date(2019, 0, 1);
            const range = [new Date(2019, 0, 1), new Date(2019, 0, 15)];
            const { result } = renderHook(() => useRangeStartDate(date, range));
    src/components/Calendar/hooks/__test__/useRangeEndDate.spec.js on lines 4..25

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 229.

    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

    describe('useRangeEndDate', () => {
        it('should return true', () => {
            const date = new Date(2019, 0, 15);
            const range = [new Date(2019, 0, 1), new Date(2019, 0, 15)];
            const { result } = renderHook(() => useRangeEndDate(date, range));
    src/components/Calendar/hooks/__test__/useRangeStartDate.spec.js on lines 4..25

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 229.

    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 DoubleCalendar has 242 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function DoubleCalendar(props) {
        const {
            id,
            className,
            style,
    Severity: Major
    Found in src/components/Calendar/doubleCalendar/index.js - About 1 day to fix

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

      class PageTextarea {
          /**
           * Create a new Textarea page object.
           * @constructor
           * @param {string} rootElement - The selector of the Textarea root element.
      Severity: Major
      Found in src/components/Textarea/pageObject/index.js and 2 other locations - About 1 day to fix
      src/components/Input/pageObject/index.js on lines 5..67
      src/components/StrongPasswordInput/pageObject/index.js on lines 5..67

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

      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

      class PageInput {
          /**
           * Create a new Input page object.
           * @constructor
           * @param {string} rootElement - The selector of the Input root element.
      Severity: Major
      Found in src/components/Input/pageObject/index.js and 2 other locations - About 1 day to fix
      src/components/StrongPasswordInput/pageObject/index.js on lines 5..67
      src/components/Textarea/pageObject/index.js on lines 5..67

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

      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

      class PageStrongPasswordInput {
          /**
           * Create a new StrongPasswordInput page object.
           * @constructor
           * @param {string} rootElement - The selector of the StrongPasswordInput root element.
      Severity: Major
      Found in src/components/StrongPasswordInput/pageObject/index.js and 2 other locations - About 1 day to fix
      src/components/Input/pageObject/index.js on lines 5..67
      src/components/Textarea/pageObject/index.js on lines 5..67

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

      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 focus the correct day in left month when an arrow key is pressed', async () => {
              const calendar = await PageCalendar(CALENDAR);
              await calendar.clickLeftMonthDay(11);
              await expect(await calendar.isLeftMonthDayFocused(11)).toBe(true);
              await browser.keys('ArrowUp');
      Severity: Major
      Found in integration/specs/Calendar/calendar-9.spec.js and 2 other locations - About 1 day to fix
      integration/specs/Calendar/calendar-1.spec.js on lines 37..49
      integration/specs/Calendar/calendar-9.spec.js on lines 50..62

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

      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 focus the correct day in right month when an arrow key is pressed', async () => {
              const calendar = await PageCalendar(CALENDAR);
              await calendar.clickRightMonthDay(11);
              await expect(await calendar.isRightMonthDayFocused(11)).toBe(true);
              await browser.keys('ArrowUp');
      Severity: Major
      Found in integration/specs/Calendar/calendar-9.spec.js and 2 other locations - About 1 day to fix
      integration/specs/Calendar/calendar-1.spec.js on lines 37..49
      integration/specs/Calendar/calendar-9.spec.js on lines 37..49

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

      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 focus the right day in current month when an arrow key is pressed', async () => {
              const calendar = await PageCalendar(CALENDAR);
              await calendar.clickDay(11);
              await expect(await calendar.isDayFocused(11)).toBe(true);
              await browser.keys('ArrowUp');
      Severity: Major
      Found in integration/specs/Calendar/calendar-1.spec.js and 2 other locations - About 1 day to fix
      integration/specs/Calendar/calendar-9.spec.js on lines 37..49
      integration/specs/Calendar/calendar-9.spec.js on lines 50..62

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

      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

      export const defaultRenderer = {
          h1: props => <Heading level={1} {...props} />,
          h2: props => <Heading level={2} {...props} />,
          h3: props => <Heading level={3} {...props} />,
          h4: props => <Heading level={4} {...props} />,
      Severity: Major
      Found in src/components/MarkdownOutput/renderers/index.js and 1 other location - About 1 day to fix
      src/components/MarkdownOutput/renderers/index.js on lines 63..83

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

      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 return the right rows when is multiple and the last row selected is "row-1"', () => {
              const selectedRowsKeys = {
                  'row-1': true,
                  'row-2': true,
                  'row-3': true,
      src/components/Table/helpers/selector/__test__/getUpdatedRowsWhenSelect.spec.js on lines 99..129

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

      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

      export const inlineRenderer = {
          h1: props => <InlineHeading level={1} {...props} />,
          h2: props => <InlineHeading level={2} {...props} />,
          h3: props => <InlineHeading level={3} {...props} />,
          h4: props => <InlineHeading level={4} {...props} />,
      Severity: Major
      Found in src/components/MarkdownOutput/renderers/index.js and 1 other location - About 1 day to fix
      src/components/MarkdownOutput/renderers/index.js on lines 41..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 226.

      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 return the right rows when is multiple and the last row selected is "row-1"', () => {
              const selectedRowsKeys = {
                  'row-1': false,
                  'row-2': false,
                  'row-3': false,
      src/components/Table/helpers/selector/__test__/getUpdatedRowsWhenDeselect.spec.js on lines 97..127

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

      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

      describe('<ButtonMenu/>', () => {
          it('should be accessible when pass assistiveText', async () => {
              expect.assertions(1);
              const html = ReactDOMServer.renderToString(
                  <ButtonMenu assistiveText="some description">
      Severity: Major
      Found in src/components/ButtonMenu/__test__/buttonMenu.a11y.spec.js and 1 other location - About 1 day to fix
      src/components/AvatarMenu/__test__/avatarMenu.a11y.spec.js on lines 8..31

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

      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

      describe('<AvatarMenu/>', () => {
          it('should be accessible when pass assistiveText', async () => {
              expect.assertions(1);
              const html = ReactDOMServer.renderToString(
                  <AvatarMenu assistiveText="some description">
      Severity: Major
      Found in src/components/AvatarMenu/__test__/avatarMenu.a11y.spec.js and 1 other location - About 1 day to fix
      src/components/ButtonMenu/__test__/buttonMenu.a11y.spec.js on lines 8..31

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

      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 PhoneInput has 234 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const PhoneInput = React.forwardRef((props, ref) => {
          const {
              value,
              name,
              placeholder,
      Severity: Major
      Found in src/components/PhoneInput/index.js - About 1 day to fix

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

                    <g id="components" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
                        <g id="USA-flag" transform="translate(-0.001000, 0.773000)" fillRule="nonzero">
                            <circle id="Oval" fill="#F0F0F0" cx="160.001" cy="160" r="160" />
                            <g id="Group" transform="translate(5.001000, 34.227000)" fill="#D80027">
                                <path
        Severity: Major
        Found in src/components/PhoneInput/flags/UnitedStates.js and 1 other location - About 1 day to fix
        src/components/PhoneInput/flags/UnitedStates.js on lines 52..79

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

        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="components" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
                            <g id="USA-flag" transform="translate(-0.001000, 0.773000)" fillRule="nonzero">
                                <circle id="Oval" fill="#F0F0F0" cx="160.001" cy="160" r="160" />
                                <g id="Group" transform="translate(5.001000, 34.227000)" fill="#D80027">
                                    <path
        Severity: Major
        Found in src/components/PhoneInput/flags/UnitedStates.js and 1 other location - About 1 day to fix
        src/components/PhoneInput/flags/UnitedStates.js on lines 16..43

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

        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