nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

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

describe('<SignInExample/>', () => {
    it('should render the SignIn', () => {
        const component = shallow(<SignInExample />);
        expect(component.find(Card).exists()).toBe(true);
        expect(component.find(Button).exists()).toBe(true);
examples/create-react-app/src/pages/Admin/__test__/admin.spec.js on lines 8..15
examples/create-react-app/src/pages/ButtonMenu/__test__/buttonMenu.spec.js on lines 8..15
examples/create-react-app/src/pages/Home/__test__/home.spec.js on lines 8..15

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

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 true when screen width is more than 600px and last tab is visible', () => {
            const activeTabName = 'pizza';
            const tabsetChildren = [
                { name: 'pizza', ref: {} },
                { name: 'onion', ref: {} },
Severity: Major
Found in src/components/Tabset/__test__/utils.spec.js and 2 other locations - About 4 hrs to fix
src/components/Tabset/__test__/utils.spec.js on lines 241..260
src/components/Tabset/__test__/utils.spec.js on lines 281..300

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

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 true when screen width is less than 600px and last tab is active', () => {
            const activeTabName = 'tomato';
            const tabsetChildren = [
                { name: 'pizza', ref: {} },
                { name: 'onion', ref: {} },
Severity: Major
Found in src/components/Tabset/__test__/utils.spec.js and 2 other locations - About 4 hrs to fix
src/components/Tabset/__test__/utils.spec.js on lines 261..280
src/components/Tabset/__test__/utils.spec.js on lines 281..300

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

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 false when screen width is more than 600px and last tab is not visible', () => {
            const activeTabName = 'pizza';
            const tabsetChildren = [
                { name: 'pizza', ref: {} },
                { name: 'onion', ref: {} },
Severity: Major
Found in src/components/Tabset/__test__/utils.spec.js and 2 other locations - About 4 hrs to fix
src/components/Tabset/__test__/utils.spec.js on lines 241..260
src/components/Tabset/__test__/utils.spec.js on lines 261..280

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

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 keep the ampm input focused when it is focused and press right key', () => {
        const component = mount(<TimeSelect />);
        const container = component.find('div[role="presentation"]');
        container.simulate('keyDown', { keyCode: RIGHT_KEY });
        container.simulate('keyDown', { keyCode: RIGHT_KEY });
Severity: Major
Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 4 hrs to fix
src/components/TimePicker/__test__/timeSelect.spec.js on lines 377..385

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

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 focus minutes input when ampm input is focused and press left key', () => {
        const component = mount(<TimeSelect />);
        const container = component.find('div[role="presentation"]');
        container.simulate('keyDown', { keyCode: RIGHT_KEY });
        container.simulate('keyDown', { keyCode: RIGHT_KEY });
Severity: Major
Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 4 hrs to fix
src/components/TimePicker/__test__/timeSelect.spec.js on lines 397..405

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

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

const TimePicker = React.forwardRef((props, ref) => {
    const {
        placeholder,
        label,
        required,
Severity: Major
Found in src/components/TimePicker/index.js - About 4 hrs to fix

    File index.js has 368 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable react/sort-comp */
    import React, { Component } from 'react';
    import PropTypes from 'prop-types';
    import withReduxForm from '../../libs/hocs/withReduxForm';
    import RenderIf from '../RenderIf';
    Severity: Minor
    Found in src/components/Picklist/index.js - About 4 hrs to fix

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

          it('should return the item formated with search term highlighted', () => {
              const { id, label, description, icon } = getFormattedValue(
                  placeDetails,
                  true,
                  <SelectedLocationIcon />,
      src/components/GoogleAddressLookup/helpers/__test__/getFormattedValue.spec.js on lines 152..171

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

      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 StyledAvatarIcon = attachThemeAttrs(styled(AvatarIcon))`
          color: ${props => props.palette.background.main};
          ${props =>
              props.shape === 'square' &&
              `
      Severity: Major
      Found in src/components/LoadingShape/styled/index.js and 1 other location - About 4 hrs to fix
      src/components/LoadingShape/styled/index.js on lines 14..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 131.

      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

                          <VerticalSection>
                              <VerticalItem
                                  name="item-1"
                                  label="Dashboard"
                                  icon={<FontAwesomeIcon size="lg" icon={faHome} />}
      Severity: Major
      Found in examples/create-react-app/src/pages/Admin/sideNavigation.js and 1 other location - About 4 hrs to fix
      examples/create-react-app/src/pages/Admin/sideNavigation.js on lines 57..77

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

      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 item formated with search term highlighted', () => {
              const { id, label, description, icon } = getFormattedValue(
                  suggestion,
                  true,
                  <SelectedLocationIcon />,
      src/components/GoogleAddressLookup/helpers/__test__/getFormattedValue.spec.js on lines 173..192

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

      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

                          <VerticalSectionOverflow
                              expanded
                              title="Connect"
                              description="Recents, Accounts, Transfer ..."
                          >
      Severity: Major
      Found in examples/create-react-app/src/pages/Admin/sideNavigation.js and 1 other location - About 4 hrs to fix
      examples/create-react-app/src/pages/Admin/sideNavigation.js on lines 31..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 131.

      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 StyledImageIcon = attachThemeAttrs(styled(ImageIcon))`
          color: ${props => props.palette.background.main};
      
          ${props =>
              props.shape === 'square' &&
      Severity: Major
      Found in src/components/LoadingShape/styled/index.js and 1 other location - About 4 hrs to fix
      src/components/LoadingShape/styled/index.js on lines 36..55

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

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

          render() {
              const {
                  label: pickListLabel,
                  labelAlignment,
                  hideLabel,
      Severity: Major
      Found in src/components/Picklist/index.js - About 4 hrs to fix

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

            it('should pass the right props to the Label component', () => {
                const component = mount(<FileSelector label="custom label" required />);
                expect(component.find('Label').props()).toEqual({
                    label: 'custom label',
                    required: true,
        Severity: Major
        Found in src/components/FileSelector/__test__/fileSelector.spec.js and 1 other location - About 4 hrs to fix
        src/components/StrongPasswordInput/__test__/strongPasswordInput.spec.js on lines 72..85

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

        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 render the right week when value is updated', async done => {
                expect.assertions(1);
                const value = new Date('04/05/2020');
                const component = mount(<WeeklyCalendar currentWeek={value} />);
                component.setProps({
        src/components/MonthlyCalendar/__test__/monthlyCalendar.spec.js on lines 33..44

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

        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 render the right month when value is updated', async done => {
                expect.assertions(1);
                const value = new Date('04/24/2019');
                const component = mount(<MonthlyCalendar currentMonth={value} />);
                component.setProps({
        src/components/WeeklyCalendar/__test__/weeklyCalendar.spec.js on lines 33..44

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

        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 pass the right props to the Label component', () => {
                const component = mount(<StrongPasswordInput label="custom label" required />);
                expect(component.find('Label').props()).toEqual({
                    label: 'custom label',
                    required: true,
        src/components/FileSelector/__test__/fileSelector.spec.js on lines 42..55

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

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

        import styled from 'styled-components';
        import attachThemeAttrs from '../../../styles/helpers/attachThemeAttrs';
        import IconContainer from '../../Input/styled/iconContainer';
        import ButtonIcon from '../../ButtonIcon';
        import { MARGIN_X_SMALL } from '../../../styles/margins';
        Severity: Minor
        Found in src/components/FileSelector/styled/index.js - About 4 hrs to fix
          Severity
          Category
          Status
          Source
          Language