nexxtway/react-rainbow

View on GitHub

Showing 445 of 2,739 total issues

File AscensionIsland.js has 260 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import PropTypes from 'prop-types';

function SvgAscensionIsland({ className, style }) {
    return (
Severity: Minor
Found in src/components/PhoneInput/flags/AscensionIsland.js - About 2 hrs to fix

    File styled.js has 260 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import styled from 'styled-components';
    import attachThemeAttrs from '../../../styles/helpers/attachThemeAttrs';
    import {
        FONT_SIZE_HEADING_X_LARGE,
        FONT_SIZE_HEADING_LARGE,
    Severity: Minor
    Found in src/components/MarkdownOutput/renderers/styled.js - About 2 hrs to fix

      Function Trash has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Trash = props => {
          const { className, style } = props;
          return (
              <svg
                  className={className}
      Severity: Major
      Found in library/exampleComponents/Icons/trash.js - About 2 hrs to fix

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

        /* eslint-disable react/no-unused-prop-types */
        import React, { forwardRef, useState, useEffect, useRef, useImperativeHandle } from 'react';
        import PropTypes from 'prop-types';
        import {
            useLocale,
        Severity: Minor
        Found in src/components/CurrencyInput/index.js - About 2 hrs to fix

          Function useScrollControls has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function useScrollControls(scrollableRef) {
              const [showScrollUp, setShowScrollUp] = useState();
              const [showScrollDown, setShowScrollDown] = useState();
              const timer = useRef();
          
          

            Function Tree has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function Tree(props) {
                const {
                    data,
                    onNodeExpand,
                    onNodeCheck,
            Severity: Major
            Found in src/components/Tree/index.js - About 2 hrs to fix

              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

                          Function SearchIcon has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const SearchIcon = props => {
                              const { className, style } = props;
                              return (
                                  <svg
                                      className={className}
                          Severity: Major
                          Found in src/components/Lookup/icons/searchIcon.js - About 2 hrs to fix

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

                            import React from 'react';
                            import { mount } from 'enzyme';
                            import Tabset from '../index';
                            import Tab from '../../Tab';
                            import {
                            Severity: Minor
                            Found in src/components/Tabset/__test__/tabset.spec.js - About 2 hrs to fix

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

                              /* eslint-disable react/no-unused-prop-types */
                              import React, { useState, useRef, useImperativeHandle } from 'react';
                              import PropTypes from 'prop-types';
                              import Label from '../Input/label';
                              import RenderIf from '../RenderIf';
                              Severity: Minor
                              Found in src/components/FileSelector/index.js - About 2 hrs to fix

                                Function UniversalSearch has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const UniversalSearch = () => {
                                    const [recents, addRecents] = useLocalRecentSearches('rainbow-algolia-recent-searches');
                                    return (
                                        <>
                                            <StyledGlobalSearch
                                Severity: Major
                                Found in library/styleguideComponents/UniversalSearch/index.js - About 2 hrs to fix

                                  Function AccordionSection has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const AccordionSection = props => {
                                      const {
                                          style,
                                          disabled,
                                          children,
                                  Severity: Minor
                                  Found in src/components/AccordionSection/index.js - About 2 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 InternalOverlay has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const InternalOverlay = props => {
                                      const {
                                          render: ContentComponent,
                                          isVisible,
                                          triggerElementRef,
                                  Severity: Major
                                  Found in src/components/InternalOverlay/index.js - About 2 hrs to fix

                                    Function Drop has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export default function Drop(props) {
                                        const { className, style } = props;
                                        return (
                                            <svg className={className} style={style} width="64" height="70" viewBox="0 0 64 70">
                                                <g fill="none">
                                    Severity: Major
                                    Found in src/components/ImportRecordsFlow/icons/drop.js - About 2 hrs to fix

                                      Function CompressArrow has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const CompressArrow = props => {
                                          const { className, style } = props;
                                          return (
                                              <svg
                                                  className={className}
                                      Severity: Major
                                      Found in library/exampleComponents/Icons/compressArrow.js - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language