airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function AnnotationModal has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

const AnnotationModal: FunctionComponent<AnnotationModalProps> = ({
  addDangerToast,
  addSuccessToast,
  annotationLayerId,
  annotation = null,
Severity: Minor
Found in superset-frontend/src/features/annotations/AnnotationModal.tsx - About 7 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 getTimeOffset has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

export const getTimeOffset = ({
  timeRangeFilter,
  shifts,
  startDate,
  includeFutureOffsets = true,

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 NVD3Controls.tsx has 489 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 drawVis has 193 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function drawVis(i, dat) {
        const datum = dat[i];
        const w = width;
        const h = height / data.length;
        const x = d3.scale.linear().range([0, w]);

      File 2018-07-22_11-59_bebcf3fed1fe_convert_dashboard_v1_positions.py has 483 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

        Function dashboardStateReducer has 188 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function dashboardStateReducer(state = {}, action) {
          const actionHandlers = {
            [HYDRATE_DASHBOARD]() {
              return { ...state, ...action.data.dashboardState };
            },
        Severity: Major
        Found in superset-frontend/src/dashboard/reducers/dashboardState.js - About 7 hrs to fix

          File index.tsx has 479 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 transformProps has 187 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function transformProps(
              chartProps: EchartsTreemapChartProps,
            ): TreemapTransformedProps {
              const {
                formData,

              Function buildQuery has 186 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const buildQuery: BuildQuery<TableChartFormData> = (
                formData: TableChartFormData,
                options,
              ) => {
                const {
              Severity: Major
              Found in superset-frontend/plugins/plugin-chart-table/src/buildQuery.ts - About 7 hrs to fix

                Function ControlPanelsContainer has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                Open

                export const ControlPanelsContainer = (props: ControlPanelsContainerProps) => {
                  const { colors } = useTheme();
                  const pluginContext = useContext(PluginContext);
                
                  const prevState = usePrevious(props.exploreState);
                Severity: Minor
                Found in superset-frontend/src/explore/components/ControlPanelsContainer.tsx - About 7 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 DatabaseSelector has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                Open

                export default function DatabaseSelector({
                  db,
                  formMode = false,
                  emptyState,
                  getDbList,
                Severity: Minor
                Found in superset-frontend/src/components/DatabaseSelector/index.tsx - About 7 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 PropertiesModal has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                Open

                const PropertiesModal = ({
                  addSuccessToast,
                  addDangerToast,
                  colorScheme: currentColorScheme,
                  dashboardId,
                Severity: Minor
                Found in superset-frontend/src/dashboard/components/PropertiesModal/index.tsx - About 7 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 AdhocFilterEditPopoverSimpleTabContent.test.tsx has 475 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 drilltodetail.test.ts has 475 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.jsx has 474 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

                      actionHandlers has 52 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                        const actionHandlers = {
                          [actions.ADD_QUERY_EDITOR]() {
                            const mergeUnsavedState = alterInArr(
                              state,
                              'queryEditors',
                      Severity: Major
                      Found in superset-frontend/src/SqlLab/reducers/sqlLab.js - About 7 hrs to fix

                        File base.py has 472 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/views/base.py - About 7 hrs to fix

                          File databricks.py has 471 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/databricks.py - About 7 hrs to fix

                            File webpack.config.js has 468 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /* eslint-disable no-console */
                            /**
                             * 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
                            Severity: Minor
                            Found in superset-frontend/webpack.config.js - About 7 hrs to fix

                              Function CountryMap has 180 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function CountryMap(element, props) {
                                const {
                                  data,
                                  width,
                                  height,
                                Severity
                                Category
                                Status
                                Source
                                Language