airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function get_available_engine_specs has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

def get_available_engine_specs() -> dict[type[BaseEngineSpec], set[str]]:
    """
    Return available engine specs and installed drivers for them.
    """
    drivers: dict[str, set[str]] = defaultdict(set)
Severity: Minor
Found in superset/db_engine_specs/__init__.py - About 5 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 RightMenu has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

const RightMenu = ({
  align,
  settings,
  navbarRight,
  isFrontendRoute,
Severity: Minor
Found in superset-frontend/src/features/home/RightMenu.tsx - About 5 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 Heatmap.js has 378 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-plugin-chart-heatmap/src/Heatmap.js - About 5 hrs to fix

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

          def init_views(self) -> None:
              #
              # We're doing local imports, as several of them import
              # models which in turn try to import
              # the global Flask app
      Severity: Major
      Found in superset/initialization/__init__.py - About 5 hrs to fix

        Function createCustomizeSection has 126 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function createCustomizeSection(
          label: string,
          controlSuffix: string,
        ): ControlSetRow[] {
          return [

          File useSticky.tsx has 376 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 DndFilterSelect.test.tsx has 376 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 Menu.tsx has 375 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/features/home/Menu.tsx - About 5 hrs to fix

                File DateFilterLabel.tsx has 374 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 useDatabaseValidation has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function useDatabaseValidation() {
                    const [validationErrors, setValidationErrors] = useState<JsonObject | null>(
                      null,
                    );
                    const getValidation = useCallback(
                  Severity: Major
                  Found in superset-frontend/src/views/CRUD/hooks.ts - About 4 hrs to fix

                    File PropertiesModal.test.tsx has 373 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 dashboard.py has 372 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/models/dashboard.py - About 4 hrs to fix

                        Function OptionWrapper has 123 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          Function SubMenuComponent has 123 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const SubMenuComponent: FunctionComponent<SubMenuProps> = props => {
                            const [showMenu, setMenu] = useState<MenuMode>('horizontal');
                            const [navRightStyle, setNavRightStyle] = useState('nav-right');
                          
                            let hasHistory = true;
                          Severity: Major
                          Found in superset-frontend/src/features/home/SubMenu.tsx - About 4 hrs to fix

                            Function filters has 123 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              const filters: Filters = useMemo(() => {
                                const filters_list = [
                                  {
                                    Header: t('Name'),
                                    key: 'search',
                            Severity: Major
                            Found in superset-frontend/src/pages/ChartList/index.tsx - About 4 hrs to fix

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

                                  def is_select(self) -> bool:
                                      # make sure we strip comments; prevents a bug with comments in the CTE
                                      parsed = sqlparse.parse(self.strip_comments())
                                      seen_select = False
                              
                              
                              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 processing_time_offsets has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def processing_time_offsets(  # pylint: disable=too-many-locals,too-many-statements
                                      self,
                                      df: pd.DataFrame,
                                      query_object: QueryObject,
                                  ) -> CachedTimeOffset:
                              Severity: Minor
                              Found in superset/common/query_context_processor.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 handle_cursor has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def handle_cursor(  # pylint: disable=too-many-locals
                                      cls, cursor: Any, query: Query
                                  ) -> None:
                                      """Updates progress information"""
                                      # pylint: disable=import-outside-toplevel
                              Severity: Minor
                              Found in superset/db_engine_specs/hive.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 ColumnSelectPopover has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const ColumnSelectPopover = ({
                                columns,
                                editedColumn,
                                getCurrentTab,
                                hasCustomLabel,

                              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