nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

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

    it('should return the right 12 hour for PM time', () => {
        const values = [
            '12:12',
            '13:35',
            '14:59',
src/components/TimePicker/helpers/__test__/get12HourTime.spec.js on lines 12..42

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

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

                        <Playground
                            code={examples[0].content}
                            evalInContext={examples[0].evalInContext}
                            key={`${codeRevision}/0`}
                            name={name}
Severity: Major
Found in library/styleguideComponents/Examples/index.js and 1 other location - About 2 hrs to fix
library/pages/CustomizationPage/index.js on lines 221..229

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

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 CounterManager.decrement when the component unmount and it is open', () => {
        CounterManager.decrement.mockReset();
        const component = mount(
            <Modal isOpen>
                <p />
Severity: Major
Found in src/components/Modal/__test__/modal.spec.js and 1 other location - About 2 hrs to fix
src/components/Drawer/__test__/drawer.spec.js on lines 159..168

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

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

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

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

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

Refactorings

Further Reading

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

export const StyledText = attachThemeAttrs(styled(TruncatedText))`
    color: ${props => props.palette.text.main};
    font-weight: 500;
    font-size: ${FONT_SIZE_TEXT_LARGE};
    align-self: center;
Severity: Major
Found in src/components/MultiSelect/styled/index.js and 1 other location - About 2 hrs to fix
src/components/MultiSelect/styled/index.js on lines 181..206

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

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

    componentDidUpdate(prevProps) {
        const {
            children: prevChildren,
            showCheckboxColumn: prevShowCheckboxColumn,
            maxRowSelection: prevMaxRowSelection,
Severity: Major
Found in src/components/Table/index.js - About 2 hrs to fix

    Function AccordionTimeline has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function AccordionTimeline(props) {
        const { id, children, className, style, multiple, activeSectionNames, onToggleSection } = props;
        const registeredTimelineMarkers = useRef([]);
        const [activeNames, setActiveNames] = useState(activeSectionNames);
        const containerRef = useRef();
    Severity: Major
    Found in src/components/ActivityTimeline/accordionTimeline.js - About 2 hrs to fix

      Function FileIcon has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function FileIcon() {
          return (
              <svg width="14px" height="17px" viewBox="0 0 14 17" version="1.1">
                  <g id="components" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
                      <g id="Components-FileSelector-" transform="translate(-435.000000, -899.000000)">
      Severity: Major
      Found in src/components/FileSelector/icons/file.js - About 2 hrs to fix

        Function AdvancedSettings has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const AdvancedSettings = props => {
            const { className, style } = props;
            return (
                <svg
                    className={className}
        Severity: Major
        Found in library/exampleComponents/Icons/advancedSettings.js - About 2 hrs to fix

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

          /* eslint-disable no-script-url, react/prop-types, jsx-a11y/anchor-is-valid */
          import React, { Component } from 'react';
          import PropTypes from 'prop-types';
          import { Consumer } from '../InternalDropdown/context';
          import Icon from './icon';
          Severity: Minor
          Found in src/components/Option/index.js - About 2 hrs to fix

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

            import React, { Component } from 'react';
            import PropTypes from 'prop-types';
            import { uniqueId } from '../../../libs/utils';
            import Label from '../label';
            import RenderIf from '../../RenderIf';
            Severity: Minor
            Found in src/components/Input/inputBase/index.js - About 2 hrs to fix

              PageLookup has 24 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class PageLookup {
                  /**
                   * Create a new Lookup page object.
                   * @constructor
                   * @param {string} rootElement - The selector of the Lookup root element.
              Severity: Minor
              Found in src/components/Lookup/pageObject/index.js - About 2 hrs to fix

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

                    it('should render the component when pass falsy values', () => {
                        const values = ['', undefined, null, 0];
                        values.forEach(value => {
                            const component = mount(<DoubleCalendar value={value} />);
                            expect(component.exists()).toBe(true);
                src/components/Calendar/__test__/calendar.spec.js on lines 7..13
                src/components/MonthlyCalendar/__test__/monthlyCalendar.spec.js on lines 7..13
                src/components/WeeklyCalendar/__test__/weeklyCalendar.spec.js on lines 7..13

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

                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 render the component when pass falsy values', () => {
                        const values = ['', undefined, null, 0];
                        values.forEach(value => {
                            const component = mount(<MonthlyCalendar currentMonth={value} />);
                            expect(component.exists()).toBe(true);
                src/components/Calendar/__test__/calendar.spec.js on lines 7..13
                src/components/Calendar/doubleCalendar/__test__/doubleCalendar.spec.js on lines 7..13
                src/components/WeeklyCalendar/__test__/weeklyCalendar.spec.js on lines 7..13

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

                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 render the component when pass falsy values', () => {
                        const values = ['', undefined, null, 0];
                        values.forEach(value => {
                            const component = mount(<Calendar value={value} />);
                            expect(component.exists()).toBe(true);
                Severity: Major
                Found in src/components/Calendar/__test__/calendar.spec.js and 3 other locations - About 2 hrs to fix
                src/components/Calendar/doubleCalendar/__test__/doubleCalendar.spec.js on lines 7..13
                src/components/MonthlyCalendar/__test__/monthlyCalendar.spec.js on lines 7..13
                src/components/WeeklyCalendar/__test__/weeklyCalendar.spec.js on lines 7..13

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

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

                        const component = mount(
                            <InternalDropdown label="Picklist" onChange={onChangeFn}>
                                <Option label="Option 1" name="option1" />
                                <Option label="Option 2" name="option2" />
                                <Option label="Option 3" name="option3" />
                src/components/InternalDropdown/__test__/internalDropdown.spec.js on lines 17..23

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

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

                        const component = mount(
                            <InternalDropdown label="Picklist" onChange={onChangeFn}>
                                <Option label="Option 1" name="option1" />
                                <Option label="Option 2" name="option2" />
                                <Option label="Option 3" name="option3" />
                src/components/InternalDropdown/__test__/internalDropdown.spec.js on lines 137..143

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

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

                        const component = mount(
                            <Table data={data} keyField="id">
                                <Column field="name" header="Name" />
                                <Column field="email" header="Email" />
                                <Column field="id" header="User Id" />
                Severity: Major
                Found in src/components/Table/__test__/table.spec.js and 1 other location - About 2 hrs to fix
                src/components/Table/__test__/table.spec.js on lines 1330..1336

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

                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 render the component when pass falsy values', () => {
                        const values = ['', undefined, null, 0];
                        values.forEach(value => {
                            const component = mount(<WeeklyCalendar currentWeek={value} />);
                            expect(component.exists()).toBe(true);
                src/components/Calendar/__test__/calendar.spec.js on lines 7..13
                src/components/Calendar/doubleCalendar/__test__/doubleCalendar.spec.js on lines 7..13
                src/components/MonthlyCalendar/__test__/monthlyCalendar.spec.js on lines 7..13

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

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

                        const component = mount(
                            <Table data={data} keyField="id">
                                <Column field="name" header="Name" />
                                <Column field="email" header="Email" />
                                <Column field="id" header="User Id" />
                Severity: Major
                Found in src/components/Table/__test__/table.spec.js and 1 other location - About 2 hrs to fix
                src/components/Table/__test__/table.spec.js on lines 1223..1229

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

                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 GitHub = props => {
                    const { className, style } = props;
                    return (
                        <svg
                            className={className}
                Severity: Major
                Found in library/exampleComponents/Icons/gitHub.js and 1 other location - About 2 hrs to fix
                src/components/ImportRecordsFlow/icons/pencil.js on lines 4..22

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

                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