airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function upgrade has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
Open

def upgrade():
    bind = op.get_bind()
    session = db.Session(bind=bind)

    for slc in session.query(Slice).all():

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

export default function EchartsTimeseries({
  formData,
  height,
  width,
  echartOptions,

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 parse.py has 537 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/sql/parse.py - About 1 day to fix

    File tabbed_dashboard.py has 535 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/tabbed_dashboard.py - About 1 day to fix

      File hive.py has 535 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/hive.py - About 1 day to fix

        File chartAction.js has 534 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/components/Chart/chartAction.js - About 1 day to fix

          File SliceHeaderControls.test.tsx has 534 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 get_executor has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
            Open

            def get_executor(
                executor_types: list[ExecutorType],
                model: Dashboard | ReportSchedule | Slice,
                current_user: str | None = None,
            ) -> tuple[ExecutorType, str]:
            Severity: Minor
            Found in superset/tasks/utils.py - About 1 day 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 NotificationMethod.tsx has 529 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 Menu.test.tsx has 526 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/features/home/Menu.test.tsx - About 1 day to fix

                Function DataTable has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
                Open

                export default typedMemo(function DataTable<D extends object>({
                  tableClassName,
                  columns,
                  data,
                  serverPaginationData,

                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 catalogs.py has 520 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

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

                  export default function transformProps(
                    chartProps: EchartsFunnelChartProps,
                  ): FunnelChartTransformedProps {
                    const {
                      formData,

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

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

                      Function getDropPosition has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export default function getDropPosition(monitor, Component) {
                        const {
                          depth: componentDepth,
                          parentComponent,
                          component,
                      Severity: Minor
                      Found in superset-frontend/src/dashboard/util/getDropPosition.js - About 1 day 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 transformSeries has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function transformSeries(
                        series: SeriesOption,
                        colorScale: CategoricalColorScale,
                        colorScaleKey: string,
                        opts: {

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

                      File styles.ts has 516 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/features/databases/DatabaseModal/styles.ts - About 1 day to fix

                        Function PopKPI has 209 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function PopKPI(props: PopKPIProps) {
                          const {
                            height,
                            width,
                            bigNumber,

                          File utils.tsx has 514 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/views/CRUD/utils.tsx - About 1 day to fix
                            Severity
                            Category
                            Status
                            Source
                            Language