airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

File core.py has 1402 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: Major
Found in superset/utils/core.py - About 3 days to fix

    Function drawGraph has 741 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const drawGraph = function drawGraph() {
        const d3Element = d3.select(element);
        d3Element.classed('superset-legacy-chart-nvd3', true);
        d3Element.classed(`superset-legacy-chart-nvd3-${kebabCase(vizType)}`, true);
        let svg = d3Element.select('svg');
    Severity: Major
    Found in superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js - About 3 days to fix

      Function TableChart has a Cognitive Complexity of 175 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function TableChart<D extends DataRecord = DataRecord>(
        props: TableChartTransformedProps<D> & {
          sticky?: DataTableProps<D>['sticky'];
        },
      ) {
      Severity: Minor
      Found in superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx - About 3 days 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 ChartList has 695 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function ChartList(props: ChartListProps) {
        const {
          addDangerToast,
          addSuccessToast,
          user: { userId },
      Severity: Major
      Found in superset-frontend/src/pages/ChartList/index.tsx - About 3 days to fix

        Function sqlLabReducer has 693 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function sqlLabReducer(state = {}, action) {
          const actionHandlers = {
            [actions.ADD_QUERY_EDITOR]() {
              const mergeUnsavedState = alterInArr(
                state,
        Severity: Major
        Found in superset-frontend/src/SqlLab/reducers/sqlLab.js - About 3 days to fix

          Function DashboardList has 662 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function DashboardList(props: DashboardListProps) {
            const { addDangerToast, addSuccessToast, user } = props;
          
            const { roles } = useSelector<any, UserWithPermissionsAndRoles>(
              state => state.user,
          Severity: Major
          Found in superset-frontend/src/pages/DashboardList/index.tsx - About 3 days to fix

            File supported_charts_dashboard.py has 1231 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: Major
            Found in superset/examples/supported_charts_dashboard.py - About 3 days to fix

              File FiltersConfigForm.tsx has 1230 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 schemas.py has 1226 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: Major
                Found in superset/databases/schemas.py - About 3 days to fix

                  File sqlLab.js has 1192 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: Major
                  Found in superset-frontend/src/SqlLab/actions/sqlLab.js - About 3 days to fix

                    Function AlertReportModal has a Cognitive Complexity of 150 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
                      addDangerToast,
                      onAdd,
                      onHide,
                      show,
                    Severity: Minor
                    Found in superset-frontend/src/features/alerts/AlertReportModal.tsx - About 3 days 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 presto.py has 1150 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: Major
                    Found in superset/db_engine_specs/presto.py - About 2 days to fix

                      File api.py has 1145 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: Major
                      Found in superset/datasets/api.py - About 2 days to fix

                        File data.ts has 1127 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 transformProps has 566 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export default function transformProps(
                            chartProps: EchartsMixedTimeseriesProps,
                          ): EchartsMixedTimeseriesChartTransformedProps {
                            const {
                              width,

                            Function Select has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
                            Open

                              (
                                {
                                  allowClear,
                                  allowNewOptions = false,
                                  allowSelectAll = true,
                            Severity: Minor
                            Found in superset-frontend/src/components/Select/Select.tsx - About 2 days 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 convert_filter_scopes_to_native_filters has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def convert_filter_scopes_to_native_filters(  # pylint: disable=invalid-name,too-many-branches,too-many-locals,too-many-nested-blocks,too-many-statements
                                json_metadata: dict[str, Any],
                                position_json: dict[str, Any],
                                filter_boxes: list[Slice],
                            ) -> list[dict[str, Any]]:
                            Severity: Minor
                            Found in superset/migrations/shared/native_filters.py - About 2 days 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 transformProps has 543 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function transformProps(
                              chartProps: EchartsTimeseriesChartProps,
                            ): TimeseriesChartTransformedProps {
                              const {
                                width,

                              File api.py has 1063 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: Major
                              Found in superset/charts/api.py - About 2 days to fix

                                Function Rose has 525 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function Rose(element, props) {
                                  const {
                                    data,
                                    width,
                                    height,
                                Severity: Major
                                Found in superset-frontend/plugins/legacy-plugin-chart-rose/src/Rose.js - About 2 days to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language