airbnb/caravel

View on GitHub

Showing 2,424 of 6,113 total issues

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 catalogs.py has 502 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/migrations/shared/catalogs.py - About 1 day to fix

          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 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

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

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

                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

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

                        const AnnotationModal: FunctionComponent<AnnotationModalProps> = ({
                          addDangerToast,
                          addSuccessToast,
                          annotationLayerId,
                          annotation = null,
                        Severity: Minor
                        Found in superset-frontend/src/features/annotations/AnnotationModal.tsx - 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 FiltersConfigForm has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const FiltersConfigForm = (
                          {
                            expanded,
                            filterId,
                            filterToEdit,

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

                        export const getTimeOffset = ({
                          timeRangeFilter,
                          shifts,
                          startDate,
                          includeFutureOffsets = true,

                        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