airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function computeArcStates has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function computeArcStates(adatum) {
    // Find the max sum of values across all time
    let maxSum = 0;
    let grain = 0;
    const sums = [];
Severity: Major
Found in superset-frontend/plugins/legacy-plugin-chart-rose/src/Rose.js - About 4 hrs to fix

    Function renderPasswordFields has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const renderPasswordFields = () => {
        if (
          passwordFields.length === 0 &&
          sshTunnelPasswordFields.length === 0 &&
          sshTunnelPrivateKeyFields.length === 0 &&
    Severity: Major
    Found in superset-frontend/src/components/ImportModal/index.tsx - About 4 hrs to fix

      File selectors.ts has 353 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/nativeFilters/selectors.ts - About 4 hrs to fix

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

        export default function transformProps(chartProps: ChartProps) {
          /**
           * This function is called after a successful response has been
           * received from the chart data endpoint, and is used to transform
           * the incoming data prior to being sent to the Visualization.

          Function EditorAutoSync has 111 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const EditorAutoSync: FC = () => {
            const queryEditors = useSelector<SqlLabRootState, QueryEditor[]>(
              state => state.sqlLab.queryEditors,
            );
            const unsavedQueryEditor = useSelector<SqlLabRootState, UnsavedQueryEditor>(
          Severity: Major
          Found in superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx - About 4 hrs to fix

            Function onConfirmSave has 111 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const onConfirmSave = () => {
                // Pull out extra fields into the extra object
                const schema =
                  currentDatasource.tableSelector?.schema ||
                  currentDatasource.databaseSelector?.schema ||
            Severity: Major
            Found in superset-frontend/src/components/Datasource/DatasourceModal.tsx - About 4 hrs to fix

              File Shared_DeckGL.jsx has 351 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.ts has 351 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-websocket/src/index.ts - About 4 hrs to fix

                  Function validate_ssh_tunnel_credentials has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def validate_ssh_tunnel_credentials(
                          self, data: dict[str, Any], **kwargs: Any
                      ) -> None:
                          """If ssh_tunnel has a masked credentials, credentials are required"""
                          uuid = data["uuid"]
                  Severity: Minor
                  Found in superset/databases/schemas.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 import_dataset has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def import_dataset(
                      config: dict[str, Any],
                      overwrite: bool = False,
                      force_data: bool = False,
                      ignore_permissions: bool = False,
                  Severity: Minor
                  Found in superset/commands/dataset/importers/v1/utils.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 EchartsTreemap has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function EchartsTreemap({
                    echartOptions,
                    emitCrossFilters,
                    groupby,
                    height,

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

                  export const customTimeRangeDecode = (
                    timeRange: string,
                  ): CustomRangeDecodeType => {
                    const splitDateRange = timeRange.split(SEPARATOR);
                  
                  

                  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 350 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/explore/components/DatasourcePanel/index.tsx - About 4 hrs to fix

                    Function renderEditorBottomBar has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const renderEditorBottomBar = (hideActions: boolean) => {
                        const { allow_ctas: allowCTAS, allow_cvas: allowCVAS } = database || {};
                    
                        const showMenu = allowCTAS || allowCVAS;
                        const runMenuBtn = (
                    Severity: Major
                    Found in superset-frontend/src/SqlLab/components/SqlEditor/index.tsx - About 4 hrs to fix

                      Function renderRowsReturned has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const renderRowsReturned = (alertMessage: boolean) => {
                          const { results, rows, queryLimit, limitingFactor } = query;
                          let limitMessage = '';
                          const limitReached = results?.displayLimitReached;
                          const limit = queryLimit || results.query.limit;
                      Severity: Major
                      Found in superset-frontend/src/SqlLab/components/ResultSet/index.tsx - About 4 hrs to fix

                        Function renderTabContent has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          renderTabContent() {
                            const {
                              component: tabComponent,
                              depth,
                              availableColumnCount,
                        Severity: Major
                        Found in superset-frontend/src/dashboard/components/gridComponents/Tab.jsx - About 4 hrs to fix

                          Function DeckGLPolygon has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const DeckGLPolygon = (props: DeckGLPolygonProps) => {
                            const containerRef = useRef<DeckGLContainerHandle>();
                          
                            const getAdjustedViewport = useCallback(() => {
                              let viewport = { ...props.viewport };

                            File index.tsx has 348 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/RowLevelSecurityList/index.tsx - About 4 hrs to fix

                              File ChartHolder.test.tsx has 347 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 _forEach has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      locations.forEach(function _forEach(location, i) {
                                        const pixel = project(lngLatAccessor(location));
                                        const pixelRounded = [
                                          roundDecimal(pixel[0], 1),
                                          roundDecimal(pixel[1], 1),
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language