grommet/grommet

View on GitHub

Showing 545 of 2,098 total issues

Avoid too many return statements within this function.
Open

    return [
      `transform: translateX(${SLIDE_SIZES[size]}%);`,
      'transform: none;',
    ];
Severity: Major
Found in src/js/utils/animation.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return [
          `transform: translateY(${SLIDE_SIZES[size]}%);`,
          'transform: none;',
        ];
    Severity: Major
    Found in src/js/utils/animation.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return ['transform: rotateY(0);', 'transform: rotateY(90deg);'];
      Severity: Major
      Found in src/js/utils/animation.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return undefined;
        Severity: Major
        Found in src/js/utils/background.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            return `border: ${value};`;
          Severity: Major
          Found in src/js/utils/border.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return [`transform: rotate(0deg);`, `transform: rotate(-359deg);`];
            Severity: Major
            Found in src/js/utils/animation.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return [];
              Severity: Major
              Found in src/js/components/DataChart/DataChart.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      if (chartProp) return [chartProp];
                Severity: Major
                Found in src/js/components/DataChart/DataChart.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return [uniqueValues, undefined];
                  Severity: Major
                  Found in src/js/components/DataFilter/DataFilter.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return option[Object.keys(option)[0]];
                    Severity: Major
                    Found in src/js/components/Select/utils.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                        return option;
                      Severity: Major
                      Found in src/js/components/Select/utils.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                  return undefined;
                        Severity: Major
                        Found in src/js/components/DataChart/DataChart.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return [undefined, [min, max]];
                          Severity: Major
                          Found in src/js/components/DataFilter/DataFilter.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                              return undefined;
                            Severity: Major
                            Found in src/js/components/Button/StyledButtonKind.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                return valuesX.every((_, i) =>
                                  valuesX[i].value.every((value, index) => value === valuesY[i].value[index]),
                                );
                              Severity: Major
                              Found in src/js/components/Chart/utils.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return undefined; // pre-default, no kind
                                Severity: Major
                                Found in src/js/components/Button/Button.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return undefined;
                                  Severity: Major
                                  Found in src/js/components/SelectMultiple/SelectMultiple.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return controlsMenuItems.push(item);
                                    Severity: Major
                                    Found in src/js/components/Video/Video.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                          return input;
                                      Severity: Major
                                      Found in src/js/components/DateInput/DateInput.js - About 30 mins to fix

                                        Function ControlledDataTable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                        export const ControlledDataTable = () => {
                                          const [checked, setChecked] = React.useState([]);
                                        
                                          const onCheck = (event, value) => {
                                            if (event.target.checked) {
                                        Severity: Minor
                                        Found in src/js/components/DataTable/stories/Controlled.js - About 25 mins 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