airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

File sql_lab.py has 463 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/models/sql_lab.py - About 7 hrs to fix

    File FiltersConfigModal.test.tsx has 462 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 _apply_granularity has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

          def _apply_granularity(
              self,
              query_object: QueryObject,
              form_data: dict[str, Any] | None,
              datasource: BaseDatasource,
      Severity: Minor
      Found in superset/common/query_context_factory.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

      File api.py has 459 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/annotation_layers/annotations/api.py - About 7 hrs to fix

        Function Sankey has 173 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Sankey(element, props) {
          const { data, width, height, colorScheme, sliceId } = props;
          const div = d3.select(element);
          div.classed(`superset-legacy-chart-sankey`, true);
          const margin = {
        Severity: Major
        Found in superset-frontend/plugins/legacy-plugin-chart-sankey/src/Sankey.js - About 6 hrs to fix

          File SaveModal.tsx has 455 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/explore/components/SaveModal.tsx - About 6 hrs to fix

            Function etag_cache has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
            Open

            def etag_cache(
                cache: Cache = cache_manager.cache,
                get_last_modified: Callable[..., datetime] | None = None,
                max_age: int | float = app.config["CACHE_DEFAULT_TIMEOUT"],
                raise_for_access: Callable[..., Any] | None = None,
            Severity: Minor
            Found in superset/utils/cache.py - About 6 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 _parse_structural_column has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
            Open

                def _parse_structural_column(  # pylint: disable=too-many-locals
                    cls,
                    parent_column_name: str,
                    parent_data_type: str,
                    result: list[ResultSetColumnType],
            Severity: Minor
            Found in superset/db_engine_specs/presto.py - About 6 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 NotificationMethod has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
            Open

            export const NotificationMethod: FunctionComponent<NotificationMethodProps> = ({
              setting = null,
              index,
              onUpdate,
              onRemove,

            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 renderTableRow has 172 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              renderTableRow(rowKey, rowIdx, pivotSettings) {
                // Render a single row in the pivot table.
            
                const {
                  rowAttrs,

              Function renderSourceFieldset has 172 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                renderSourceFieldset(theme) {
                  const { datasource } = this.state;
                  return (
                    <div>
                      <EditLockContainer>
              Severity: Major
              Found in superset-frontend/src/components/Datasource/DatasourceEditor.jsx - About 6 hrs to fix

                File Chart.jsx has 453 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/Chart.jsx - About 6 hrs to fix

                  Function Button has 171 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function Button(props: ButtonProps) {
                    const {
                      tooltip,
                      placement,
                      disabled = false,
                  Severity: Major
                  Found in superset-frontend/src/components/Button/index.tsx - About 6 hrs to fix

                    File controlPanel.tsx has 450 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 169 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function transformProps(
                        chartProps: EchartsGraphChartProps,
                      ): GraphChartTransformedProps {
                        const {
                          width,

                        Function convert_to_layout has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def convert_to_layout(positions):
                            root = get_empty_layout()
                        
                            convert(positions, 0, root[DASHBOARD_GRID_ID], root)
                        
                        

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

                        def import_dashboard(
                            # pylint: disable=too-many-locals,too-many-statements
                            dashboard_to_import: Dashboard,
                            dataset_id_mapping: Optional[dict[int, int]] = None,
                            import_time: Optional[int] = None,
                        Severity: Minor
                        Found in superset/commands/dashboard/importers/v0.py - About 6 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 DataSourcePanel has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export default function DataSourcePanel({
                          datasource,
                          formData,
                          controls: { datasource: datasourceControl },
                          actions,
                        Severity: Minor
                        Found in superset-frontend/src/explore/components/DatasourcePanel/index.tsx - About 6 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 SliceHeaderControls has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const SliceHeaderControls = (props: SliceHeaderControlsPropsWithRouter) => {
                          const [dropdownIsOpen, setDropdownIsOpen] = useState(false);
                          const [tableModalIsOpen, setTableModalIsOpen] = useState(false);
                          const [drillModalIsOpen, setDrillModalIsOpen] = useState(false);
                          const [selectedKeys, setSelectedKeys] = useState<string[]>([]);

                        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 index.jsx has 447 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /* eslint-disable camelcase */
                        /**
                         * 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
                          Severity
                          Category
                          Status
                          Source
                          Language