airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function Table has 161 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function Table<RecordType extends object>(
  props: TableProps<RecordType>,
) {
  const {
    data,
Severity: Major
Found in superset-frontend/src/components/Table/index.tsx - About 6 hrs to fix

    Function ExploreViewContainer has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

    function ExploreViewContainer(props) {
      const dynamicPluginContext = usePluginContext();
      const dynamicPlugin = dynamicPluginContext.dynamicPlugins[props.vizType];
      const isDynamicPluginLoading = dynamicPlugin && dynamicPlugin.mounting;
      const wasDynamicPluginLoading = usePrevious(isDynamicPluginLoading);

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

    def execute_sql_statements(
        # pylint: disable=too-many-arguments, too-many-locals, too-many-statements, too-many-branches
        query_id: int,
        rendered_query: str,
        return_results: bool,
    Severity: Minor
    Found in superset/sql_lab.py - About 6 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 _import has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

        def _import(configs: dict[str, Any], overwrite: bool = False) -> None:
            # discover charts and datasets associated with dashboards
            chart_uuids: set[str] = set()
            dataset_uuids: set[str] = set()
            for file_name, config in configs.items():
    Severity: Minor
    Found in superset/commands/dashboard/importers/v1/__init__.py - About 6 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 42 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function transformProps(
      chartProps: EchartsMixedTimeseriesProps,
    ): EchartsMixedTimeseriesChartTransformedProps {
      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 AlertList has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

    function AlertList({
      addDangerToast,
      isReportEnabled = false,
      user,
      addSuccessToast,
    Severity: Minor
    Found in superset-frontend/src/pages/AlertReportList/index.tsx - About 6 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 DndColumnSelect has 160 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function DndColumnSelect(props: DndColumnSelectProps) {
      const {
        value,
        options,
        multi = true,

      File dashboardLayout.test.js has 432 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/actions/dashboardLayout.test.js - About 6 hrs to fix

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

          render() {
            const {
              gridComponent,
              handleComponentDrop,
              depth,
        Severity: Major
        Found in superset-frontend/src/dashboard/components/DashboardGrid.jsx - About 6 hrs to fix

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

            render() {
              const {
                component: rowComponent,
                parentComponent,
                index,
          Severity: Major
          Found in superset-frontend/src/dashboard/components/gridComponents/Row.jsx - About 6 hrs to fix

            Function VirtualTable has 158 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const VirtualTable = <RecordType extends object>(
              props: VirtualTableProps<RecordType>,
            ) => {
              const {
                columns,
            Severity: Major
            Found in superset-frontend/src/components/Table/VirtualTable.tsx - About 6 hrs to fix

              File index.tsx has 429 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/pages/QueryHistoryList/index.tsx - About 6 hrs to fix

                Function build_extra_filters has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                def build_extra_filters(  # pylint: disable=too-many-locals,too-many-nested-blocks
                    layout: dict[str, dict[str, Any]],
                    filter_scopes: dict[str, dict[str, Any]],
                    default_filters: dict[str, dict[str, list[Any]]],
                    slice_id: int,
                Severity: Minor
                Found in superset/views/utils.py - About 6 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 cidr_translate_filter_func has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                def cidr_translate_filter_func(
                    col: Column, operator: FilterOperator, values: list[Any]
                ) -> Any:
                    """
                    Convert a passed in column, FilterOperator and
                Severity: Minor
                Found in superset/advanced_data_type/plugins/internet_address.py - About 6 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 EditableTitle has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                export default function EditableTitle({
                  canEdit = false,
                  editing = false,
                  extraClasses,
                  multiLine = false,
                Severity: Minor
                Found in superset-frontend/src/components/EditableTitle/index.tsx - About 6 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 renderMetricCollection has 156 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  renderMetricCollection() {
                    const { datasource } = this.state;
                    const { metrics } = datasource;
                    const sortedMetrics = metrics?.length ? this.sortMetrics(metrics) : [];
                    return (
                Severity: Major
                Found in superset-frontend/src/components/Datasource/DatasourceEditor.jsx - About 6 hrs to fix

                  File ListView.test.jsx has 425 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/ListView/ListView.test.jsx - About 6 hrs to fix

                    File index.jsx has 425 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 views.py has 425 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/connectors/sqla/views.py - About 6 hrs to fix

                        File standardizedFormData.test.ts has 423 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
                          Category
                          Status
                          Source
                          Language