nexxtway/react-rainbow

View on GitHub

Showing 445 of 2,739 total issues

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

import React from 'react';
import { mount } from 'enzyme';
import Table from '../index';
import Column from '../../Column';
import { ESCAPE_KEY, ENTER_KEY } from '../../../libs/constants';
Severity: Major
Found in src/components/Table/__test__/table.spec.js - About 4 days to fix

    File countries.js has 1455 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import * as Flags from './flags';
    
    export default [
        {
            flagIcon: Flags.Afghanistan,
    Severity: Major
    Found in src/components/PhoneInput/countries.js - About 3 days to fix

      File SaintBarthelemy.js has 937 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React from 'react';
      import PropTypes from 'prop-types';
      
      function SvgSaintBarthelemy({ className, style }) {
          return (
      Severity: Major
      Found in src/components/PhoneInput/flags/SaintBarthelemy.js - About 2 days to fix

        File rainbowLegacyStyles.js has 774 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from 'react';
        import { createGlobalStyle } from 'styled-components';
        import { isServer } from '../../libs/utils';
        
        const fontsCDN = 'https://fonts.react-rainbow.io';
        Severity: Major
        Found in src/components/Application/rainbowLegacyStyles.js - About 1 day to fix

          Function InternalDropdown has 358 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const InternalDropdown = forwardRef((props, reference) => {
              const {
                  isLoading,
                  children,
                  value,
          Severity: Major
          Found in src/components/InternalDropdown/index.js - About 1 day to fix

            Function InternalDropdown has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
            Open

            const InternalDropdown = forwardRef((props, reference) => {
                const {
                    isLoading,
                    children,
                    value,
            Severity: Minor
            Found in src/components/InternalDropdown/index.js - About 1 day 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 timeSelect.spec.js has 666 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React from 'react';
            import { mount } from 'enzyme';
            import TimeSelect from '../timeSelect';
            import {
                LEFT_KEY,
            Severity: Major
            Found in src/components/TimePicker/__test__/timeSelect.spec.js - About 1 day to fix

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

              /* eslint-disable react/sort-comp */
              /* eslint-disable react/no-did-update-set-state, react/no-did-mount-set-state */
              import React, { Component } from 'react';
              import PropTypes from 'prop-types';
              import RenderIf from '../RenderIf';
              Severity: Major
              Found in src/components/Lookup/index.js - About 1 day to fix

                Function MultiSelect has 254 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

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

                  /* eslint-disable react/no-unused-prop-types */
                  import React, { useRef, useImperativeHandle, useState, useEffect } from 'react';
                  import PropTypes from 'prop-types';
                  import { useOutsideClick, useScrollingIntent } from '@rainbow-modules/hooks';
                  import Label from '../Input/label';
                  Severity: Major
                  Found in src/components/PhoneInput/index.js - About 1 day to fix

                    Function DoubleCalendar has 242 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function DoubleCalendar(props) {
                        const {
                            id,
                            className,
                            style,
                    Severity: Major
                    Found in src/components/Calendar/doubleCalendar/index.js - About 1 day to fix

                      Function PhoneInput has 234 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Function ColorInput has 224 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const ColorInput = props => {
                            const {
                                id,
                                className,
                                style,
                        Severity: Major
                        Found in src/components/ColorInput/index.js - About 1 day to fix

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

                              render() {
                                  const { activeTabName } = this.state;
                                  return (
                                      <div className="react-rainbow-getting-started_top-container">
                                          <Tabset
                          Severity: Major
                          Found in library/pages/GettingStartedPage/index.js - About 1 day to fix

                            Function CustomizationPage has 220 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function CustomizationPage(props) {
                                const { examples, name, exampleMode, codeRevision } = props;
                                const [activeTab, setActiveTab] = useState('overview');
                                const example5Ref = useRef();
                                const example7Ref = useRef();
                            Severity: Major
                            Found in library/pages/CustomizationPage/index.js - About 1 day to fix

                              File timePicker-1.spec.js has 529 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              const PageTimePicker = require('../../../src/components/TimePicker/pageObject');
                              const {
                                  ARROW_LEFT_KEY,
                                  ARROW_RIGHT_KEY,
                                  ARROW_UP_KEY,
                              Severity: Major
                              Found in integration/specs/TimePicker/timePicker-1.spec.js - About 1 day to fix

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

                                /* eslint-disable react/sort-comp */
                                /* eslint-disable no-console */
                                import React, { Component } from 'react';
                                import PropTypes from 'prop-types';
                                import { ThemeProvider } from 'styled-components';
                                Severity: Minor
                                Found in src/components/Table/index.js - About 7 hrs to fix

                                  Function ImportRecordsFlow has 186 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function ImportRecordsFlow(props) {
                                      const {
                                          className,
                                          style,
                                          isOpen,
                                  Severity: Major
                                  Found in src/components/ImportRecordsFlow/index.js - About 7 hrs to fix

                                    Function FileSelector has 183 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

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

                                      File timeSelect.js has 470 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      /* eslint-disable react/sort-comp */
                                      import React, { Component } from 'react';
                                      import PropTypes from 'prop-types';
                                      import ButtonIcon from '../ButtonIcon';
                                      import AmPmSelect from './ampmSelect';
                                      Severity: Minor
                                      Found in src/components/TimePicker/timeSelect.js - About 7 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language