nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

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

        const rows = [
            { key: 'row-1', isSelected: true, isDisabled: false },
            { key: 'row-2', isSelected: true, isDisabled: false },
            { key: 'row-3', isSelected: false, isDisabled: true },
        ];
src/components/Table/helpers/selector/__test__/getUpdatedRowsWhenSelect.spec.js on lines 3..7
src/components/Table/helpers/selector/__test__/getUpdatedRowsWhenSelectAll.spec.js on lines 3..7

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

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 rows = [
    { key: 'row-1', isSelected: true, isDisabled: false },
    { key: 'row-2', isSelected: false, isDisabled: false },
    { key: 'row-3', isSelected: false, isDisabled: false },
];
src/components/Table/helpers/selector/__test__/getUpdatedRowsWhenDeselectAll.spec.js on lines 8..12
src/components/Table/helpers/selector/__test__/getUpdatedRowsWhenSelectAll.spec.js on lines 3..7

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

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 rows = [
    { key: 'row-1', isSelected: false, isDisabled: false },
    { key: 'row-2', isSelected: true, isDisabled: false },
    { key: 'row-3', isSelected: false, isDisabled: false },
];
src/components/Table/helpers/selector/__test__/getUpdatedRowsWhenDeselectAll.spec.js on lines 8..12
src/components/Table/helpers/selector/__test__/getUpdatedRowsWhenSelect.spec.js on lines 3..7

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

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

            [LEFT_KEY]: () => {
                const result = moveFocusedDay(-1);
                return {
                    day: result.day,
                    month: shouldUpdateCurrentMonth(result.day) ? result.month : undefined,
src/components/Calendar/doubleCalendar/hooks/useHandleKeyDown.js on lines 40..46
src/components/Calendar/doubleCalendar/hooks/useHandleKeyDown.js on lines 82..88

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

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

            [UP_KEY]: () => {
                const result = moveFocusedDay(-7);
                return {
                    day: result.day,
                    month: shouldUpdateCurrentMonth(result.day) ? result.month : undefined,
src/components/Calendar/doubleCalendar/hooks/useHandleKeyDown.js on lines 54..60
src/components/Calendar/doubleCalendar/hooks/useHandleKeyDown.js on lines 82..88

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

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 rgba converted value from rgb or rgba color format', () => {
        const colors = ['rgb(255, 255, 255)', 'rgba(255, 255, 255, 1)'];
        colors.forEach(color => {
            expect(colorToRgba(color)).toBe('rgba(255, 255, 255, 1)');
        });
Severity: Major
Found in src/styles/helpers/color/__test__/colorToRgba.spec.js and 2 other locations - About 1 hr to fix
src/styles/helpers/color/__test__/colorToRgba.spec.js on lines 10..15
src/styles/helpers/color/__test__/colorToRgba.spec.js on lines 22..27

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

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 rgba converted value from hsl or hsla color format', () => {
        const colors = ['hsl(120, 100%, 50%)', 'hsla(120, 100%, 50%, 1)'];
        colors.forEach(color => {
            expect(colorToRgba(color)).toBe('rgba(0, 255, 0, 1)');
        });
Severity: Major
Found in src/styles/helpers/color/__test__/colorToRgba.spec.js and 2 other locations - About 1 hr to fix
src/styles/helpers/color/__test__/colorToRgba.spec.js on lines 10..15
src/styles/helpers/color/__test__/colorToRgba.spec.js on lines 16..21

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

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

    async hoverScrollDownArrow() {
        const downArrow = await $(this.rootElement).$('[data-id="internal-dropdown-arrow-down"]');
        await downArrow.scrollIntoView();
        return downArrow.moveTo();
    }
Severity: Major
Found in src/components/InternalDropdown/pageObject/index.js and 1 other location - About 1 hr to fix
src/components/InternalDropdown/pageObject/index.js on lines 23..27

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

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

            <StyledModal
                id="time-picker_modal"
                isOpen={isOpen}
                onRequestClose={closeModal}
                onOpened={setFocusToHourInput}
Severity: Major
Found in src/components/TimePicker/index.js and 1 other location - About 1 hr to fix
src/components/Tree/child.js on lines 119..134

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

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

                <ChildrenContainerUl
                    icon={icon}
                    isChecked={isChecked}
                    ariaLevelValue={ariaLevelValue}
                    role="group"
Severity: Major
Found in src/components/Tree/child.js and 1 other location - About 1 hr to fix
src/components/TimePicker/index.js on lines 131..147

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

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 fill="#F0F0F0">
                    <circle cx={16} cy={16} r={16} />
                    <path d="M0 16c0 6.065 3.374 11.34 8.348 14.055V1.945C3.374 4.66 0 9.935 0 16z" />
                </g>
Severity: Major
Found in src/components/PhoneInput/flags/Pakistan.js and 1 other location - About 1 hr to fix
src/components/PhoneInput/flags/Liberia.js on lines 8..11

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

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

    async hoverScrollUpArrow() {
        const upArrow = await $(this.rootElement).$('[data-id="internal-dropdown-arrow-up"]');
        await upArrow.scrollIntoView();
        return upArrow.moveTo();
    }
Severity: Major
Found in src/components/InternalDropdown/pageObject/index.js and 1 other location - About 1 hr to fix
src/components/InternalDropdown/pageObject/index.js on lines 33..37

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

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 fill="#F0F0F0">
                    <circle cx={16} cy={16} r={16} />
                    <path d="M3.657 5.818h24.686A16.088 16.088 0 0025.2 2.91H6.8a16.084 16.084 0 00-3.143 2.91zM0 16c0 .49.023.975.067 1.455h31.866a16.197 16.197 0 000-2.91H.067C.023 15.026 0 15.51 0 16zM1.745 23.273h28.51c.471-.922.856-1.895 1.143-2.91H.602a15.892 15.892 0 001.143 2.91zM6.8 29.09h18.4a16.088 16.088 0 003.143-2.908H3.657A16.094 16.094 0 006.8 29.09zM.602 11.636h30.796a15.891 15.891 0 00-1.143-2.909H1.745a15.895 15.895 0 00-1.143 2.91z" />
                </g>
Severity: Major
Found in src/components/PhoneInput/flags/Liberia.js and 1 other location - About 1 hr to fix
src/components/PhoneInput/flags/Pakistan.js on lines 8..11

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

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

    const handleChange = event => {
        const { value: newValue, selectionStart } = event.target;
        const cleanValue = clearValue(newValue, decimalSeparator);
        const normalizeNewValue = normalizeValue({
            value: cleanValue,
Severity: Minor
Found in src/components/CurrencyInput/index.js - About 1 hr to fix

    Function CardExample has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function CardExample() {
        return (
            <div className="rainbow-m-around_large">
                <Card className="rainbow-align-content_center rainbow-m-around_large">
                    <img
    Severity: Minor
    Found in examples/create-react-app/src/pages/Card/index.js - About 1 hr to fix

      Function withDebounce has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function withDebounce(WrappedComponent) {
          return class extends Component {
              constructor(props) {
                  super(props);
                  this.fieldRef = React.createRef();
      Severity: Minor
      Found in src/libs/hocs/withDebounce/index.js - About 1 hr to fix

        Function handleChange has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            const handleChange = event => {
                const { value: newValue, selectionStart } = event.target;
                const cleanValue = clearValue(newValue, decimalSeparator);
                const normalizeNewValue = normalizeValue({
                    value: cleanValue,
        Severity: Minor
        Found in src/components/PercentInput/index.js - About 1 hr to fix

          Function renderInput has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              renderInput() {
                  const { props } = this;
                  const { readOnly, isCentered, valueAlignment } = props;
                  const alignment = getValueAlignment({ valueAlignment, isCentered });
          
          
          Severity: Minor
          Found in src/components/Input/pickerInput/index.js - About 1 hr to fix

            Function componentDidUpdate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                componentDidUpdate(prevProps, prevState) {
                    const {
                        options: prevOptions,
                        preferredSelectedOption: prevPreferredSelectedOption,
                    } = prevProps;
            Severity: Minor
            Found in src/components/Lookup/index.js - About 1 hr to fix

              Function Plus has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const Plus = props => {
                  const { className, style } = props;
                  return (
                      <svg
                          className={className}
              Severity: Minor
              Found in library/exampleComponents/Icons/plus.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language