airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

File chartActions.test.js has 346 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/Chart/chartActions.test.js - About 4 hrs to fix

    File Markdown.jsx has 346 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 snowflake.py has 346 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/snowflake.py - About 4 hrs to fix

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

          render() {
            const { isNew, name, annotationType, sourceType, show, showLabel } =
              this.state;
            const isValid = this.isValidForm();
            const metadata = getChartMetadataRegistry().get(this.props.vizType);

          File log.py has 344 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/utils/log.py - About 4 hrs to fix

            Function renderTableRow has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

              renderTableRow(rowKey, rowIdx, pivotSettings) {
                // Render a single row in 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 migrate_dashboard has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

            def migrate_dashboard(dashboard: Dashboard) -> None:
                """
                Convert the dashboard to use native filters.
            
                :param dashboard: The dashboard to convert
            Severity: Minor
            Found in superset/migrations/shared/native_filters.py - About 4 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 transformProps has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

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

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

            const TableSelector: FunctionComponent<TableSelectorProps> = ({
              database,
              emptyState,
              formMode = false,
              getDbList,
            Severity: Minor
            Found in superset-frontend/src/components/TableSelector/index.tsx - About 4 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 exploreJSON has 106 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function exploreJSON(
              formData,
              force = false,
              timeout,
              key,
            Severity: Major
            Found in superset-frontend/src/components/Chart/chartAction.js - About 4 hrs to fix

              File DndMetricSelect.tsx has 343 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 work for additional information
               * regarding copyright ownership.  The ASF licenses file

                File Chart.tsx has 342 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/Chart/Chart.tsx - About 4 hrs to fix

                  File index.tsx has 342 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/features/reports/ReportModal/index.tsx - About 4 hrs to fix

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

                      render() {
                        const { chartAlert, chartStatus, chartId, emitCrossFilters } = this.props;
                    
                        // Skip chart rendering
                        if (chartStatus === 'loading' || !!chartAlert || chartStatus === null) {
                    Severity: Major
                    Found in superset-frontend/src/components/Chart/ChartRenderer.jsx - About 4 hrs to fix

                      File index.jsx has 341 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 importexport.py has 341 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/cli/importexport.py - About 4 hrs to fix

                          Function createAxisControl has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
                            const isXAxis = axis === 'x';
                            const isVertical = (controls: ControlStateMapping) =>
                              Boolean(controls?.orientation.value === OrientationType.Vertical);
                            const isHorizontal = (controls: ControlStateMapping) =>

                            Function prepareDashboardFilters has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function prepareDashboardFilters(
                              filters: { name: string; column: string; datasetId: number }[],
                            ) {
                              cy.createSampleDashboards([0]);
                              cy.request({

                              File webdriver.py has 338 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/utils/webdriver.py - About 4 hrs to fix

                                File Modal.tsx has 338 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/Modal/Modal.tsx - About 4 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language