nexxtway/react-rainbow

View on GitHub

Showing 445 of 2,739 total issues

Function HelpText has 104 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const HelpText = React.forwardRef((props, ref) => {
    const { id, title, text, variant, tabIndex, iconSize, className, style } = props;

    const triggerRef = useRef();
    const helpTextId = useUniqueIdentifier('help-text');
Severity: Major
Found in src/components/HelpText/index.js - About 4 hrs to fix

    Function PrimitiveMenu has 103 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function LocationIcon has 103 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const LocationIcon = props => {
          const { className } = props;
          return (
              <svg
                  className={className}
      Severity: Major
      Found in src/components/PresenceMap/icons/locationIcon.js - About 4 hrs to fix

        Function ImportRecordsFlow has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

        function ImportRecordsFlow(props) {
            const {
                className,
                style,
                isOpen,
        Severity: Minor
        Found in src/components/ImportRecordsFlow/index.js - About 4 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 Code has 102 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

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

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

            Function StripeCardInput has 98 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const StripeCardInput = React.forwardRef((props, ref) => {
                const {
                    id,
                    apiKey,
                    label,
            Severity: Major
            Found in src/components/StripeCardInput/index.js - About 3 hrs to fix

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

                  render() {
                      const { hour, minutes, ampm, inputFocusedIndex } = this.state;
                      const { onCloseModal, cancelLabel, okLabel, hour24, className } = this.props;
                      const hourPlaceholder = this.prevHour || '--';
                      const minutesPlaceholder = this.prevMinutes || '--';
              Severity: Major
              Found in src/components/TimePicker/timeSelect.js - About 3 hrs to fix

                Function FilesIcon has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function FilesIcon() {
                    return (
                        <svg width="21px" height="20px" viewBox="0 0 21 20" version="1.1">
                            <g id="components" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
                                <g id="Components-FileSelector-" transform="translate(-432.000000, -1023.000000)">
                Severity: Major
                Found in src/components/FileSelector/icons/files.js - About 3 hrs to fix

                  Function DesignIcon has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const DesignIcon = props => {
                      const { className } = props;
                      return (
                          <svg className={className} width="25px" height="26px" viewBox="0 0 25 26" version="1.1">
                              <g id="design">
                  Severity: Major
                  Found in library/styleguideComponents/ComponentsList/icons/designIcon.js - About 3 hrs to fix

                    Function AssignFieldModal has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function AssignFieldModal(props) {
                        const {
                            isAssignFieldModalOpen,
                            onRequestClose,
                            columns,
                    Severity: Major
                    Found in src/components/ImportRecordsFlow/stepThree/assignFieldModal.js - About 3 hrs to fix

                      Function resolveCustomBackground has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function resolveCustomBackground(background) {
                          if (background && isValidColor(background)) {
                              const dark = isDark(background);
                              const mainText = getContrastText(background);
                              const theme = {
                      Severity: Minor
                      Found in src/styles/helpers/normalizeTheme.js - About 3 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

                      TimeSelect has 30 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      export default class TimeSelect extends Component {
                          constructor(props) {
                              super(props);
                              this.state = {
                                  hour: getHour(props.value),
                      Severity: Minor
                      Found in src/components/TimePicker/timeSelect.js - About 3 hrs to fix

                        Function CountriesDropdown has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            React.forwardRef((props, ref) => {
                                const {
                                    country,
                                    countries,
                                    isOpen,
                        Severity: Major
                        Found in src/components/PhoneInput/countriesDropdown/index.js - About 3 hrs to fix

                          Function CodeInput has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Function Saturation has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const Saturation = React.forwardRef((_props, ref) => {
                                const { rgba, hsv, tabIndex, onChange } = useContext(ColorPickerContext);
                                const containerRef = useRef();
                                const isMouseDown = useRef(false);
                                const [h, s, v] = hsv;
                            Severity: Major
                            Found in src/components/ColorPicker/commons/saturation/index.js - About 3 hrs to fix

                              Function DayComponent has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function DayComponent(props) {
                                  const {
                                      date,
                                      firstDayMonth,
                                      isSelected,
                              Severity: Major
                              Found in src/components/Calendar/day.js - About 3 hrs to fix

                                Function Photographer has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

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

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

                                  import React, { useRef, useState, useCallback, useEffect } from 'react';
                                  import PropTypes from 'prop-types';
                                  import { useUniqueIdentifier } from '../../../libs/hooks';
                                  import { Provider } from '../context';
                                  import RightIcon from '../icons/rightArrow';
                                  Severity: Minor
                                  Found in src/components/Calendar/doubleCalendar/index.js - About 3 hrs to fix

                                    Function WeeklyCalendar has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export default function WeeklyCalendar(props) {
                                        const {
                                            events,
                                            currentWeek,
                                            minDate,
                                    Severity: Major
                                    Found in src/components/WeeklyCalendar/index.js - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language