airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

SqlaTable has 58 functions (exceeds 20 allowed). Consider refactoring.
Open

class SqlaTable(
    Model,
    BaseDatasource,
    ExploreMixin,
):  # pylint: disable=too-many-public-methods
Severity: Major
Found in superset/connectors/sqla/models.py - About 1 day to fix

    Function postprocess_columns has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
    Open

    def postprocess_columns(session: Session) -> None:
        """
        At this step, we will
          - Add engine specific quotes to `expression` of physical columns
          - Tuck some extra metadata to `extra_json`

    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 deck.py has 510 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/deck.py - About 1 day to fix

      File d3.ts has 508 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 WorldMap has 204 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function WorldMap(element, props) {
          const {
            countryFieldtype,
            entity,
            data,

          File PivotTableChart.tsx has 505 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 date_parser.py has 501 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/date_parser.py - About 1 day to fix

              Function RangeFilterPlugin has 199 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function RangeFilterPlugin(props: PluginFilterRangeProps) {
                const {
                  data,
                  formData,
                  height,
              Severity: Major
              Found in superset-frontend/src/filters/components/Range/RangeFilterPlugin.tsx - About 7 hrs to fix

                Function transformProps has 198 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function transformProps(
                  chartProps: EchartsRadarChartProps,
                ): RadarChartTransformedProps {
                  const {
                    formData,

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

                    render() {
                      const {
                        dashboardTitle,
                        dashboardId,
                        dashboardInfo,

                    Function explore has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def explore(
                            self,
                            datasource_type: str | None = None,
                            datasource_id: int | None = None,
                            key: str | None = None,
                    Severity: Minor
                    Found in superset/views/core.py - About 7 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 merge_extra_filters has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def merge_extra_filters(form_data: dict[str, Any]) -> None:
                        # extra_filters are temporary/contextual filters (using the legacy constructs)
                        # that are external to the slice definition. We use those for dynamic
                        # interactive filters.
                        # Note extra_filters only support simple filters.
                    Severity: Minor
                    Found in superset/utils/core.py - About 7 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 transformProps has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const transformProps = (
                      chartProps: TableChartProps,
                    ): TableChartTransformedProps => {
                      const {
                        height,
                    Severity: Minor
                    Found in superset-frontend/plugins/plugin-chart-table/src/transformProps.ts - About 7 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 sqlLab.test.js has 494 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/SqlLab/reducers/sqlLab.test.js - About 7 hrs to fix

                      File utils.test.tsx has 494 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/views/CRUD/utils.test.tsx - About 7 hrs to fix

                        File ResultSet.test.tsx has 493 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/SqlLab/components/ResultSet/ResultSet.test.tsx - About 7 hrs to fix

                          Function data has 195 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const data = useMemo(() => {
                              const restoreSql = (query: QueryResponse) => {
                                dispatch(
                                  queryEditorSetSql({ id: query.sqlEditorId }, query.sql, query.id),
                                );
                          Severity: Major
                          Found in superset-frontend/src/SqlLab/components/QueryTable/index.tsx - About 7 hrs to fix

                            Function pivot_df has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def pivot_df(  # pylint: disable=too-many-locals, too-many-arguments, too-many-statements, too-many-branches
                                df: pd.DataFrame,
                                rows: list[str],
                                columns: list[str],
                                metrics: list[str],
                            Severity: Minor
                            Found in superset/charts/post_processing.py - About 7 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 transformProps has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export default function transformProps(
                              chartProps: BigNumberWithTrendlineChartProps,
                            ): BigNumberVizProps {
                              const {
                                width,

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

                            const DndMetricSelect = (props: any) => {
                              const { onChange, multi, datasource, savedMetrics } = props;
                            
                              const extra = useMemo<{ disallow_adhoc_metrics?: boolean }>(() => {
                                let extra = {};

                            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