airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

File clickhouse.py has 337 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/clickhouse.py - About 4 hrs to fix

    File getInitialState.test.ts has 337 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/reducers/getInitialState.test.ts - About 4 hrs to fix

      File data.ts has 337 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 naturalSort has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

        const naturalSort = (as, bs) => {
          // nulls first
          if (bs !== null && as === null) {
            return -1;
          }

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

        def insert_rls_in_predicate(
            token_list: TokenList,
            database_id: int,
            default_schema: str | None,
        ) -> TokenList:
        Severity: Minor
        Found in superset/sql_parse.py - About 4 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 28 (exceeds 5 allowed). Consider refactoring.
        Open

            def _import(configs: dict[str, Any]) -> None:
                # import databases first
                database_ids: dict[str, int] = {}
                for file_name, config in configs.items():
                    if file_name.startswith("databases/"):
        Severity: Minor
        Found in superset/commands/importers/v1/assets.py - About 4 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 PluginFilterSelect has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function PluginFilterSelect(props: PluginFilterSelectProps) {
          const {
            coltypeMap,
            data,
            filterState,

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

        export default function OptionWrapper(
          props: OptionProps & {
            type: string;
            onShiftOptions: (dragIndex: number, hoverIndex: number) => void;
          },

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

        const AnnotationLayerModal: FunctionComponent<AnnotationLayerModalProps> = ({
          addDangerToast,
          addSuccessToast,
          onLayerAdd,
          onHide,

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

        export default function HeaderReportDropDown({
          dashboardId,
          chart,
          useTextMenu = false,
          setShowReportSubMenu,

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

        export default function transformProps(chartProps: ChartProps<QueryFormData>) {
          /**
           * This function is called after a successful response has been
           * received from the chart data endpoint, and is used to transform
           * the incoming data prior to being sent to the Visualization.

          Function passwordNeededField has 102 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const passwordNeededField = () => {
              if (
                !passwordFields.length &&
                !sshTunnelPasswordFields.length &&
                !sshTunnelPrivateKeyFields.length &&
          Severity: Major
          Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 4 hrs to fix

            File api.py has 336 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/row_level_security/api.py - About 4 hrs to fix

              File useKeywords.test.ts has 336 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.jsx has 335 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 changelog.py has 334 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
                  Severity: Minor
                  Found in RELEASING/changelog.py - About 4 hrs to fix

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

                      render() {
                        const {
                          ariaLabel,
                          autoFocus,
                          clearable,
                    Severity: Major
                    Found in superset-frontend/src/explore/components/controls/SelectControl.jsx - About 4 hrs to fix

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

                        render() {
                          return (
                            <div
                              css={css`
                                height: 100%;
                      Severity: Major
                      Found in superset-frontend/src/dashboard/components/SliceAdder.tsx - About 4 hrs to fix

                        File RangeFilterPlugin.tsx has 333 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/filters/components/Range/RangeFilterPlugin.tsx - About 4 hrs to fix

                          Function renderDisplayConfiguration has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            renderDisplayConfiguration() {
                              const {
                                color,
                                opacity,
                                style,
                            Severity
                            Category
                            Status
                            Source
                            Language