airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function useResizeButton has 98 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function useResizeButton(
  minWidth: number,
  minHeight: number,
): [JSX.Element, number, number] {
  const [width, setWidth] = useState(POPOVER_INITIAL_WIDTH);

    Function customTimeRangeDecode has 98 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const customTimeRangeDecode = (
      timeRange: string,
    ): CustomRangeDecodeType => {
      const splitDateRange = timeRange.split(SEPARATOR);
    
    

      Function WorldMap has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

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

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

      def find_models(module: ModuleType) -> list[type[Model]]:
          """
          Find all models in a migration script.
          """
          models: list[type[Model]] = []
      Severity: Minor
      Found in scripts/benchmark_migration.py - About 3 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 migrate_roles has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      def migrate_roles(
          session: Session,
          pvm_key_map: PvmMigrationMapType,
          commit: bool = False,
      ) -> None:
      Severity: Minor
      Found in superset/migrations/shared/security_converge.py - About 3 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 upgrade has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      def upgrade():
          bind = op.get_bind()
          session = db.Session(bind=bind)
      
          for dashboard in session.query(Dashboard).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 upgrade has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      def upgrade():
          """
          Previous sqla_viz behaviour when creating a virtual dataset was faulty
          by creating an associated data access permission with [None] on the database name.
      
      

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

      def execute_sql_statement(  # pylint: disable=too-many-statements, too-many-locals
          sql_statement: str,
          query: Query,
          cursor: Any,
          log_params: Optional[dict[str, Any]],
      Severity: Minor
      Found in superset/sql_lab.py - About 3 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 load_configs has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      def load_configs(
          contents: dict[str, str],
          schemas: dict[str, Schema],
          passwords: dict[str, str],
          exceptions: list[ValidationError],
      Severity: Minor
      Found in superset/commands/importers/v1/utils.py - About 3 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 OptionControlLabel has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      export const OptionControlLabel = ({
        label,
        savedMetric,
        adhocMetric,
        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 ColorSchemeControl has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      const ColorSchemeControl = ({
        hasCustomLabelsColor = false,
        dashboardId,
        label = t('Color scheme'),
        onChange = () => {},

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

      export const ScopingModal = ({
        initialChartId,
        isVisible,
        closeModal,
      }: ScopingModalProps) => {

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

      export default async function callApi({
        body,
        cache = 'default',
        credentials = 'same-origin',
        fetchRetryOptions,

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

        render() {
          const {
            adhocFilter: propsAdhocFilter,
            options,
            onChange,

        File transformProps.ts has 328 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 DatabaseSelector.test.tsx has 327 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 index.tsx has 327 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/components/TableSelector/index.tsx - About 3 hrs to fix

              Function useTableColumns has 96 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const useTableColumns = (
                colnames?: string[],
                coltypes?: GenericDataType[],
                data?: Record<string, any>[],
                datasourceId?: string,
              Severity: Major
              Found in superset-frontend/src/explore/components/DataTableControl/index.tsx - About 3 hrs to fix

                File Header.test.tsx has 326 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/Header/Header.test.tsx - About 3 hrs to fix

                  Function getBasePivotSettings has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    getBasePivotSettings() {
                      // One-time extraction of pivot settings that we'll use throughout the render.
                  
                      const { props } = this;
                      const colAttrs = props.cols;
                    Severity
                    Category
                    Status
                    Source
                    Language