nexxtway/react-rainbow

View on GitHub

Showing 2,739 of 2,739 total issues

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

    it('should set tabIndex as -1 in section element', () => {
        const component = mount(
            <Modal isOpen>
                <p />
            </Modal>,
Severity: Major
Found in src/components/Modal/__test__/modal.spec.js and 1 other location - About 2 hrs to fix
src/components/Drawer/__test__/drawer.spec.js on lines 57..64

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

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

})`
    font: inherit;
    display: inline-flex;
    justify-content: center;
    align-items: center;
Severity: Major
Found in src/components/ButtonIcon/styled/button.js and 1 other location - About 2 hrs to fix
src/components/Select/styled/select.js on lines 16..143

Duplicated Code

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

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

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

Tuning

This issue has a mass of 79.

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

                <StyledTrigger
                    ref={triggerRef}
                    onClick={handleClick}
                    onFocus={event => handleFocus(event, 0)}
                    onBlur={handleBlur}
Severity: Major
Found in src/components/ColorInput/index.js and 1 other location - About 2 hrs to fix
src/components/PhoneInput/index.js on lines 209..222

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

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 render the close button when the hideCloseButton prop is equal to true', () => {
        const component = mount(
            <Modal isOpen hideCloseButton>
                <p />
            </Modal>,
Severity: Major
Found in src/components/Modal/__test__/modal.spec.js and 1 other location - About 2 hrs to fix
src/components/Drawer/__test__/drawer.spec.js on lines 187..194

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

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 render the close button when the hideCloseButton prop is equal to true', () => {
        const component = mount(
            <Drawer isOpen hideCloseButton>
                <p />
            </Drawer>,
Severity: Major
Found in src/components/Drawer/__test__/drawer.spec.js and 1 other location - About 2 hrs to fix
src/components/Modal/__test__/modal.spec.js on lines 206..213

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

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 the focus to the first menu item when open the menu', async () => {
        const buttonMenu = new PageButtonMenu(MENU_BTN);
        await buttonMenu.click();
        const menuItem = await buttonMenu.getItem(0);
        await expect(await menuItem.hasFocus()).toBe(true);
Severity: Major
Found in integration/specs/ButtonMenu/buttonMenu-5.spec.js and 1 other location - About 2 hrs to fix
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 48..53

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

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 tabIndex as -1 in section element', () => {
        const component = mount(
            <Drawer isOpen>
                <p />
            </Drawer>,
Severity: Major
Found in src/components/Drawer/__test__/drawer.spec.js and 1 other location - About 2 hrs to fix
src/components/Modal/__test__/modal.spec.js on lines 47..54

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

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

SingleCalendar.defaultProps = {
    value: undefined,
    minDate: undefined,
    maxDate: undefined,
    onChange: () => {},
Severity: Major
Found in src/components/Calendar/singleCalendar.js and 1 other location - About 2 hrs to fix
src/components/Calendar/doubleCalendar/index.js on lines 321..334

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

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

    constructor(props) {
        super(props);
        this.state = {
            isVisible: false,
        };
Severity: Major
Found in library/pages/components/DesignDetails/innerImg.js and 1 other location - About 2 hrs to fix
library/styleguideComponents/StyleGuide/index.js on lines 32..39

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

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 StyledSelect = attachThemeAttrs(styled.select)`
    font: inherit;
    margin: 0;
    text-transform: none;
    width: 100%;
Severity: Major
Found in src/components/Select/styled/select.js and 1 other location - About 2 hrs to fix
src/components/ButtonIcon/styled/button.js on lines 31..440

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

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 set any title in the content container element when the content passed is not a string', () => {
        const component = mount(<Header sortDirection="asc" content={<div />} />);
        expect(component.find('span.rainbow-table_header-content').prop('title')).toBe(undefined);
    });
Severity: Major
Found in src/components/Table/head/__test__/header.spec.js and 1 other location - About 2 hrs to fix
src/components/Table/head/__test__/header.spec.js on lines 29..32

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

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

PageTimePicker has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

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

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

        render() {
            return (
                <aside className="rainbow-admin_vertical-navigation rainbow-p-vertical_medium">
                    <VerticalNavigation
                        selectedItem={this.state.selectedItem}
    Severity: Major
    Found in examples/create-react-app/src/pages/Admin/sideNavigation.js - About 2 hrs to fix

      Function getFormattedValue has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function getFormattedValue(value, highlightMatch, icon) {
          if (!value) return null;
      
          if (value && typeof value === 'string') {
              return {
      Severity: Major
      Found in src/components/GoogleAddressLookup/helpers/getFormattedValue.js - About 2 hrs to fix

        Function YearSelect has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const YearSelect = React.forwardRef((props, ref) => {
            const { currentYear, yearsRange, onYearChange, onClick, onFocus, onBlur, tabIndex } = props;
            const selectRef = useRef();
            const selectId = useUniqueIdentifier('select');
            const [isEditMode, setEditMode] = useState(false);
        Severity: Major
        Found in src/components/Calendar/doubleCalendar/yearSelect/index.js - About 2 hrs to fix

          Function Csv has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function Csv(props) {
              const { className, style } = props;
              return (
                  <svg
                      className={className}
          Severity: Major
          Found in src/components/ImportRecordsFlow/icons/csv.js - About 2 hrs to fix

            Function FeatureList has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function FeatureList(props) {
                const { className, style } = props;
            
                const getContainerClassNames = () => classnames('react-rainbow-feature-list', className);
            
            
            Severity: Major
            Found in library/pages/components/FeatureList/index.js - About 2 hrs to fix

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

              const FORMATS = {
                  small: { year: '2-digit', month: 'numeric', day: 'numeric' },
                  medium: { year: 'numeric', month: '2-digit', day: '2-digit' },
                  large: { weekday: 'long', year: 'numeric', month: '2-digit', day: '2-digit' },
              };
              Severity: Major
              Found in src/components/Calendar/helpers/formatDate.js and 2 other locations - About 2 hrs to fix
              src/components/DatePicker/helpers/formatDate.js on lines 2..6
              src/components/DateTimePicker/helpers/formatDateTime.js on lines 2..6

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

              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 FORMATS = {
                  small: { year: '2-digit', month: 'numeric', day: 'numeric' },
                  medium: { year: 'numeric', month: '2-digit', day: '2-digit' },
                  large: { weekday: 'long', year: 'numeric', month: '2-digit', day: '2-digit' },
              };
              Severity: Major
              Found in src/components/DateTimePicker/helpers/formatDateTime.js and 2 other locations - About 2 hrs to fix
              src/components/Calendar/helpers/formatDate.js on lines 2..6
              src/components/DatePicker/helpers/formatDate.js on lines 2..6

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

              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 FORMATS = {
                  small: { year: '2-digit', month: 'numeric', day: 'numeric' },
                  medium: { year: 'numeric', month: '2-digit', day: '2-digit' },
                  large: { weekday: 'long', year: 'numeric', month: '2-digit', day: '2-digit' },
              };
              Severity: Major
              Found in src/components/DatePicker/helpers/formatDate.js and 2 other locations - About 2 hrs to fix
              src/components/Calendar/helpers/formatDate.js on lines 2..6
              src/components/DateTimePicker/helpers/formatDateTime.js on lines 2..6

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

              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