airbnb/superset

View on GitHub

Showing 2,345 of 5,983 total issues

Database has 78 functions (exceeds 20 allowed). Consider refactoring.
Open

class Database(Model, AuditMixinNullable, ImportExportMixin):  # pylint: disable=too-many-public-methods
    """An ORM object that stores Database related information"""

    __tablename__ = "dbs"
    type = "table"
Severity: Major
Found in superset/models/core.py - About 1 day to fix

    File query_context_processor.py has 651 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: Major
    Found in superset/common/query_context_processor.py - About 1 day to fix

      Function SqlEditor has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
      Open

      const SqlEditor: React.FC<Props> = ({
        queryEditor,
        defaultQueryLimit,
        maxRow,
        displayLimit,
      Severity: Minor
      Found in superset-frontend/src/SqlLab/components/SqlEditor/index.tsx - About 1 day 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

      File jinja_context.py has 636 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: Major
      Found in superset/jinja_context.py - About 1 day to fix

        File config.py has 635 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: Major
        Found in superset/config.py - About 1 day to fix

          Function TimeTable has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
          Open

          const TimeTable = ({
            className,
            height,
            data,
            columnConfigs,
          Severity: Minor
          Found in superset-frontend/src/visualizations/TimeTable/TimeTable.jsx - About 1 day 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 convert has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
          Open

          def convert(positions, level, parent, root):
              if len(positions) == 0:
                  return
          
              if len(positions) == 1 or level >= MAX_RECURSIVE_LEVEL:

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

            render() {
              const {
                dashboardTitle,
                layout,
                expandedSlices,
          Severity: Major
          Found in superset-frontend/src/dashboard/components/Header/index.jsx - About 1 day to fix

            Function Home has 277 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function Home(): JSX.Element {
              const slider = useRef(null);
            
              const [slideIndex, setSlideIndex] = useState(0);
            
            
            Severity: Major
            Found in docs/src/pages/index.tsx - About 1 day to fix

              File index.tsx has 624 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: Major
              Found in superset-frontend/src/SqlLab/components/ResultSet/index.tsx - About 1 day to fix

                File Table.stories.tsx has 623 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: Major
                Found in superset-frontend/src/components/Table/Table.stories.tsx - About 1 day to fix

                  File transformProps.ts has 622 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 base.py has 620 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: Major
                    Found in superset/views/base.py - About 1 day to fix

                      File bigquery.py has 620 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: Major
                      Found in superset/db_engine_specs/bigquery.py - About 1 day to fix

                        File editmode.test.ts has 620 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: Major
                        Found in superset-frontend/cypress-base/cypress/e2e/dashboard/editmode.test.ts - About 1 day to fix

                          File DashboardBuilder.tsx has 608 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 drillby.test.ts has 602 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: Major
                            Found in superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts - About 1 day to fix

                              Function get_since_until has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def get_since_until(  # pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements
                                  time_range: str | None = None,
                                  since: str | None = None,
                                  until: str | None = None,
                                  time_shift: str | None = None,
                              Severity: Minor
                              Found in superset/utils/date_parser.py - About 1 day 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 dbReducer has 259 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function dbReducer(
                                state: Partial<DatabaseObject> | null,
                                action: DBReducerActionType,
                              ): Partial<DatabaseObject> | null {
                                const trimmedState = {
                              Severity: Major
                              Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 1 day to fix

                                Function DndMetricSelect has 256 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const DndMetricSelect = (props: any) => {
                                  const { onChange, multi, datasource, savedMetrics } = props;
                                
                                  const extra = useMemo<{ disallow_adhoc_metrics?: boolean }>(() => {
                                    let extra = {};
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language