nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

Function Cell has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function Cell(props) {
    const {
        header,
        component,
        value,
Severity: Major
Found in src/components/Table/body/cell.js - About 4 hrs to fix

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

        it('should call global.google.maps.InfoWindow with the label is passed', () => {
            global.google.maps.InfoWindow.mockReset();
            const component = mount(<MapMarker latitude={5} longitude={10} label="my label" />);
            // 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 109..119

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

    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 global.google.maps.InfoWindow with the description is passed', () => {
            global.google.maps.InfoWindow.mockReset();
            const component = mount(
                <MapMarker latitude={5} longitude={10} description="my description" />,
            );
    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 120..128

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

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

    const CarouselImage = props => {
        const { assistiveText, description, header, href, src, style, className } = props;
        const {
            register,
            unregister,
    Severity: Major
    Found in src/components/CarouselImage/index.js - About 4 hrs to fix

      Function HelpText has 104 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const HelpText = React.forwardRef((props, ref) => {
          const { id, title, text, variant, tabIndex, iconSize, className, style } = props;
      
          const triggerRef = useRef();
          const helpTextId = useUniqueIdentifier('help-text');
      Severity: Major
      Found in src/components/HelpText/index.js - About 4 hrs to fix

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

            it('renders correctly in vertical orientation (default)', () => {
                const options = [{ value: 'admin', label: 'Admin' }, { value: 'user', label: 'User' }];
        
                const component = mount(<RadioGroup options={options} />);
                const elem = component.find(RadioGroupStyledContentContainer);
        Severity: Major
        Found in src/components/RadioGroup/__test__/radioGroup.spec.js and 1 other location - About 4 hrs to fix
        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 24..33

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

        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('renders correctly in vertical orientation (default)', () => {
                const options = [{ value: 'admin', label: 'Admin' }, { value: 'user', label: 'User' }];
        
                const component = mount(<CheckboxGroup options={options} />);
                const elem = component.find(CheckboxGroupStyledContentContainer);
        Severity: Major
        Found in src/components/CheckboxGroup/__test__/checkboxGroup.spec.js and 1 other location - About 4 hrs to fix
        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 8..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 118.

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

        const PrimitiveMenu = React.forwardRef((props, ref) => {
            const {
                id,
                className,
                style,
        Severity: Major
        Found in src/components/PrimitiveMenu/index.js - About 4 hrs to fix

          Function LocationIcon has 103 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const LocationIcon = props => {
              const { className } = props;
              return (
                  <svg
                      className={className}
          Severity: Major
          Found in src/components/PresenceMap/icons/locationIcon.js - About 4 hrs to fix

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

                it('should pass the right props to the Label component', () => {
                    const component = mount(<Lookup label="custom label" required />);
                    expect(component.find('Label').props()).toEqual({
                        label: 'custom label',
                        required: true,
            Severity: Major
            Found in src/components/Lookup/__test__/lookup.spec.js and 3 other locations - About 4 hrs to fix
            src/components/Input/inputBase/__test__/input.spec.js on lines 75..87
            src/components/Select/__test__/select.spec.js on lines 32..44
            src/components/Textarea/__test__/textarea.spec.js on lines 49..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 117.

            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 pass the right props to the Label component', () => {
                    const component = mount(<Select label="Select Label" required />);
                    expect(component.find('Label').props()).toEqual({
                        label: 'Select Label',
                        required: true,
            Severity: Major
            Found in src/components/Select/__test__/select.spec.js and 3 other locations - About 4 hrs to fix
            src/components/Input/inputBase/__test__/input.spec.js on lines 75..87
            src/components/Lookup/__test__/lookup.spec.js on lines 26..38
            src/components/Textarea/__test__/textarea.spec.js on lines 49..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 117.

            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 pass the right props to the Label component', () => {
                    const component = mount(<InputBase label="custom label" required />);
                    expect(component.find('Label').props()).toEqual({
                        label: 'custom label',
                        required: true,
            Severity: Major
            Found in src/components/Input/inputBase/__test__/input.spec.js and 3 other locations - About 4 hrs to fix
            src/components/Lookup/__test__/lookup.spec.js on lines 26..38
            src/components/Select/__test__/select.spec.js on lines 32..44
            src/components/Textarea/__test__/textarea.spec.js on lines 49..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 117.

            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 pass the right props to the Label component', () => {
                    const component = mount(<Textarea label="custom label" required />);
                    expect(component.find('Label').props()).toEqual({
                        label: 'custom label',
                        required: true,
            Severity: Major
            Found in src/components/Textarea/__test__/textarea.spec.js and 3 other locations - About 4 hrs to fix
            src/components/Input/inputBase/__test__/input.spec.js on lines 75..87
            src/components/Lookup/__test__/lookup.spec.js on lines 26..38
            src/components/Select/__test__/select.spec.js on lines 32..44

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 117.

            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 not run onChange when input change is triggered and disabled is true', () => {
                    const onChangeFn = jest.fn();
                    const component = mount(<WeekDayPicker onChange={onChangeFn} disabled />);
                    component
                        .find('input')
            Severity: Major
            Found in src/components/WeekDayPicker/__test__/weekDayPicker.spec.js and 1 other location - About 4 hrs to fix
            src/components/WeekDayPicker/__test__/weekDayPicker.spec.js on lines 142..150

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

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

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

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

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

            Refactorings

            Further Reading

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

                it('should return true when column width property changed', () => {
                    const prevColumns = [
                        { field: 'name', header: 'Name', width: 100 },
                        { field: 'email', header: 'Email', width: 100 },
                    ];
            src/components/Table/helpers/columns/__test__/isNotSameColumns.spec.js on lines 64..74

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

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

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

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

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

            Refactorings

            Further Reading

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

                it('should return true when column defaultWith property changed', () => {
                    const prevColumns = [
                        { field: 'name', header: 'Name', defaultWidth: 100 },
                        { field: 'email', header: 'Email', defaultWidth: 100 },
                    ];
            src/components/Table/helpers/columns/__test__/isNotSameColumns.spec.js on lines 75..85

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 117.

            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 not run onChange when checkbox change is triggered and readOnly is true', () => {
                    const onChangeFn = jest.fn();
                    const component = mount(<WeekDayPicker onChange={onChangeFn} readOnly />);
                    component
                        .find('input')
            Severity: Major
            Found in src/components/WeekDayPicker/__test__/weekDayPicker.spec.js and 1 other location - About 4 hrs to fix
            src/components/WeekDayPicker/__test__/weekDayPicker.spec.js on lines 151..159

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

            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 ImportRecordsFlow has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
            Open

            function ImportRecordsFlow(props) {
                const {
                    className,
                    style,
                    isOpen,
            Severity: Minor
            Found in src/components/ImportRecordsFlow/index.js - About 4 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function Code has 102 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

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

                  it('should fire onChange with -1 as argument when click in minusButton', () => {
                      const onChangeMockFn = jest.fn();
                      const component = mount(<CounterInput onChange={onChangeMockFn} value={0} />);
                      const button = component.find('button');
                      const minusButton = button.at(0);
              Severity: Major
              Found in src/components/CounterInput/__test__/counterInput.spec.js and 1 other location - About 4 hrs to fix
              src/components/CounterInput/__test__/counterInput.spec.js on lines 49..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 116.

              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