airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function AsyncSelect has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
Open

  (
    {
      allowClear,
      allowNewOptions = false,
      ariaLabel,
Severity: Minor
Found in superset-frontend/src/components/Select/AsyncSelect.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 index.tsx has 811 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 utilities.js has 798 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 core.py has 787 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/core.py - About 1 day to fix

        File birth_names.py has 786 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/examples/birth_names.py - About 1 day to fix

          File hooks.ts has 783 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/views/CRUD/hooks.ts - About 1 day to fix

            Function PivotTableChart has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function PivotTableChart(props: PivotTableProps) {
              const {
                data,
                height,
                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

            File sql_parse.py has 780 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/sql_parse.py - About 1 day to fix

              File index.tsx has 774 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/pages/DashboardList/index.tsx - About 1 day to fix

                Function VizTypeGallery has 359 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function VizTypeGallery(props: VizTypeGalleryProps) {
                  const { selectedViz, onChange, onDoubleClick, className, denyList } = props;
                  const { mountedPluginMetadata } = usePluginContext();
                  const searchInputRef = useRef<HTMLInputElement>();
                  const [searchInputValue, setSearchInputValue] = useState('');

                  SupersetSecurityManager has 94 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class SupersetSecurityManager(  # pylint: disable=too-many-public-methods
                      SecurityManager
                  ):
                      userstatschartview = None
                      READ_ONLY_MODEL_VIEWS = {"Database", "DynamicPlugin"}
                  Severity: Major
                  Found in superset/security/manager.py - About 1 day to fix

                    Function DndFilterSelect has 355 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const DndFilterSelect = (props: DndFilterSelectProps) => {
                      const {
                        datasource,
                        onChange = () => {},
                        name: controlName,

                      BaseEngineSpec has 93 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class BaseEngineSpec:  # pylint: disable=too-many-public-methods
                          """Abstract class for database engine specific configurations
                      
                          Attributes:
                              allows_alias_to_source_column: Whether the engine is able to pick the
                      Severity: Major
                      Found in superset/db_engine_specs/base.py - About 1 day to fix

                        File data.ts has 752 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 2022-04-01_14-38_a9422eeaae74_new_dataset_models_take_2.py has 750 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

                            File UploadDataModal.test.tsx has 747 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 jinja_context.py has 736 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 ControlPanelsContainer.tsx has 736 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/explore/components/ControlPanelsContainer.tsx - About 1 day to fix

                                  File sqlLab.js has 729 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/reducers/sqlLab.js - About 1 day to fix

                                    File index.jsx has 727 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