airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

File ExploreChartHeader.test.tsx has 407 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 types.ts has 407 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable camelcase */
    /**
     * 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
    Severity: Minor
    Found in superset-frontend/packages/superset-ui-chart-controls/src/types.ts - About 5 hrs to fix

      Function render has 144 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const {
            id,
            componentId,
            dashboardId,
      Severity: Major
      Found in superset-frontend/src/dashboard/components/gridComponents/Chart.jsx - About 5 hrs to fix

        Function transformProps has 144 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function transformProps(
          chartProps: EchartsTreeChartProps,
        ): TreeTransformedProps {
          const { width, height, formData, queriesData } = chartProps;
          const refs: Refs = {};

          Function useSimpleTabFilterProps has 144 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const useSimpleTabFilterProps = (props: Props) => {
            const defaultTimeFilter = useDefaultTimeFilter();
          
            const isOperatorRelevant = (operator: Operators, subject: string) => {
              const column = props.datasource.columns?.find(

            Function useSingleViewResource has 144 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function useSingleViewResource<D extends object = any>(
              resourceName: string,
              resourceLabel: string, // resourceLabel for translations
              handleErrorMsg: (errorMsg: string) => void,
              path_suffix = '',
            Severity: Major
            Found in superset-frontend/src/views/CRUD/hooks.ts - About 5 hrs to fix

              File index.tsx has 405 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/components/ImportModal/index.tsx - About 5 hrs to fix

                File index.tsx has 403 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/components/DatabaseSelector/index.tsx - About 5 hrs to fix

                  File postgres.py has 402 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/db_engine_specs/postgres.py - About 5 hrs to fix

                    File schemas.py has 402 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/dashboards/schemas.py - About 5 hrs to fix

                      File data.ts has 402 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 Icicle has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function Icicle(element, props) {
                          const {
                            width,
                            height,
                            data,

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

                            def _import(  # pylint: disable=too-many-locals, too-many-branches
                                configs: dict[str, Any],
                                overwrite: bool = False,
                                force_data: bool = False,
                            ) -> None:
                        Severity: Minor
                        Found in superset/commands/importers/v1/examples.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 FilterBarSettings has 139 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const FilterBarSettings = () => {
                          const dispatch = useDispatch();
                          const theme = useTheme();
                          const isCrossFiltersEnabled = useSelector<RootState, boolean>(
                            ({ dashboardInfo }) => dashboardInfo.crossFiltersEnabled,

                          File getControlValuesCompatibleWithDatasource.test.ts has 397 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 DatasourceControl.test.tsx has 397 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 SliceHeader.test.tsx has 397 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 index.tsx has 397 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/Home/index.tsx - About 5 hrs to fix

                                  Function render has 138 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    render() {
                                      const {
                                        depth,
                                        component: tabsComponent,
                                        parentComponent,
                                  Severity: Major
                                  Found in superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx - About 5 hrs to fix

                                    Function AllEntities has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function AllEntities() {
                                      const [tagId] = useQueryParam('id', NumberParam);
                                      const [tag, setTag] = useState<Tag | null>(null);
                                      const [showTagModal, setShowTagModal] = useState<boolean>(false);
                                      const { addSuccessToast, addDangerToast } = useToasts();
                                    Severity: Major
                                    Found in superset-frontend/src/pages/AllEntities/index.tsx - About 5 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language