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

    if (columnType === SELECTABLE_CHECKBOX) {
        return (
            <SelectableCell
                isSelected={isSelected}
                isDisabled={isDisabled}
Severity: Major
Found in src/components/Table/body/cell.js and 1 other location - About 1 hr to fix
src/components/Table/head/header.js on lines 78..89

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

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

    if (hasFileSelected) {
        return (
            <Preview
                fileName={fileName}
                fileType={fileType}
Severity: Major
Found in src/components/ImportRecordsFlow/stepTwo/index.js and 1 other location - About 1 hr to fix
src/components/MultiSelect/content.js on lines 9..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 62.

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

        if (type === SELECTABLE_CHECKBOX) {
            return (
                <SelectableHeader
                    onSelectAllRows={onSelectAllRows}
                    onDeselectAllRows={onDeselectAllRows}
Severity: Major
Found in src/components/Table/head/header.js and 1 other location - About 1 hr to fix
src/components/Table/body/cell.js on lines 130..141

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

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

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

    Function PageButtons has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function PageButtons(props) {
        const { pages, activePage, onChange, variant } = props;
    
        const getAriaCurrent = page => {
            if (page === activePage) {
    Severity: Minor
    Found in src/components/Pagination/pageButtons.js - About 1 hr to fix

      Function useOptions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function useOptions(props) {
          const {
              currency,
              currencyDisplay,
              currencySign,
      Severity: Minor
      Found in src/components/CurrencyInput/hooks/useOptions.js - About 1 hr to fix

        Function Edit has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function Edit(props) {
            const { className, style } = props;
            return (
                <svg
                    width="14px"
        Severity: Minor
        Found in src/components/Table/body/icons/edit.js - About 1 hr to fix

          Function Calendar has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function Calendar(props) {
              const { locale, selectionType, variant, value, onChange, ...rest } = props;
              const currentLocale = useLocale(locale);
              const currentValue = useCurrentDateFromValue(value);
              const range = useRangeFromValue(value, selectionType);
          Severity: Minor
          Found in src/components/Calendar/index.js - About 1 hr to fix

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

                constructor(props) {
                    super(props);
                    this.state = {
                        hour: getHour(props.value),
                        minutes: getMinutes(props.value),
            Severity: Minor
            Found in src/components/TimePicker/timeSelect.js - About 1 hr to fix

              Function Month has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function Month(props) {
                  const { firstDayMonth, selectedDate, minDate, maxDate, onSelectDate } = props;
                  let date = new Date(firstDayMonth);
                  const lastDayMonth = useMemo(() => getLastDayMonth(firstDayMonth), [firstDayMonth]);
                  const weeks = [];
              Severity: Minor
              Found in src/components/MonthlyCalendar/month.js - About 1 hr to fix

                Function Week has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function Week(props) {
                    const {
                        selectedDate,
                        startDate,
                        endDate,
                Severity: Minor
                Found in src/components/MonthlyCalendar/week.js - About 1 hr to fix

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

                          const component = mount(
                              <Preview
                                  field={props.field}
                                  fileFields={props.fileFields}
                                  data={props.data}
                  src/components/ImportRecordsFlow/stepThree/__test__/preview.spec.js on lines 50..57
                  src/components/ImportRecordsFlow/stepThree/__test__/preview.spec.js on lines 74..81

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

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

                      it('should set type to "checkbox" in PrimitiveCheckbox component', () => {
                          const component = mount(<SelectableHeader />);
                          expect(component.find('PrimitiveCheckbox').prop('type')).toBe('checkbox');
                      });
                  src/components/CheckboxToggle/__test__/checkboxToggle.spec.js on lines 6..9
                  src/components/Lookup/__test__/lookup.spec.js on lines 17..20
                  src/components/MenuDivider/__test__/menuDivider.spec.js on lines 6..9
                  src/components/RadioButtonGroup/__test__/radioButton.spec.js on lines 6..9
                  src/components/Rating/__test__/star.spec.js on lines 6..9
                  src/components/Table/body/__test__/selectableCell.spec.js on lines 16..19
                  src/components/Table/head/__test__/selectableHeader.spec.js on lines 11..14

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

                  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

                          const component = mount(
                              <Preview
                                  field={props.field}
                                  fileFields={props.fileFields}
                                  data={props.data}
                  src/components/ImportRecordsFlow/stepThree/__test__/preview.spec.js on lines 50..57
                  src/components/ImportRecordsFlow/stepThree/__test__/preview.spec.js on lines 61..68

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

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

                      it('should set the type prop in Input component to checkbox by default', () => {
                          const component = mount(<SelectableCell />);
                          expect(component.find('Input').prop('type')).toBe('checkbox');
                      });
                  Severity: Major
                  Found in src/components/Table/body/__test__/selectableCell.spec.js and 7 other locations - About 1 hr to fix
                  src/components/CheckboxToggle/__test__/checkboxToggle.spec.js on lines 6..9
                  src/components/Lookup/__test__/lookup.spec.js on lines 17..20
                  src/components/MenuDivider/__test__/menuDivider.spec.js on lines 6..9
                  src/components/RadioButtonGroup/__test__/radioButton.spec.js on lines 6..9
                  src/components/Rating/__test__/star.spec.js on lines 6..9
                  src/components/Table/head/__test__/selectableHeader.spec.js on lines 11..14
                  src/components/Table/head/__test__/selectableHeader.spec.js on lines 19..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 61.

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

                      it('should set the prop role as separator in li element', () => {
                          const component = mount(<MenuDivider />);
                          expect(component.find('li').prop('role')).toBe('separator');
                      });
                  Severity: Major
                  Found in src/components/MenuDivider/__test__/menuDivider.spec.js and 7 other locations - About 1 hr to fix
                  src/components/CheckboxToggle/__test__/checkboxToggle.spec.js on lines 6..9
                  src/components/Lookup/__test__/lookup.spec.js on lines 17..20
                  src/components/RadioButtonGroup/__test__/radioButton.spec.js on lines 6..9
                  src/components/Rating/__test__/star.spec.js on lines 6..9
                  src/components/Table/body/__test__/selectableCell.spec.js on lines 16..19
                  src/components/Table/head/__test__/selectableHeader.spec.js on lines 11..14
                  src/components/Table/head/__test__/selectableHeader.spec.js on lines 19..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 61.

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

                      it('should set type "search" in the input element', () => {
                          const component = mount(<Lookup />);
                          expect(component.find('input').prop('type')).toBe('search');
                      });
                  Severity: Major
                  Found in src/components/Lookup/__test__/lookup.spec.js and 7 other locations - About 1 hr to fix
                  src/components/CheckboxToggle/__test__/checkboxToggle.spec.js on lines 6..9
                  src/components/MenuDivider/__test__/menuDivider.spec.js on lines 6..9
                  src/components/RadioButtonGroup/__test__/radioButton.spec.js on lines 6..9
                  src/components/Rating/__test__/star.spec.js on lines 6..9
                  src/components/Table/body/__test__/selectableCell.spec.js on lines 16..19
                  src/components/Table/head/__test__/selectableHeader.spec.js on lines 11..14
                  src/components/Table/head/__test__/selectableHeader.spec.js on lines 19..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 61.

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

                      it('should set type checkbox to the input element', () => {
                          const component = mount(<CheckboxToggle />);
                          expect(component.find('input').prop('type')).toBe('checkbox');
                      });
                  src/components/Lookup/__test__/lookup.spec.js on lines 17..20
                  src/components/MenuDivider/__test__/menuDivider.spec.js on lines 6..9
                  src/components/RadioButtonGroup/__test__/radioButton.spec.js on lines 6..9
                  src/components/Rating/__test__/star.spec.js on lines 6..9
                  src/components/Table/body/__test__/selectableCell.spec.js on lines 16..19
                  src/components/Table/head/__test__/selectableHeader.spec.js on lines 11..14
                  src/components/Table/head/__test__/selectableHeader.spec.js on lines 19..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 61.

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

                      it('should set scope to "col" in th element', () => {
                          const component = mount(<SelectableHeader />);
                          expect(component.find('th').prop('scope')).toBe('col');
                      });
                  src/components/CheckboxToggle/__test__/checkboxToggle.spec.js on lines 6..9
                  src/components/Lookup/__test__/lookup.spec.js on lines 17..20
                  src/components/MenuDivider/__test__/menuDivider.spec.js on lines 6..9
                  src/components/RadioButtonGroup/__test__/radioButton.spec.js on lines 6..9
                  src/components/Rating/__test__/star.spec.js on lines 6..9
                  src/components/Table/body/__test__/selectableCell.spec.js on lines 16..19
                  src/components/Table/head/__test__/selectableHeader.spec.js on lines 19..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 61.

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

                      it('should set type radio to the input element', () => {
                          const component = mount(<RadioButtonItem />);
                          expect(component.find('input').prop('type')).toBe('radio');
                      });
                  src/components/CheckboxToggle/__test__/checkboxToggle.spec.js on lines 6..9
                  src/components/Lookup/__test__/lookup.spec.js on lines 17..20
                  src/components/MenuDivider/__test__/menuDivider.spec.js on lines 6..9
                  src/components/Rating/__test__/star.spec.js on lines 6..9
                  src/components/Table/body/__test__/selectableCell.spec.js on lines 16..19
                  src/components/Table/head/__test__/selectableHeader.spec.js on lines 11..14
                  src/components/Table/head/__test__/selectableHeader.spec.js on lines 19..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 61.

                  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