airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

File api.py has 394 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/queries/saved_queries/api.py - About 5 hrs to fix

    File SliceAdder.tsx has 394 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/dashboard/components/SliceAdder.tsx - About 5 hrs to fix

      Function redraw has 136 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        redraw({ width, height, ctx, isDragging, project }) {
          const {
            aggregation,
            compositeOperation,
            dotRadius,

        File getDropPosition.test.js has 393 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/dashboard/util/getDropPosition.test.js - About 5 hrs to fix

          Function drawChart has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

            drawChart() {
              if (this.canvas) {
                const {
                  data: rawData,
                  yDomain,

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

            renderColHeaderRow(attrName, attrIdx, pivotSettings) {
              // Render a single row in the column header at the top of the pivot table.
          
              const {
                rowAttrs,

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

              def to_series(  # pylint: disable=too-many-branches
                  self, df: pd.DataFrame, classed: str = "", title_suffix: str = ""
              ) -> list[dict[str, Any]]:
                  cols = []
                  for col in df.columns:
          Severity: Minor
          Found in superset/viz.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 setupErrorMessages has 134 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function setupErrorMessages() {
            const errorMessageComponentRegistry = getErrorMessageComponentRegistry();
          
            errorMessageComponentRegistry.registerValue(
              ErrorTypeEnum.FRONTEND_TIMEOUT_ERROR,
          Severity: Major
          Found in superset-frontend/src/setup/setupErrorMessages.ts - About 5 hrs to fix

            Function renderControlPanelSection has 132 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const renderControlPanelSection = (
                section: ExpandedControlPanelSectionConfig,
              ) => {
                const { controls } = props;
                const { label, description, visibility } = section;
            Severity: Major
            Found in superset-frontend/src/explore/components/ControlPanelsContainer.tsx - About 5 hrs to fix

              Function __init__ has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __init__(  # pylint: disable=too-many-locals
                      self,
                      data: DbapiResult,
                      cursor_description: DbapiDescription,
                      db_engine_spec: type[BaseEngineSpec],
              Severity: Minor
              Found in superset/result_set.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 VizTypeGallery has a Cognitive Complexity of 35 (exceeds 5 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('');

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

              const DatasetList: FunctionComponent<DatasetListProps> = ({
                addDangerToast,
                addSuccessToast,
                user,
              }) => {
              Severity: Minor
              Found in superset-frontend/src/pages/DatasetList/index.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 index.tsx has 384 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/SqlLab/components/SaveDatasetModal/index.tsx - About 5 hrs to fix

                File SqlEditor.test.tsx has 382 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/SqlLab/components/SqlEditor/SqlEditor.test.tsx - About 5 hrs to fix

                  Function CategoricalDeckGLContainer has 129 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const CategoricalDeckGLContainer = (props: CategoricalDeckGLContainerProps) => {
                    const containerRef = useRef<DeckGLContainerHandle>(null);
                  
                    const getAdjustedViewport = useCallback(() => {
                      let viewport = { ...props.viewport };

                    Function useListViewResource has 129 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

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

                        render() {
                          const {
                            refreshLimit = 0,
                            refreshWarning,
                            editMode,
                      Severity: Major
                      Found in superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx - About 5 hrs to fix

                        File api.py has 381 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/charts/data/api.py - About 5 hrs to fix

                          File NotificationMethod.test.tsx has 381 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 render has 128 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              render() {
                                const { datasource, activeTabKey } = this.state;
                                const { metrics } = datasource;
                                const sortedMetrics = metrics?.length ? this.sortMetrics(metrics) : [];
                                const { theme } = this.props;
                            Severity: Major
                            Found in superset-frontend/src/components/Datasource/DatasourceEditor.jsx - About 5 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language