airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function ResultSet has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
Open

const ResultSet = ({
  cache = false,
  csv = true,
  database = {},
  displayLimit,
Severity: Minor
Found in superset-frontend/src/SqlLab/components/ResultSet/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 fixtures.ts has 723 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/fixtures.ts - About 1 day to fix

    File VizTypeGallery.tsx has 718 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 execute.py has 716 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/commands/report/execute.py - About 1 day to fix

        Function useExploreAdditionalActionsMenu has 326 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const useExploreAdditionalActionsMenu = (
          latestQueryFormData,
          canDownloadCSV,
          slice,
          onOpenInEditor,

          File api.py has 707 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/tags/api.py - About 1 day to fix

            Function RowLevelSecurityModal has 324 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function RowLevelSecurityModal(props: RowLevelSecurityModalProps) {
              const { rule, addDangerToast, addSuccessToast, onHide, show } = props;
            
              const [currentRule, setCurrentRule] = useState<RLSObject>({
                ...DEFAULT_RULE,
            Severity: Major
            Found in superset-frontend/src/features/rls/RowLevelSecurityModal.tsx - About 1 day to fix

              Function TagList has 324 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function TagList(props: TagListProps) {
                const { addDangerToast, addSuccessToast, user } = props;
                const { userId } = user;
              
                const initialFilters = useMemo(
              Severity: Major
              Found in superset-frontend/src/pages/Tags/index.tsx - About 1 day to fix

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

                  Function DashboardBuilder has 321 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const DashboardBuilder: FC<DashboardBuilderProps> = () => {
                    const dispatch = useDispatch();
                    const uiConfig = useUiConfig();
                    const theme = useTheme();
                  
                  

                    File config.py has 700 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 Heatmap has 319 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function Heatmap(element, props) {
                        const {
                          data,
                          width,
                          height,
                      Severity: Major
                      Found in superset-frontend/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js - About 1 day to fix

                        File query_context_processor.py has 694 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 RowLevelSecurityList has 313 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function RowLevelSecurityList(props: RLSProps) {
                            const { addDangerToast, addSuccessToast, user } = props;
                            const [ruleModalOpen, setRuleModalOpen] = useState<boolean>(false);
                            const [currentRule, setCurrentRule] = useState(null);
                          
                          
                          Severity: Major
                          Found in superset-frontend/src/pages/RowLevelSecurityList/index.tsx - About 1 day to fix

                            File index.tsx has 686 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 data.ts has 682 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 raise_for_access has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def raise_for_access(
                                        # pylint: disable=too-many-arguments,too-many-branches,too-many-locals,too-many-statements
                                        self,
                                        dashboard: Optional["Dashboard"] = None,
                                        chart: Optional["Slice"] = None,
                                Severity: Minor
                                Found in superset/security/manager.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 get_since_until has a Cognitive Complexity of 76 (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 SqlEditor has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const SqlEditor: 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 index.jsx has 667 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/dashboard/components/Header/index.jsx - About 1 day to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language