airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function componentDidMount has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

  componentDidMount() {
    // merge post form data with GET search params
    // Hack: this data should be coming from getInitialState
    // but for some reason this data isn't being passed properly through
    // the reducer.
Severity: Minor
Found in superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx - About 3 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 ReportModal has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

function ReportModal({
  onHide,
  show = false,
  dashboardId,
  chart,
Severity: Minor
Found in superset-frontend/src/features/reports/ReportModal/index.tsx - About 3 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 UsageTab.test.tsx has 309 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 309 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/AnnotationLayerList/index.tsx - About 3 hrs to fix

      Function actions.SET_FIELD_VALUE has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          [actions.SET_FIELD_VALUE]() {
            const { controlName, value, validationErrors } = action;
            let new_form_data = { ...state.form_data, [controlName]: value };
            const old_metrics_data = state.form_data.metrics;
            const new_column_config = state.form_data.column_config;
      Severity: Major
      Found in superset-frontend/src/explore/reducers/exploreReducer.js - About 3 hrs to fix

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

          render() {
            const {
              children,
              adjustableWidth,
              adjustableHeight,

          File controlPanel.tsx has 307 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 controlPanel.ts has 307 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 controlPanel.tsx has 307 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 controlPanel.tsx has 306 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 TagModal.tsx has 306 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/tags/TagModal.tsx - About 3 hrs to fix

                    Consider simplifying this complex logical expression.
                    Open

                        if (resultsReady) {
                          if (!isEqual(this.state, nextState)) {
                            return true;
                          }
                          this.hasQueryResponseChange =
                    Severity: Critical
                    Found in superset-frontend/src/components/Chart/ChartRenderer.jsx - About 3 hrs to fix

                      Slice has 28 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Slice(  # pylint: disable=too-many-public-methods
                          Model, AuditMixinNullable, ImportExportMixin
                      ):
                          """A slice is essentially a report or a view on data"""
                      
                      
                      Severity: Minor
                      Found in superset/models/slice.py - About 3 hrs to fix

                        Function getDropPosition has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function getDropPosition(monitor, Component) {
                          const {
                            depth: componentDepth,
                            parentComponent,
                            component,
                        Severity: Major
                        Found in superset-frontend/src/dashboard/util/getDropPosition.js - About 3 hrs to fix

                          File ChartRenderer.jsx has 305 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/ChartRenderer.jsx - About 3 hrs to fix

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

                              render() {
                                const { isFocused } = this.state;
                            
                                const {
                                  dashboardId,
                            Severity: Major
                            Found in superset-frontend/src/dashboard/components/gridComponents/Header.jsx - About 3 hrs to fix

                              Function processColumns has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const processColumns = memoizeOne(function processColumns(
                                props: TableChartProps,
                              ) {
                                const {
                                  datasource: { columnFormats, currencyFormats, verboseMap },
                              Severity: Major
                              Found in superset-frontend/plugins/plugin-chart-table/src/transformProps.ts - About 3 hrs to fix

                                File SavedQueries.tsx has 305 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/home/SavedQueries.tsx - About 3 hrs to fix

                                  File docusaurus.config.js has 304 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 docs/docusaurus.config.js - About 3 hrs to fix

                                    File ContourPopoverControl.tsx has 304 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
                                      Category
                                      Status
                                      Source
                                      Language