grommet/grommet

View on GitHub

Showing 545 of 2,098 total issues

Function Menu has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
Open

const Menu = forwardRef((props, ref) => {
  const {
    a11yTitle,
    'aria-label': ariaLabel,
    children,
Severity: Minor
Found in src/js/components/Menu/Menu.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

Function FileInput has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
Open

  (
    {
      a11yTitle,
      background,
      border,
Severity: Minor
Found in src/js/components/FileInput/FileInput.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

Function Video has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
Open

  (
    {
      alignSelf,
      autoPlay,
      children,
Severity: Minor
Found in src/js/components/Video/Video.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

Function Tabs has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
Open

  (
    {
      alignControls,
      children,
      flex,
Severity: Minor
Found in src/js/components/Tabs/Tabs.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 Calendar-test.tsx has 671 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';

import 'jest-styled-components';
import 'jest-axe/extend-expect';
import 'regenerator-runtime/runtime';
Severity: Major
Found in src/js/components/Calendar/__tests__/Calendar-test.tsx - About 1 day to fix

    Function Box has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
    Open

      (
        {
          a11yTitle,
          background: backgroundProp,
          border,
    Severity: Minor
    Found in src/js/components/Box/Box.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 WorldMap.js has 661 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { forwardRef } from 'react';
    import { ThemeContext } from 'styled-components';
    
    import { Drop } from '../Drop';
    import { defaultProps } from '../../default-props';
    Severity: Major
    Found in src/js/components/WorldMap/WorldMap.js - About 1 day to fix

      File DataChart.js has 651 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { forwardRef, useContext, useMemo, useState } from 'react';
      import { ThemeContext } from 'styled-components';
      import { Box } from '../Box';
      import { Chart, calcs, calcBounds } from '../Chart';
      import { Grid } from '../Grid';
      Severity: Major
      Found in src/js/components/DataChart/DataChart.js - About 1 day to fix

        File Chart.js has 648 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { useContext, useEffect, useMemo, useState } from 'react';
        
        import { ThemeContext } from 'styled-components';
        import { useLayoutEffect } from '../../utils/use-isomorphic-layout-effect';
        import { defaultProps } from '../../default-props';
        Severity: Major
        Found in src/js/components/Chart/Chart.js - About 1 day to fix

          File List.js has 643 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React, {
            Fragment,
            cloneElement,
            useContext,
            useMemo,
          Severity: Major
          Found in src/js/components/List/List.js - About 1 day to fix

            File TextInput-test.tsx has 631 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React from 'react';
            import 'jest-styled-components';
            import 'regenerator-runtime/runtime';
            import { fireEvent, render, waitFor } from '@testing-library/react';
            import { getByText, screen } from '@testing-library/dom';
            Severity: Major
            Found in src/js/components/TextInput/__tests__/TextInput-test.tsx - About 1 day to fix

              File Form.js has 626 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, {
                forwardRef,
                useCallback,
                useContext,
                useEffect,
              Severity: Major
              Found in src/js/components/Form/Form.js - About 1 day to fix

                Function SelectMultipleContainer has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                Open

                  (
                    {
                      allOptions,
                      children = null,
                      disabled: disabledProp,
                Severity: Minor
                Found in src/js/components/SelectMultiple/SelectMultipleContainer.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 Select-multiple-test.js has 602 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React from 'react';
                import { act, render, fireEvent, screen } from '@testing-library/react';
                import userEvent from '@testing-library/user-event';
                import { axe } from 'jest-axe';
                import 'jest-axe/extend-expect';
                Severity: Major
                Found in src/js/components/Select/__tests__/Select-multiple-test.js - About 1 day to fix

                  Function SelectMultiple has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
                  Open

                    (
                      {
                        a11yTitle,
                        'aria-label': ariaLabel,
                        alignSelf,
                  Severity: Minor
                  Found in src/js/components/SelectMultiple/SelectMultiple.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

                  Function RangeSelector has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                  Open

                    (
                      {
                        color,
                        defaultValues = [],
                        direction = 'horizontal',
                  Severity: Minor
                  Found in src/js/components/RangeSelector/RangeSelector.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 SelectMultipleContainer.js has 577 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React, {
                    forwardRef,
                    useCallback,
                    useContext,
                    useEffect,
                  Severity: Major
                  Found in src/js/components/SelectMultiple/SelectMultipleContainer.js - About 1 day to fix

                    File Data-test.tsx has 566 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import React from 'react';
                    import '@testing-library/jest-dom';
                    import { act, fireEvent, render, screen } from '@testing-library/react';
                    import 'jest-styled-components';
                    
                    
                    Severity: Major
                    Found in src/js/components/Data/__tests__/Data-test.tsx - About 1 day to fix

                      File Video.js has 562 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React, {
                        forwardRef,
                        useCallback,
                        useContext,
                        useEffect,
                      Severity: Major
                      Found in src/js/components/Video/Video.js - About 1 day to fix

                        Function DateInput has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                        Open

                          (
                            {
                              buttonProps, // when no format and not inline
                              calendarProps,
                              defaultValue,
                        Severity: Minor
                        Found in src/js/components/DateInput/DateInput.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

                        Severity
                        Category
                        Status
                        Source
                        Language