nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

Avoid too many return statements within this function.
Open

                return (
                    <div className={className}>
                        {description}
                        {propTypeEnumRender(type.value)}
                    </div>
Severity: Major
Found in library/styleguideComponents/PropsTable/bodyRows.js - About 30 mins to fix

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

    jest.mock('../color/decomposeColor', () => () => {
        const result = {
            type: 'rgb',
            values: [1, 182, 245],
        };
    Severity: Minor
    Found in src/styles/helpers/__test__/darken.spec.js and 2 other locations - About 30 mins to fix
    src/styles/helpers/__test__/getLuminance.spec.js on lines 3..9
    src/styles/helpers/__test__/lighten.spec.js on lines 4..10

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

    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

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

    jest.mock('../color/decomposeColor', () => () => {
        const result = {
            type: 'rgb',
            values: [1, 182, 245],
        };
    Severity: Minor
    Found in src/styles/helpers/__test__/lighten.spec.js and 2 other locations - About 30 mins to fix
    src/styles/helpers/__test__/darken.spec.js on lines 4..10
    src/styles/helpers/__test__/getLuminance.spec.js on lines 3..9

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

    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

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

    jest.mock('../color/decomposeColor', () => () => {
        const result = {
            type: 'rgb',
            values: [1, 182, 245],
        };
    Severity: Minor
    Found in src/styles/helpers/__test__/getLuminance.spec.js and 2 other locations - About 30 mins to fix
    src/styles/helpers/__test__/darken.spec.js on lines 4..10
    src/styles/helpers/__test__/lighten.spec.js on lines 4..10

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

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

        it('should return Apr 5 - 11, 2020 when date is 2020/04/05', () => {
            const date = new Date(2020, 3, 5);
            expect(getFormattedWeek(date)).toBe('Apr 5 - 11, 2020');
        });
    src/components/Calendar/helpers/__test__/getFormattedMonth.spec.js on lines 4..7
    src/components/WeeklyCalendar/helpers/__test__/getFormattedWeek.spec.js on lines 8..11
    src/components/WeeklyCalendar/helpers/__test__/getFormattedWeek.spec.js on lines 12..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 45.

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

                    <Provider value={{ dateComponent }}>
                        <Month
                            selectedDate={selectedDate}
                            firstDayMonth={month}
                            minDate={minDate}
    Severity: Major
    Found in src/components/MonthlyCalendar/index.js and 3 other locations - About 30 mins to fix
    src/components/PhoneInput/countriesDropdown/index.js on lines 88..96
    src/components/CarouselImage/index.js on lines 113..127
    src/components/FileSelector/index.js on lines 179..195

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

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

                <StyledInnerContainer
                    className="rainbow-carousel-image"
                    tabIndex={getTabIndex()}
                    href={href}
                    as={getHtmlElememnt()}
    Severity: Major
    Found in src/components/CarouselImage/index.js and 3 other locations - About 30 mins to fix
    src/components/PhoneInput/countriesDropdown/index.js on lines 88..96
    src/components/FileSelector/index.js on lines 179..195
    src/components/MonthlyCalendar/index.js on lines 100..108

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

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

        it('should return the right month', () => {
            const date = new Date(2019, 2, 21);
            expect(getFormattedMonth(date)).toBe('March');
        });
    src/components/WeeklyCalendar/helpers/__test__/getFormattedWeek.spec.js on lines 4..7
    src/components/WeeklyCalendar/helpers/__test__/getFormattedWeek.spec.js on lines 8..11
    src/components/WeeklyCalendar/helpers/__test__/getFormattedWeek.spec.js on lines 12..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 45.

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

        it('should return Dec 29, 2019 - Jan 4, 2020 when date is 2019/11/29', () => {
            const date = new Date(2019, 11, 29);
            expect(getFormattedWeek(date)).toBe('Dec 29, 2019 - Jan 4, 2020');
        });
    src/components/Calendar/helpers/__test__/getFormattedMonth.spec.js on lines 4..7
    src/components/WeeklyCalendar/helpers/__test__/getFormattedWeek.spec.js on lines 4..7
    src/components/WeeklyCalendar/helpers/__test__/getFormattedWeek.spec.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 45.

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

    LabelText.propTypes = {
        value: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
        variant: PropTypes.string,
    };
    Severity: Major
    Found in library/styleguideComponents/UniversalSearch/labelText.js and 3 other locations - About 30 mins to fix
    src/components/Badge/content.js on lines 14..17
    src/components/Button/buttonContent.js on lines 7..10
    src/components/VerticalItem/itemContent.js on lines 18..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 45.

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

    Content.propTypes = {
        label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
        children: PropTypes.node,
    };
    Severity: Major
    Found in src/components/Badge/content.js and 3 other locations - About 30 mins to fix
    library/styleguideComponents/UniversalSearch/labelText.js on lines 21..24
    src/components/Button/buttonContent.js on lines 7..10
    src/components/VerticalItem/itemContent.js on lines 18..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 45.

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

        it('should return Mar 29 - Apr 4, 2020 when date is 2020/03/29', () => {
            const date = new Date(2020, 2, 29);
            expect(getFormattedWeek(date)).toBe('Mar 29 - Apr 4, 2020');
        });
    src/components/Calendar/helpers/__test__/getFormattedMonth.spec.js on lines 4..7
    src/components/WeeklyCalendar/helpers/__test__/getFormattedWeek.spec.js on lines 4..7
    src/components/WeeklyCalendar/helpers/__test__/getFormattedWeek.spec.js on lines 12..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 45.

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

                                <StyledUl role="listbox" listHeight={listHeight}>
                                    <CountriesList
                                        countries={countriesFiltered}
                                        country={country}
                                        itemsRef={itemsRef}
    Severity: Major
    Found in src/components/PhoneInput/countriesDropdown/index.js and 3 other locations - About 30 mins to fix
    src/components/CarouselImage/index.js on lines 113..127
    src/components/FileSelector/index.js on lines 179..195
    src/components/MonthlyCalendar/index.js on lines 100..108

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

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

                        <StyledIconContainer
                            iconPosition="left"
                            isSingleFile={isSingleFile}
                            variant={variant}
                            error={error}
    Severity: Major
    Found in src/components/FileSelector/index.js and 3 other locations - About 30 mins to fix
    src/components/PhoneInput/countriesDropdown/index.js on lines 88..96
    src/components/CarouselImage/index.js on lines 113..127
    src/components/MonthlyCalendar/index.js on lines 100..108

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

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

    ItemContent.propTypes = {
        label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
        notification: PropTypes.node,
    };
    Severity: Major
    Found in src/components/VerticalItem/itemContent.js and 3 other locations - About 30 mins to fix
    library/styleguideComponents/UniversalSearch/labelText.js on lines 21..24
    src/components/Badge/content.js on lines 14..17
    src/components/Button/buttonContent.js on lines 7..10

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

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

    ButtonContent.propTypes = {
        label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
        children: PropTypes.node,
    };
    Severity: Major
    Found in src/components/Button/buttonContent.js and 3 other locations - About 30 mins to fix
    library/styleguideComponents/UniversalSearch/labelText.js on lines 21..24
    src/components/Badge/content.js on lines 14..17
    src/components/VerticalItem/itemContent.js on lines 18..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 45.

    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

    export default function isScrollPositionAtMenuBottom(menuRef) {
        const { scrollHeight, scrollTop, clientHeight } = menuRef;
        return scrollHeight - scrollTop === clientHeight;
    }
    src/components/Lookup/helpers/isScrollPositionAtMenuBottom.js on lines 1..4
    src/components/PhoneInput/countriesDropdown/helpers/isScrollPositionAtScrollable.js on lines 1..4

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

    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

                <StyledButtonItem
                    data-id="radio-button-group_radio-container"
                    variant={variant}
                    size={size}
                    isChecked={isChecked}
    Severity: Minor
    Found in src/components/RadioButtonGroup/radioButtonItem.js and 2 other locations - About 30 mins to fix
    src/components/ColorPicker/commons/slider/index.js on lines 10..17
    src/components/InternalTooltip/index.js on lines 47..56

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

    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

    export default function isScrollPositionAtMenuBottom(menuRef) {
        const { scrollHeight, scrollTop, clientHeight } = menuRef;
        return scrollHeight - scrollTop === clientHeight;
    }
    Severity: Minor
    Found in src/components/Lookup/helpers/isScrollPositionAtMenuBottom.js and 2 other locations - About 30 mins to fix
    src/components/InternalDropdown/helpers/isScrollPositionAtMenuBottom.js on lines 1..4
    src/components/PhoneInput/countriesDropdown/helpers/isScrollPositionAtScrollable.js on lines 1..4

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

    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

    export default function isScrollPositionAtScrollable(scrollable) {
        const { scrollHeight, scrollTop, clientHeight } = scrollable;
        return scrollHeight - scrollTop === clientHeight;
    }
    src/components/InternalDropdown/helpers/isScrollPositionAtMenuBottom.js on lines 1..4
    src/components/Lookup/helpers/isScrollPositionAtMenuBottom.js on lines 1..4

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

    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