airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function makeApi has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

export default function makeApi<
  Payload = SupersetPayload,
  Result = JsonObject,
  T extends ParseMethod = ParseMethod,
>(

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 ChartList has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

function ChartList(props: ChartListProps) {
  const {
    addDangerToast,
    addSuccessToast,
    user: { userId },
Severity: Minor
Found in superset-frontend/src/pages/ChartList/index.tsx - 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

File AsyncSelect.stories.tsx has 287 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
Severity: Minor
Found in superset-frontend/src/components/Select/AsyncSelect.stories.tsx - About 2 hrs to fix

    File ChangeDatasourceModal.tsx has 287 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Licensed to the Apache Software Foundation (ASF) under one
     * or more contributor license agreements.  See the NOTICE file
     * distributed with this work for additional information
     * regarding copyright ownership.  The ASF licenses this file
    Severity: Minor
    Found in superset-frontend/src/components/Datasource/ChangeDatasourceModal.tsx - About 2 hrs to fix

      File getTimeOffset.ts has 287 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * Licensed to the Apache Software Foundation (ASF) under one
       * or more contributor license agreements.  See the NOTICE file
       * distributed with this work for additional information
       * regarding copyright ownership.  The ASF licenses this file

        Function Calendar has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Calendar(element, props) {
          const {
            data,
            height,
            cellPadding = 3,

          File test_db.py has 286 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # Licensed to the Apache Software Foundation (ASF) under one
          # or more contributor license agreements.  See the NOTICE file
          # distributed with this work for additional information
          # regarding copyright ownership.  The ASF licenses this file
          # to you under the Apache License, Version 2.0 (the
          Severity: Minor
          Found in superset/cli/test_db.py - About 2 hrs to fix

            File FilterCard.test.tsx has 286 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * Licensed to the Apache Software Foundation (ASF) under one
             * or more contributor license agreements.  See the NOTICE file
             * distributed with this work for additional information
             * regarding copyright ownership.  The ASF licenses this file

              File index.tsx has 286 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * Licensed to the Apache Software Foundation (ASF) under one
               * or more contributor license agreements.  See the NOTICE file
               * distributed with this work for additional information
               * regarding copyright ownership.  The ASF licenses this file
              Severity: Minor
              Found in superset-frontend/src/dashboard/components/FiltersBadge/index.tsx - About 2 hrs to fix

                Function hotkeys has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const hotkeys = useMemo(() => {
                    // Get all hotkeys including ace editor hotkeys
                    // Get the user's OS
                    const userOS = detectOS();
                    const base = [
                Severity: Major
                Found in superset-frontend/src/SqlLab/components/SqlEditor/index.tsx - About 2 hrs to fix

                  File FilterControl.tsx has 285 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /**
                   * Licensed to the Apache Software Foundation (ASF) under one
                   * or more contributor license agreements.  See the NOTICE file
                   * distributed with this work for additional information
                   * regarding copyright ownership.  The ASF licenses this file

                    Function ShareMenuItems has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const ShareMenuItems = (props: ShareMenuItemProps) => {
                      const {
                        copyMenuItemTitle,
                        emailMenuItemTitle,
                        emailSubject,

                      BaseViz has 25 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class BaseViz:  # pylint: disable=too-many-public-methods
                          """All visualizations derive this base class"""
                      
                          viz_type: str | None = None
                          verbose_name = "Base Viz"
                      Severity: Minor
                      Found in superset/viz.py - About 2 hrs to fix

                        File SelectFilterPlugin.tsx has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /**
                         * Licensed to the Apache Software Foundation (ASF) under one
                         * or more contributor license agreements.  See the NOTICE file
                         * distributed with this work for additional information
                         * regarding copyright ownership.  The ASF licenses this file

                          File ChartHolder.tsx has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /**
                           * Licensed to the Apache Software Foundation (ASF) under one
                           * or more contributor license agreements.  See the NOTICE file
                           * distributed with this work for additional information
                           * regarding copyright ownership.  The ASF licenses this file

                            Function Label has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function Label(props: LabelProps) {
                              const theme = useTheme();
                              const { colors, transitionTiming } = theme;
                              const { type = 'default', onClick, children, ...rest } = props;
                              const {
                            Severity: Major
                            Found in superset-frontend/src/components/Label/index.tsx - About 2 hrs to fix

                              File Column.jsx has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /**
                               * Licensed to the Apache Software Foundation (ASF) under one
                               * or more contributor license agreements.  See the NOTICE file
                               * distributed with this work for additional information
                               * regarding copyright ownership.  The ASF licenses this file
                              Severity: Minor
                              Found in superset-frontend/src/dashboard/components/gridComponents/Column.jsx - About 2 hrs to fix

                                File dataset.py has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                # Licensed to the Apache Software Foundation (ASF) under one
                                # or more contributor license agreements.  See the NOTICE file
                                # distributed with this work for additional information
                                # regarding copyright ownership.  The ASF licenses this file
                                # to you under the Apache License, Version 2.0 (the
                                Severity: Minor
                                Found in superset/daos/dataset.py - About 2 hrs to fix

                                  File controlPanel.tsx has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  /**
                                   * Licensed to the Apache Software Foundation (ASF) under one
                                   * or more contributor license agreements.  See the NOTICE file
                                   * distributed with this work for additional information
                                   * regarding copyright ownership.  The ASF licenses this file

                                    File index.tsx has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    /**
                                     * Licensed to the Apache Software Foundation (ASF) under one
                                     * or more contributor license agreements.  See the NOTICE file
                                     * distributed with this work for additional information
                                     * regarding copyright ownership.  The ASF licenses this file
                                    Severity: Minor
                                    Found in superset-frontend/src/components/TableCollection/index.tsx - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language