airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function DrillDetailPane has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

export default function DrillDetailPane({
  formData,
  initialFilters,
}: {
  formData: QueryFormData;

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

export function dbReducer(
  state: Partial<DatabaseObject> | null,
  action: DBReducerActionType,
): Partial<DatabaseObject> | null {
  const trimmedState = {
Severity: Minor
Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - 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 ChartContextMenu has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

const ChartContextMenu = (
  {
    id,
    formData,
    onSelection,

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 controls.jsx has 371 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/explore/controls.jsx - About 4 hrs to fix

    File query_object.py has 370 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/common/query_object.py - About 4 hrs to fix

      File transformProps.ts has 369 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 EchartsSunburst has 121 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function EchartsSunburst(props: SunburstTransformedProps) {
          const {
            height,
            width,
            echartOptions,

          File DataTable.tsx has 368 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 Tab.test.tsx has 366 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 click has 119 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function click(b, i) {
                  if (inTransition) {
                    return;
                  }
                  const delay = d3.event.altKey ? 3750 : 375;
              Severity: Major
              Found in superset-frontend/plugins/legacy-plugin-chart-rose/src/Rose.js - About 4 hrs to fix

                Function upgrade has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                def upgrade():
                    bind = op.get_bind()
                    session = db.Session(bind=bind)
                
                    for slc in session.query(Slice).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 run has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                    def run(self) -> Optional[dict[str, Any]]:
                        initial_form_data = {}
                        if self._permalink_key is not None:
                            command = GetExplorePermalinkCommand(self._permalink_key)
                            permalink_value = command.run()
                Severity: Minor
                Found in superset/commands/explore/get.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 EchartsGraph has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                export default function EchartsGraph({
                  height,
                  width,
                  echartOptions,
                  formData,

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

                const TableElement = ({ table, ...props }: TableElementProps) => {
                  const { dbId, catalog, schema, name, expanded } = table;
                  const theme = useTheme();
                  const dispatch = useDispatch();
                  const {
                Severity: Minor
                Found in superset-frontend/src/SqlLab/components/TableElement/index.tsx - 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

                File utils.ts has 364 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/cypress-base/cypress/e2e/dashboard/utils.ts - About 4 hrs to fix

                  File Row.jsx has 363 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/components/gridComponents/Row.jsx - About 4 hrs to fix

                    File index.tsx has 363 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/Tags/index.tsx - About 4 hrs to fix

                      File index.tsx has 362 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/TableElement/index.tsx - About 4 hrs to fix

                        Function useImportResource has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function useImportResource(
                          resourceName: ImportResourceName,
                          resourceLabel: string, // resourceLabel for translations
                          handleErrorMsg: (errorMsg: string) => void,
                        ) {
                        Severity: Major
                        Found in superset-frontend/src/views/CRUD/hooks.ts - About 4 hrs to fix

                          File utils.js has 361 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/plugins/legacy-preset-chart-nvd3/src/utils.js - About 4 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language