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

    async clickLeftMonthDay(day) {
        const buttonEl = await $(this.rootElement)
            .$$('table[role=grid]')[0]
            .$(`button=${day}`);
        if (await buttonEl.isExisting()) {
Severity: Major
Found in src/components/Calendar/pageObject/doubleCalendar.js and 1 other location - About 3 hrs to fix
src/components/Calendar/pageObject/doubleCalendar.js on lines 210..218

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

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

    async clickRightMonthDay(day) {
        const buttonEl = await $(this.rootElement)
            .$$('table[role=grid]')[1]
            .$(`button=${day}`);
        if (await buttonEl.isExisting()) {
Severity: Major
Found in src/components/Calendar/pageObject/doubleCalendar.js and 1 other location - About 3 hrs to fix
src/components/Calendar/pageObject/doubleCalendar.js on lines 91..99

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

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

        <svg
            width="16px"
            height="16px"
            viewBox="0 0 16 16"
            version="1.1"
Severity: Major
Found in src/components/Table/body/icons/cancel.js and 1 other location - About 3 hrs to fix
library/exampleComponents/Icons/homeFilled.js on lines 7..24

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

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 rowsWithSelection = rows.map((row, index) => {
            const currentSelectionLength = getCurrentSelectionLength(selectedRowsKeys);
            const maxSelectionReached = currentSelectionLength >= maxRowSelection;
            if (index >= start && index <= end && !maxSelectionReached) {
                selectedRowsKeys[row.key] = true;
src/components/Table/helpers/selector/getUpdatedRowsWhenDeselect.js on lines 29..41

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

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

SingleCalendar has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

class SingleCalendar extends Component {
    constructor(props) {
        super(props);
        this.state = {
            focusedDate: normalizeDate(props.value),
Severity: Minor
Found in src/components/Calendar/singleCalendar.js - About 3 hrs to fix

    PageDoubleCalendar has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

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

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

          render() {
              const {
                  value,
                  disabled,
                  readOnly,
      Severity: Major
      Found in src/components/Lookup/selectedValue.js - About 3 hrs to fix

        Function SidebarItem has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function SidebarItem(props) {
            const {
                label,
                icon,
                selectedIcon,
        Severity: Major
        Found in src/components/SidebarItem/index.js - About 3 hrs to fix

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

                  const component = mount(
                      <InternalDropdown label="Picklist" onChange={onChangeFn} multiple value={value}>
                          <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 112..118

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

          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} multiple value={value}>
                          <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 69..75

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

          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 set aria-hidden to false in container of the content when the content is expanded', () => {
                  const activeNames = 'accordion-test-1';
                  const { getByText } = render(
                      <Accordion activeSectionNames={activeNames}>
                          <AccordionSection name="accordion-test-1" label="Rainbow Accordion">
          Severity: Major
          Found in src/components/Accordion/__test__/accordion.spec.js and 1 other location - About 3 hrs to fix
          src/components/Accordion/__test__/accordion.spec.js on lines 139..149

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

          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 call event.preventDefault when press right key in input type checkbox', () => {
                  const component = mount(<SelectableCell inputType="checkbox" />);
                  const preventDefaultMockFn = jest.fn();
                  component.find('input').simulate('keyDown', {
                      keyCode: RIGHT_KEY,
          Severity: Major
          Found in src/components/Table/body/__test__/selectableCell.spec.js and 1 other location - About 3 hrs to fix
          src/components/Table/body/__test__/selectableCell.spec.js on lines 165..173

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

          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 close the DateTimePicker when click the ok button', async () => {
                  const picker = new PageDateTimePicker(DATETIMEPICKER);
                  await picker.click();
                  await picker.waitUntilOpen();
                  await picker.clickOKButton();
          Severity: Major
          Found in integration/specs/DateTimePicker/datetimepicker-1.spec.js and 1 other location - About 3 hrs to fix
          integration/specs/DateTimePicker/datetimepicker-1.spec.js on lines 34..41

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

          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 focus to trigger element when close modal with ESC key', async () => {
                  const modal = new PageModal(MODAL);
                  const triggerButton = $(BUTTON);
                  await triggerButton.click();
                  await modal.waitUntilOpen();
          Severity: Major
          Found in integration/specs/Modal/modal-1.spec.js and 1 other location - About 3 hrs to fix
          integration/specs/Modal/modal-1.spec.js on lines 41..48

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

          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 focus the close button when the modal is opened and press TAB', async () => {
                  const modal = new PageModal(MODAL);
                  const triggerButton = $(BUTTON);
                  await triggerButton.click();
                  await modal.waitUntilOpen();
          Severity: Major
          Found in integration/specs/Modal/modal-1.spec.js and 1 other location - About 3 hrs to fix
          integration/specs/Modal/modal-1.spec.js on lines 33..40

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

          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 call event.preventDefault when press left key in input type checkbox', () => {
                  const component = mount(<SelectableCell inputType="checkbox" />);
                  const preventDefaultMockFn = jest.fn();
                  component.find('input').simulate('keyDown', {
                      keyCode: LEFT_KEY,
          Severity: Major
          Found in src/components/Table/body/__test__/selectableCell.spec.js and 1 other location - About 3 hrs to fix
          src/components/Table/body/__test__/selectableCell.spec.js on lines 174..182

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

          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 close the DateTimePicker when click the cancel button', async () => {
                  const picker = new PageDateTimePicker(DATETIMEPICKER);
                  await picker.click();
                  await picker.waitUntilOpen();
                  await picker.clickCancelButton();
          Severity: Major
          Found in integration/specs/DateTimePicker/datetimepicker-1.spec.js and 1 other location - About 3 hrs to fix
          integration/specs/DateTimePicker/datetimepicker-1.spec.js on lines 26..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 98.

          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 set ariaExpanded to true in button when the AccordionSection is expanded', () => {
                  const activeNames = 'accordion-test-1';
                  const { getByRole } = render(
                      <Accordion activeSectionNames={activeNames}>
                          <AccordionSection name="accordion-test-1" label="Rainbow Accordion">
          Severity: Major
          Found in src/components/Accordion/__test__/accordion.spec.js and 1 other location - About 3 hrs to fix
          src/components/Accordion/__test__/accordion.spec.js on lines 158..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 98.

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

          function attachResizeEvent(element, resizeListener) {
              if (!element) {
                  return;
              }
              if (element.resizedAttached) {
          Severity: Major
          Found in src/libs/ResizeSensor/index.js - About 3 hrs to fix

            Function Path has 78 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function Path(props) {
                const { currentStepName, onClick, children, id, className, style } = props;
                const [hoveredStepName, setHoveredStepName] = useState(null);
                const [stepsCount, setStepsCount] = useState(0);
                const registeredSteps = useRef([]);
            Severity: Major
            Found in src/components/Path/index.js - About 3 hrs to fix
              Severity
              Category
              Status
              Source
              Language