airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

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

export default function transformProps(
  chartProps: EchartsPieChartProps,
): PieChartTransformedProps {
  const {
    formData,

    Function dbReducer has 267 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function dbReducer(
      state: Partial<DatabaseObject> | null,
      action: DBReducerActionType,
    ): Partial<DatabaseObject> | null {
      const trimmedState = {
    Severity: Major
    Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 1 day to fix

      File saveModalActions.test.ts has 610 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/actions/saveModalActions.test.ts - About 1 day to fix

        File ExtraOptions.tsx has 606 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 drillby.test.ts has 601 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/cypress-base/cypress/e2e/dashboard/drillby.test.ts - About 1 day to fix

            Function FiltersConfigModal has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
            Open

            function FiltersConfigModal({
              isOpen,
              initialFilterId,
              createNewOnOpen,
              onSave,

            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 DndMetricSelect has 256 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const DndMetricSelect = (props: any) => {
              const { onChange, multi, datasource, savedMetrics } = props;
            
              const extra = useMemo<{ disallow_adhoc_metrics?: boolean }>(() => {
                let extra = {};

              File series.ts has 593 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* eslint-disable no-underscore-dangle */
              /**
               * 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: Major
              Found in superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts - About 1 day to fix

                File bigquery.py has 592 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/db_engine_specs/bigquery.py - About 1 day to fix

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

                  export default function transformProps(
                    chartProps: EchartsGaugeChartProps,
                  ): GaugeChartTransformedProps {
                    const {
                      width,

                    Function DateFilterLabel has 253 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function DateFilterLabel(props: DateFilterControlProps) {
                      const {
                        onChange,
                        onOpenPopover = noOp,
                        onClosePopover = noOp,

                      File Select.tsx has 586 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/components/Select/Select.tsx - About 1 day to fix

                        File index.tsx has 584 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/SavedQueryList/index.tsx - About 1 day to fix

                          File RightMenu.tsx has 582 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/features/home/RightMenu.tsx - About 1 day to fix

                            Function exploreReducer has 249 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function exploreReducer(state = {}, action) {
                              const actionHandlers = {
                                [DYNAMIC_PLUGIN_CONTROLS_READY]() {
                                  return {
                                    ...state,
                            Severity: Major
                            Found in superset-frontend/src/explore/reducers/exploreReducer.js - About 1 day to fix

                              Function Rose has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function Rose(element, props) {
                                const {
                                  data,
                                  width,
                                  height,
                              Severity: Minor
                              Found in superset-frontend/plugins/legacy-plugin-chart-rose/src/Rose.js - 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 sql_lab.py has 576 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_lab.py - About 1 day to fix

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

                                export default function transformProps(
                                  chartProps: EchartsBoxPlotChartProps,
                                ): BoxPlotChartTransformedProps {
                                  const {
                                    width,

                                  File index.tsx has 574 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/AlertReportList/index.tsx - About 1 day to fix

                                    Function AdhocFilterEditPopoverSimpleTabContent has 244 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const AdhocFilterEditPopoverSimpleTabContent: FC<Props> = props => {
                                      const {
                                        onSubjectChange,
                                        onOperatorChange,
                                        isOperatorRelevant,
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language