nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

Function toBeFocusable has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function toBeFocusable(component) {
    if (component && isMountedByEnzyme(component)) {
        const onClickMockFn = jest.fn();
        const onBlurMockFn = jest.fn();
        const onFocusMockFn = jest.fn();
Severity: Minor
Found in jestMatchers/toBeFocusable.js - About 1 hr to fix

    Function Indicators has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const Indicators = props => {
        const { carouselChildren, onSelect, selectedItem } = props;
        const containerRef = useRef();
    
        const { childrenRegistered: indicatorsRefs, register, unregister } = useChildrenRegister({
    Severity: Minor
    Found in src/components/CarouselCard/indicators/index.js - About 1 hr to fix

      Function XCircle has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function XCircle(props) {
          const { className, style } = props;
          return (
              <svg
                  className={className}
      Severity: Minor
      Found in src/components/ImportRecordsFlow/icons/xCircle.js - About 1 hr to fix

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

            render() {
                const {
                    style,
                    className,
                    disabled,
        Severity: Minor
        Found in src/components/CheckboxToggle/index.js - About 1 hr to fix

          Function renderValue has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function renderValue(value, caption, row) {
              const { description, type } = row;
          
              if (value === 'undefined' || value === 'null') {
                  return '';
          Severity: Minor
          Found in library/styleguideComponents/PropsTable/bodyRows.js - About 1 hr to fix

            Function DatePickerModal has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function DatePickerModal(props) {
                const {
                    id,
                    className,
                    style,
            Severity: Minor
            Found in src/components/DatePickerModal/index.js - About 1 hr to fix

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

                  render() {
                      const {
                          style,
                          className,
                          paginationAlignment,
              Severity: Minor
              Found in src/components/TableWithBrowserPagination/index.js - About 1 hr to fix

                Function Default has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const Default = React.forwardRef((_props, ref) => {
                    const { colors } = useContext(ColorPickerContext);
                    const firstRef = useRef();
                    const lastRef = useRef();
                
                
                Severity: Minor
                Found in src/components/ColorPicker/variants/default.js - About 1 hr to fix

                  Function constructor has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      constructor(props) {
                          super(props);
                          this.state = {
                              focusedDate: normalizeDate(props.value),
                              currentMonth: getFirstDayMonth(normalizeDate(props.value)),
                  Severity: Minor
                  Found in src/components/Calendar/singleCalendar.js - About 1 hr to fix

                    Function Charts has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const Charts = props => {
                        const { className, style } = props;
                        return (
                            <svg
                                className={className}
                    Severity: Minor
                    Found in library/exampleComponents/Icons/charts.js - About 1 hr to fix

                      Function getComponentsByCategory has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          getComponentsByCategory() {
                              const { searchTerm } = this.state;
                              const { components } = this.props;
                              const filtered = filterSectionsByName(components, searchTerm);
                              const categorizedComponents = {
                      Severity: Minor
                      Found in library/pages/ComponentsPage/index.js - About 1 hr to fix

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

                            it('should set "left" to labelAlignment prop passed in the Label component', () => {
                                const component = mount(
                                    <RadioButtonGroup label="RadioButtonGroup Label" labelAlignment="left" />,
                                );
                                expect(component.find(StyledLabel).prop('labelAlignment')).toBe('left');
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 60..65
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 67..72
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 70..75
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 44..47
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 49..52
                        src/components/Rating/__test__/rating.spec.js on lines 24..27
                        src/components/Rating/__test__/rating.spec.js on lines 28..31
                        src/components/Slider/__test__/slider.spec.js on lines 38..41
                        src/components/Slider/__test__/slider.spec.js on lines 42..45

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

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

                            it('should set "right" to labelAlignment prop passed in the Label component', () => {
                                const component = mount(<Rating label="Rating Label" labelAlignment="right" />);
                                expect(component.find(StyledLabel).prop('labelAlignment')).toBe('right');
                            });
                        Severity: Major
                        Found in src/components/Rating/__test__/rating.spec.js and 9 other locations - About 1 hr to fix
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 60..65
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 67..72
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 64..69
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 70..75
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 44..47
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 49..52
                        src/components/Rating/__test__/rating.spec.js on lines 24..27
                        src/components/Slider/__test__/slider.spec.js on lines 38..41
                        src/components/Slider/__test__/slider.spec.js on lines 42..45

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

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

                            it('should set "left" to labelAlignment prop passed in the Label component', () => {
                                const component = mount(<Slider label="Slider Label" labelAlignment="left" />);
                                expect(component.find(StyledLabel).prop('labelAlignment')).toBe('left');
                            });
                        Severity: Major
                        Found in src/components/Slider/__test__/slider.spec.js and 9 other locations - About 1 hr to fix
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 60..65
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 67..72
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 64..69
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 70..75
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 44..47
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 49..52
                        src/components/Rating/__test__/rating.spec.js on lines 24..27
                        src/components/Rating/__test__/rating.spec.js on lines 28..31
                        src/components/Slider/__test__/slider.spec.js on lines 42..45

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

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

                            it('should set "left" to labelAlignment prop passed in the Label component', () => {
                                const component = mount(<Rating label="Rating Label" labelAlignment="left" />);
                                expect(component.find(StyledLabel).prop('labelAlignment')).toBe('left');
                            });
                        Severity: Major
                        Found in src/components/Rating/__test__/rating.spec.js and 9 other locations - About 1 hr to fix
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 60..65
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 67..72
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 64..69
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 70..75
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 44..47
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 49..52
                        src/components/Rating/__test__/rating.spec.js on lines 28..31
                        src/components/Slider/__test__/slider.spec.js on lines 38..41
                        src/components/Slider/__test__/slider.spec.js on lines 42..45

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

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

                            it('should set "left" to labelAlignment prop passed in the Label component', () => {
                                const component = mount(<RadioGroup label="RadioGroup Label" labelAlignment="left" />);
                                expect(component.find(StyledLabel).prop('labelAlignment')).toBe('left');
                            });
                        Severity: Major
                        Found in src/components/RadioGroup/__test__/radioGroup.spec.js and 9 other locations - About 1 hr to fix
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 60..65
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 67..72
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 64..69
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 70..75
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 49..52
                        src/components/Rating/__test__/rating.spec.js on lines 24..27
                        src/components/Rating/__test__/rating.spec.js on lines 28..31
                        src/components/Slider/__test__/slider.spec.js on lines 38..41
                        src/components/Slider/__test__/slider.spec.js on lines 42..45

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

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

                            it('should set "right" to labelAlignment prop passed in the Label component', () => {
                                const component = mount(<RadioGroup label="RadioGroup Label" labelAlignment="right" />);
                                expect(component.find(StyledLabel).prop('labelAlignment')).toBe('right');
                            });
                        Severity: Major
                        Found in src/components/RadioGroup/__test__/radioGroup.spec.js and 9 other locations - About 1 hr to fix
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 60..65
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 67..72
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 64..69
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 70..75
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 44..47
                        src/components/Rating/__test__/rating.spec.js on lines 24..27
                        src/components/Rating/__test__/rating.spec.js on lines 28..31
                        src/components/Slider/__test__/slider.spec.js on lines 38..41
                        src/components/Slider/__test__/slider.spec.js on lines 42..45

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

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

                            it('should set "left" to labelAlignment prop passed in the Label component', () => {
                                const component = mount(
                                    <CheckboxGroup label="CheckboxGroup Label" labelAlignment="left" />,
                                );
                                expect(component.find(StyledLabel).prop('labelAlignment')).toBe('left');
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 67..72
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 64..69
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 70..75
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 44..47
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 49..52
                        src/components/Rating/__test__/rating.spec.js on lines 24..27
                        src/components/Rating/__test__/rating.spec.js on lines 28..31
                        src/components/Slider/__test__/slider.spec.js on lines 38..41
                        src/components/Slider/__test__/slider.spec.js on lines 42..45

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

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

                            it('should set "right" to labelAlignment prop passed in the Label component', () => {
                                const component = mount(
                                    <RadioButtonGroup label="RadioButtonGroup Label" labelAlignment="right" />,
                                );
                                expect(component.find(StyledLabel).prop('labelAlignment')).toBe('right');
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 60..65
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 67..72
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 64..69
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 44..47
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 49..52
                        src/components/Rating/__test__/rating.spec.js on lines 24..27
                        src/components/Rating/__test__/rating.spec.js on lines 28..31
                        src/components/Slider/__test__/slider.spec.js on lines 38..41
                        src/components/Slider/__test__/slider.spec.js on lines 42..45

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

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

                            it('should set "right" to labelAlignment prop passed in the Label component', () => {
                                const component = mount(
                                    <CheckboxGroup label="CheckboxGroup Label" labelAlignment="right" />,
                                );
                                expect(component.find(StyledLabel).prop('labelAlignment')).toBe('right');
                        src/components/CheckboxGroup/__test__/checkboxGroup.spec.js on lines 60..65
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 64..69
                        src/components/RadioButtonGroup/__test__/radioButtonGroup.spec.js on lines 70..75
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 44..47
                        src/components/RadioGroup/__test__/radioGroup.spec.js on lines 49..52
                        src/components/Rating/__test__/rating.spec.js on lines 24..27
                        src/components/Rating/__test__/rating.spec.js on lines 28..31
                        src/components/Slider/__test__/slider.spec.js on lines 38..41
                        src/components/Slider/__test__/slider.spec.js on lines 42..45

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

                        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