nexxtway/react-rainbow

View on GitHub

Showing 445 of 2,739 total issues

Function useKeyNavigation has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

export default function useKeyNavigation({
    visibleNodes,
    selectedNode,
    onNodeSelect,
    onNodeExpand,
Severity: Minor
Found in src/components/Tree/hooks/useKeyNavigation.js - About 6 hrs to fix

Cognitive Complexity

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

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

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

Further reading

File index.js has 443 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, {
    useState,
    useRef,
    useEffect,
    useMemo,
Severity: Minor
Found in src/components/InternalDropdown/index.js - About 6 hrs to fix

    Function CurrencyInput has 157 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const CurrencyInput = forwardRef((props, ref) => {
        const {
            value,
            name,
            placeholder,
    Severity: Major
    Found in src/components/CurrencyInput/index.js - About 6 hrs to fix

      Function PercentInput has 156 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const PercentInput = forwardRef((props, ref) => {
          const {
              value,
              name,
              placeholder,
      Severity: Major
      Found in src/components/PercentInput/index.js - About 6 hrs to fix

        Function resolveOptions has 155 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function resolveOptions(conditions) {
            const {
                disableAnimations,
                disableLines,
                disableCurves,
        Severity: Major
        Found in src/components/Chart/resolveOptions.js - About 6 hrs to fix

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

              render() {
                  const {
                      style,
                      className,
                      label,
          Severity: Major
          Found in src/components/Lookup/index.js - About 6 hrs to fix

            Function MultiSelect has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
            Open

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

            Cognitive Complexity

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

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

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

            Further reading

            Function CounterInput has 139 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const CounterInput = React.forwardRef((props, ref) => {
                const {
                    id,
                    name,
                    value,
            Severity: Major
            Found in src/components/CounterInput/index.js - About 5 hrs to fix

              Function UserSignUp has 139 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function UserSignUp(props) {
                  const { className, style } = props;
                  return (
                      <svg
                          className={className}
              Severity: Major
              Found in library/exampleComponents/Icons/userSignup.js - About 5 hrs to fix

                File button.js has 394 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import styled from 'styled-components';
                import {
                    BORDER_RADIUS_2,
                    BORDER_RADIUS_SQUARE,
                    BORDER_RADIUS_SEMI_SQUARE,
                Severity: Minor
                Found in src/components/ButtonIcon/styled/button.js - About 5 hrs to fix

                  Function useHandleKeyDown has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function useHandleKeyDown(
                      focusedDate,
                      currentMonth,
                      rightCalendarMonth,
                      minDate,
                  Severity: Minor
                  Found in src/components/Calendar/doubleCalendar/hooks/useHandleKeyDown.js - About 5 hrs to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function useHandleKeyDown has 135 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function useHandleKeyDown(
                      focusedDate,
                      currentMonth,
                      rightCalendarMonth,
                      minDate,
                  Severity: Major
                  Found in src/components/Calendar/doubleCalendar/hooks/useHandleKeyDown.js - About 5 hrs to fix

                    Function Testing has 134 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const Testing = props => {
                        const { className } = props;
                        return (
                            <svg
                                className={className}
                    Severity: Major
                    Found in library/pages/components/FeatureList/images/testing.js - About 5 hrs to fix

                      File index.js has 390 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /* eslint-disable react/no-unescaped-entities, import/no-extraneous-dependencies */
                      import React, { useState, useContext, useRef } from 'react';
                      import PropTypes from 'prop-types';
                      import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
                      import { faList } from '@fortawesome/free-solid-svg-icons';
                      Severity: Minor
                      Found in library/pages/CustomizationPage/index.js - About 5 hrs to fix

                        File lookup.spec.js has 386 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import React from 'react';
                        import { mount } from 'enzyme';
                        import ButtonIcon from '../../ButtonIcon';
                        import Lookup from '..';
                        import StyledTextError from '../../Input/styled/errorText';
                        Severity: Minor
                        Found in src/components/Lookup/__test__/lookup.spec.js - About 5 hrs to fix

                          Function DatePicker has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const DatePicker = React.forwardRef((props, ref) => {
                              const {
                                  value,
                                  minDate,
                                  maxDate,
                          Severity: Major
                          Found in src/components/DatePicker/index.js - About 5 hrs to fix

                            Function Drawer has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function Drawer(props) {
                                const {
                                    id,
                                    isOpen,
                                    hideCloseButton,
                            Severity: Major
                            Found in src/components/Drawer/index.js - About 5 hrs to fix

                              File button.js has 382 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /* eslint-disable indent */
                              import styled from 'styled-components';
                              import {
                                  FONT_SIZE_HEADING_SMALL,
                                  FONT_SIZE_TEXT_MEDIUM,
                              Severity: Minor
                              Found in src/components/Button/styled/button.js - About 5 hrs to fix

                                Function DateTimePicker has 129 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const DateTimePicker = React.forwardRef((props, ref) => {
                                    const {
                                        placeholder,
                                        labelAlignment,
                                        hideLabel,
                                Severity: Major
                                Found in src/components/DateTimePicker/index.js - About 5 hrs to fix

                                  Function TimePicker has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const TimePicker = React.forwardRef((props, ref) => {
                                      const {
                                          placeholder,
                                          label,
                                          required,
                                  Severity: Major
                                  Found in src/components/TimePicker/index.js - About 4 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language