airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

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

  render() {
    const {
      adhocMetric,
      savedMetric,
      columns,

    Function useFilterScope has 87 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const useFilterScope = (filter: Filter) => {
      const layout = useSelector<RootState, Layout>(
        state => state.dashboardLayout.present,
      );
      const chartIds = useChartIds();

      File Partition.js has 311 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-disable react/sort-prop-types */
      /**
       * 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

        File databend.py has 311 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/db_engine_specs/databend.py - About 3 hrs to fix

          Function createAxisTitleControl has 86 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function createAxisTitleControl(axis: 'x' | 'y'): ControlSetRow[] {
            const isXAxis = axis === 'x';
            const isVertical = (controls: ControlStateMapping) =>
              Boolean(controls?.orientation.value === OrientationType.Vertical);
            const isHorizontal = (controls: ControlStateMapping) =>

            File FilterableTable.test.tsx has 310 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 data.ts has 310 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 confbandData.ts has 310 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 loggerMiddleware has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const loggerMiddleware = store => next => action => {
                    if (action.type !== LOG_EVENT) {
                      return next(action);
                    }
                  
                  
                  Severity: Minor
                  Found in superset-frontend/src/middleware/loggerMiddleware.js - 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 useExploreAdditionalActionsMenu has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const useExploreAdditionalActionsMenu = (
                    latestQueryFormData,
                    canDownloadCSV,
                    slice,
                    onOpenInEditor,

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

                  export default function exploreReducer(state = {}, action) {
                    const actionHandlers = {
                      [DYNAMIC_PLUGIN_CONTROLS_READY]() {
                        return {
                          ...state,
                  Severity: Minor
                  Found in superset-frontend/src/explore/reducers/exploreReducer.js - 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 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def upgrade():
                      bind = op.get_bind()
                      session = db.Session(bind=bind)
                  
                      dashboards = 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 update_native_filters_config has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def update_native_filters_config(
                          cls,
                          dashboard: Dashboard | None = None,
                          attributes: dict[str, Any] | None = None,
                      ) -> list[dict[str, Any]]:
                  Severity: Minor
                  Found in superset/daos/dashboard.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 _build_sql has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _build_sql(
                          self,
                          bounds: dict[str, Filter],
                          order: list[tuple[str, RequestedOrder]],
                          limit: int | None = None,
                  Severity: Minor
                  Found in superset/extensions/metadb.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 has_extra_cache_key_calls has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def has_extra_cache_key_calls(self, query_obj: QueryObjectDict) -> bool:
                          """
                          Detects the presence of calls to `ExtraCache` methods in items in query_obj that
                          can be templated. If any are present, the query must be evaluated to extract
                          additional keys for the cache key. This method is needed to avoid executing the
                  Severity: Minor
                  Found in superset/connectors/sqla/models.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 run has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def run(self) -> None:  # pylint: disable=too-many-statements,too-many-branches
                          self.validate()
                          ex_str = ""
                          ssh_tunnel = self._properties.get("ssh_tunnel")
                  
                  
                  Severity: Minor
                  Found in superset/commands/database/test_connection.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 _get_notification_content has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _get_notification_content(self) -> NotificationContent:
                          """
                          Gets a notification content, this is composed by a title and a screenshot
                  
                          :raises: ReportScheduleScreenshotFailedError
                  Severity: Minor
                  Found in superset/commands/report/execute.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 get_dataset_id_from_context has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def get_dataset_id_from_context(metric_key: str) -> int:
                      """
                      Retrieves the Dataset ID from the request context.
                  
                      :param metric_key: the metric key.
                  Severity: Minor
                  Found in superset/jinja_context.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 extent has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function extent<T = number | string | Date | undefined | null>(
                    values: T[],
                  ) {
                    let min: T | undefined;
                    let max: T | undefined;
                  Severity: Minor
                  Found in superset-frontend/plugins/plugin-chart-table/src/utils/extent.ts - 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 saveOrOverwrite has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                    async saveOrOverwrite(gotodash: boolean) {
                      this.setState({ isLoading: true });
                  
                      //  Create or retrieve dashboard
                      type DashboardGetResponse = {
                  Severity: Minor
                  Found in superset-frontend/src/explore/components/SaveModal.tsx - 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

                  Severity
                  Category
                  Status
                  Source
                  Language