nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

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

export default function RightArrow() {
    return (
        <svg fill="currentColor" width="8px" height="14px" viewBox="0 0 8 14">
            <g transform="translate(-340.000000, -285.000000)">
                <g transform="translate(-83.000000, 268.000000)">
Severity: Major
Found in src/components/MonthlyCalendar/icons/rightArrow.js and 5 other locations - About 4 hrs to fix
src/components/Calendar/icons/leftArrow.js on lines 3..17
src/components/Calendar/icons/rightArrow.js on lines 3..17
src/components/MonthlyCalendar/icons/leftArrow.js on lines 3..17
src/components/WeeklyCalendar/icons/leftArrow.js on lines 3..17
src/components/WeeklyCalendar/icons/rightArrow.js on lines 3..17

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

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

export default function RightArrow() {
    return (
        <svg fill="currentColor" width="8px" height="14px" viewBox="0 0 8 14">
            <g transform="translate(-340.000000, -285.000000)">
                <g transform="translate(-83.000000, 268.000000)">
Severity: Major
Found in src/components/WeeklyCalendar/icons/rightArrow.js and 5 other locations - About 4 hrs to fix
src/components/Calendar/icons/leftArrow.js on lines 3..17
src/components/Calendar/icons/rightArrow.js on lines 3..17
src/components/MonthlyCalendar/icons/leftArrow.js on lines 3..17
src/components/MonthlyCalendar/icons/rightArrow.js on lines 3..17
src/components/WeeklyCalendar/icons/leftArrow.js on lines 3..17

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

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

export default function LeftArrow() {
    return (
        <svg fill="currentColor" width="8px" height="14px" viewBox="0 0 8 14">
            <g transform="translate(-301.000000, -285.000000)">
                <g transform="translate(-83.000000, 268.000000)">
Severity: Major
Found in src/components/MonthlyCalendar/icons/leftArrow.js and 5 other locations - About 4 hrs to fix
src/components/Calendar/icons/leftArrow.js on lines 3..17
src/components/Calendar/icons/rightArrow.js on lines 3..17
src/components/MonthlyCalendar/icons/rightArrow.js on lines 3..17
src/components/WeeklyCalendar/icons/leftArrow.js on lines 3..17
src/components/WeeklyCalendar/icons/rightArrow.js on lines 3..17

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

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

export default function LeftArrow() {
    return (
        <svg fill="currentColor" width="8px" height="14px" viewBox="0 0 8 14">
            <g transform="translate(-301.000000, -285.000000)">
                <g transform="translate(-83.000000, 268.000000)">
Severity: Major
Found in src/components/WeeklyCalendar/icons/leftArrow.js and 5 other locations - About 4 hrs to fix
src/components/Calendar/icons/leftArrow.js on lines 3..17
src/components/Calendar/icons/rightArrow.js on lines 3..17
src/components/MonthlyCalendar/icons/leftArrow.js on lines 3..17
src/components/MonthlyCalendar/icons/rightArrow.js on lines 3..17
src/components/WeeklyCalendar/icons/rightArrow.js on lines 3..17

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

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

export default function LeftArrow() {
    return (
        <svg fill="currentColor" width="8px" height="14px" viewBox="0 0 8 14">
            <g transform="translate(-301.000000, -285.000000)">
                <g transform="translate(-83.000000, 268.000000)">
Severity: Major
Found in src/components/Calendar/icons/leftArrow.js and 5 other locations - About 4 hrs to fix
src/components/Calendar/icons/rightArrow.js on lines 3..17
src/components/MonthlyCalendar/icons/leftArrow.js on lines 3..17
src/components/MonthlyCalendar/icons/rightArrow.js on lines 3..17
src/components/WeeklyCalendar/icons/leftArrow.js on lines 3..17
src/components/WeeklyCalendar/icons/rightArrow.js on lines 3..17

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

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

export default function RightArrow() {
    return (
        <svg fill="currentColor" width="8px" height="14px" viewBox="0 0 8 14">
            <g transform="translate(-340.000000, -285.000000)">
                <g transform="translate(-83.000000, 268.000000)">
Severity: Major
Found in src/components/Calendar/icons/rightArrow.js and 5 other locations - About 4 hrs to fix
src/components/Calendar/icons/leftArrow.js on lines 3..17
src/components/MonthlyCalendar/icons/leftArrow.js on lines 3..17
src/components/MonthlyCalendar/icons/rightArrow.js on lines 3..17
src/components/WeeklyCalendar/icons/leftArrow.js on lines 3..17
src/components/WeeklyCalendar/icons/rightArrow.js on lines 3..17

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

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 change month when is in the first week of a month, the first day of the month is not the first day of the week and press HOME key', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickPrevMonthButton();
        await calendar.clickPrevMonthButton();
        await calendar.clickDay(4);
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 1 other location - About 4 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 85..93

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

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 change month when is in the last week of a month, the last day of the month is not the last day of the week and press END key', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickPrevMonthButton();
        await calendar.clickPrevMonthButton();
        await calendar.clickDay(29);
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 1 other location - About 4 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 76..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 129.

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

const AccordionSection = props => {
    const {
        style,
        disabled,
        children,
Severity: Major
Found in src/components/AccordionSection/index.js - About 4 hrs to fix

    Lookup has 36 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Lookup extends Component {
        constructor(props) {
            super(props);
            const normalizedOptions = getNormalizedOptions(props.options || []);
            this.state = {
    Severity: Minor
    Found in src/components/Lookup/index.js - About 4 hrs to fix

      File singleCalendar.js has 361 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-disable react/sort-comp */
      /* eslint-disable react/prop-types */
      import React, { Component } from 'react';
      import PropTypes from 'prop-types';
      import DaysOfWeek from './daysOfWeek';
      Severity: Minor
      Found in src/components/Calendar/singleCalendar.js - About 4 hrs to fix

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

            it('should call onClick event with the right value input is clicked', () => {
                const onClickFn = jest.fn();
                const component = mount(<InputItem index={2} value="2" onClick={onClickFn} />);
                component
                    .find(StyledInput)
        Severity: Major
        Found in src/components/CodeInput/__test__/inputItem.spec.js and 1 other location - About 4 hrs to fix
        src/components/CodeInput/__test__/inputItem.spec.js on lines 53..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 128.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

            it('should call onBlur event with the right value when input leaves focus', () => {
                const onBlurFn = jest.fn();
                const component = mount(<InputItem index={0} value="2" onBlur={onBlurFn} />);
                component
                    .find(StyledInput)
        Severity: Major
        Found in src/components/CodeInput/__test__/inputItem.spec.js and 1 other location - About 4 hrs to fix
        src/components/CodeInput/__test__/inputItem.spec.js on lines 35..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 128.

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

        export default function CalendarIcon(props) {
            const { className, style } = props;
        
            return (
                <svg className={className} style={style} width="21px" height="21px" viewBox="0 0 21 21">
        Severity: Major
        Found in src/components/DateTimePicker/icon.js - About 4 hrs to fix

          Function render has 115 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              render() {
                  const {
                      className,
                      style,
                      value,
          Severity: Major
          Found in src/components/Input/inputBase/index.js - About 4 hrs to fix

            Function ButtonIcon has 115 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const ButtonIcon = React.forwardRef((props, ref) => {
                const buttonRef = useRef();
                const tooltipRef = useRef();
            
                useImperativeHandle(ref, () => ({
            Severity: Major
            Found in src/components/ButtonIcon/index.js - About 4 hrs to fix

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

                  const {
                      value,
                      name,
                      placeholder,
                      icon,
              Severity: Major
              Found in src/components/PhoneInput/index.js and 2 other locations - About 4 hrs to fix
              src/components/ColorInput/index.js on lines 48..72
              src/components/FileSelector/index.js on lines 23..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 127.

              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 {
                      className,
                      style,
                      id,
                      name,
              Severity: Major
              Found in src/components/FileSelector/index.js and 2 other locations - About 4 hrs to fix
              src/components/ColorInput/index.js on lines 48..72
              src/components/PhoneInput/index.js on lines 38..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 127.

              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 {
                      id,
                      className,
                      style,
                      value,
              Severity: Major
              Found in src/components/ColorInput/index.js and 2 other locations - About 4 hrs to fix
              src/components/FileSelector/index.js on lines 23..47
              src/components/PhoneInput/index.js on lines 38..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 127.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                  it('should call setAnimation on marker with the bounce animation when the marker button is focused', () => {
                      marker.setAnimation.mockReset();
                      const component = mount(<MapMarker latitude={5} longitude={10} />);
                      // this actually is context not props
                      component.setProps(newContext);
              Severity: Major
              Found in src/components/MapMarker/__test__/mapMarker.spec.js and 1 other location - About 4 hrs to fix
              src/components/MapMarker/__test__/mapMarker.spec.js on lines 148..155

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

              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