airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

CRUDCollection has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

export default class CRUDCollection extends PureComponent<
  CRUDCollectionProps,
  CRUDCollectionState
> {
  constructor(props: CRUDCollectionProps) {
Severity: Minor
Found in superset-frontend/src/components/Datasource/CollectionTable.tsx - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

        if (
          importLoading ||
          (alreadyExists.length && !confirmedOverwrite) ||
          (passwordsNeeded.length && JSON.stringify(passwords) === '{}') ||
          (sshPasswordNeeded.length &&
    Severity: Critical
    Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 2 hrs to fix

      Function transformEventAnnotation has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function transformEventAnnotation(
        layer: EventAnnotationLayer,
        data: TimeseriesDataRecord[],
        annotationData: AnnotationData,
        colorScale: CategoricalColorScale,

        Function renderDropdown has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const renderDropdown = () => {
            const qe = queryEditor;
            const successful = latestQuery?.state === 'success';
            const scheduleToolTip = successful
              ? t('Schedule the query periodically')
        Severity: Major
        Found in superset-frontend/src/SqlLab/components/SqlEditor/index.tsx - About 2 hrs to fix

          Function renderComponent has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              const renderComponent = (id: string) => {
                const isRemoved = !!removedFilters[id];
                const isErrored = erroredFilters.includes(id);
                const isActive = currentFilterId === id;
                const classNames = [];

            File SaveModal.test.jsx has 263 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/SaveModal.test.jsx - About 2 hrs to fix

              File exploreReducer.js has 263 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/reducers/exploreReducer.js - About 2 hrs to fix

                File api.py has 263 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/explore/form_data/api.py - About 2 hrs to fix

                  File schemas.py has 263 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/datasets/schemas.py - About 2 hrs to fix

                    File LeftPanel.test.tsx has 263 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 switchboard.test.ts has 263 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 2020-10-05_18-10_af30ca79208f_collapse_alerting_models_into_a_single_.py has 262 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

                          File controlPanel.tsx has 262 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 renderValueConfiguration has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              renderValueConfiguration() {
                                const { annotationType, sourceType, value } = this.state;
                                let label = '';
                                let description = '';
                                if (requiresQuery(sourceType)) {

                              Function renderTab has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                renderTab() {
                                  const {
                                    component,
                                    parentComponent,
                                    index,
                              Severity: Major
                              Found in superset-frontend/src/dashboard/components/gridComponents/Tab.jsx - About 2 hrs to fix

                                Function TimeFilterPlugin has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function TimeFilterPlugin(props: PluginFilterTimeProps) {
                                  const {
                                    setDataMask,
                                    setHoveredFilter,
                                    unsetHoveredFilter,
                                Severity: Major
                                Found in superset-frontend/src/filters/components/Time/TimeFilterPlugin.tsx - About 2 hrs to fix

                                  Function generateMockPayload has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const generateMockPayload = (dashboard = true) => {
                                    const mockPayload = {
                                      active: false,
                                      context_markdown: 'string',
                                      creation_method: 'alerts_reports',
                                  Severity: Major
                                  Found in superset-frontend/src/features/alerts/AlertReportModal.test.tsx - About 2 hrs to fix

                                    File SqlEditorLeftBar.test.tsx has 261 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 upgrade has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      def upgrade():
                                          bind = op.get_bind()
                                          session = db.Session(bind=bind)
                                      
                                          for slc in session.query(Slice).filter(Slice.viz_type == "table"):

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

                                      def upgrade():
                                          bind = op.get_bind()
                                          session = db.Session(bind=bind)
                                      
                                          dash_to_migrate = defaultdict(list)

                                      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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language