airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function renderAdvancedFieldset has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderAdvancedFieldset() {
    const { datasource } = this.state;
    return (
      <Fieldset
        title={t('Advanced')}
Severity: Major
Found in superset-frontend/src/components/Datasource/DatasourceEditor.jsx - About 2 hrs to fix

    Function applyFilters has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      applyFilters() {
        const { appliedFilters } = this;
        const { activeFilters, ownDataCharts, slices } = this.props;
    
        // refresh charts if a filter was removed, added, or changed
    Severity: Major
    Found in superset-frontend/src/dashboard/components/Dashboard.jsx - About 2 hrs to fix

      Function columns has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          .map((key: string, i) => {
            const dataType = coltypes[i];
            const config = columnConfig[key] || {};
            // for the purpose of presentation, only numeric values are treated as metrics
            // because users can also add things like `MAX(str_col)` as a metric.
      Severity: Major
      Found in superset-frontend/plugins/plugin-chart-table/src/transformProps.ts - About 2 hrs to fix

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

          export function getFilterValues(
            tab: TableTab,
            welcomeTable: WelcomeTable,
            user?: User,
            otherTabFilters?: Filter[],
          Severity: Major
          Found in superset-frontend/src/views/CRUD/utils.tsx - About 2 hrs to fix

            File index.tsx has 255 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/SqlEditorLeftBar/index.tsx - About 2 hrs to fix

              Function createHandleSave has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                async () => {
                  const transformFilter = (id: string) => {
                    const formInputs = values.filters?.[id] || filterConfigMap[id];
                    if (!formInputs) {
                      return undefined;

                File line.test.ts has 255 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 nativeFilters.test.ts has 255 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 254 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/AsyncAceEditor/index.tsx - About 2 hrs to fix

                      Function processRecord has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                        processRecord(record) {
                          // this code is called in a tight loop
                          const colKey = [];
                          const rowKey = [];
                          this.props.cols.forEach(col => {

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

                        isValid() {
                          const nullCheckOperators = [Operators.IsNotNull, Operators.IsNull].map(
                            op => OPERATOR_ENUM_TO_OPERATOR_TYPE[op].operation,
                          );
                          const truthCheckOperators = [Operators.IsTrue, Operators.IsFalse].map(

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

                      const ExploreChartPanel = ({
                        chart,
                        slice,
                        vizType,
                        ownState,
                      Severity: Minor
                      Found in superset-frontend/src/explore/components/ExploreChartPanel/index.jsx - About 2 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_world_bank_health_n_pop has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def load_world_bank_health_n_pop(  # pylint: disable=too-many-locals
                          only_metadata: bool = False,
                          force: bool = False,
                          sample: bool = False,
                      ) -> None:
                      Severity: Minor
                      Found in superset/examples/world_bank.py - About 2 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 16 (exceeds 5 allowed). Consider refactoring.
                      Open

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

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

                      def downgrade_filter_set(filter_set: dict[str, Any]) -> int:
                          changed_filters = 0
                          old_data_mask = filter_set.pop("dataMask", {})
                          native_filters = {}
                          data_mask = {"nativeFilters": native_filters}

                      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 16 (exceeds 5 allowed). Consider refactoring.
                      Open

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

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

                      def downgrade():
                          bind = op.get_bind()
                          session = db.Session(bind=bind)
                      
                          for dashboard in paginated_update(session.query(Dashboard)):

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

                          def get_fk_many_from_list(
                              object_list: list[Any],
                              fkmany: list[Column],
                              fkmany_class: builtins.type[TableColumn | SqlMetric],
                              key_attr: str,
                      Severity: Minor
                      Found in superset/connectors/sqla/models.py - About 2 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_physical_table_metadata has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def get_physical_table_metadata(
                          database: Database,
                          table: Table,
                          normalize_columns: bool,
                      ) -> list[ResultSetColumnType]:
                      Severity: Minor
                      Found in superset/connectors/sqla/utils.py - About 2 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