airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function ImportModelsModal has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

const ImportModelsModal: FunctionComponent<ImportModelsModalProps> = ({
  resourceName,
  resourceLabel,
  passwordsNeededMessage,
  confirmOverwriteMessage,
Severity: Minor
Found in superset-frontend/src/components/ImportModal/index.tsx - About 2 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 UploadDataModal has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

const UploadDataModal: FunctionComponent<UploadDataModalProps> = ({
  addDangerToast,
  addSuccessToast,
  onHide,
  show,
Severity: Minor
Found in superset-frontend/src/features/databases/UploadDataModel/index.tsx - About 2 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 ExtraOptions has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

const ExtraOptions = ({
  db,
  onInputChange,
  onTextChange,
  onEditorChange,

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 transformProps.ts has 274 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 processRecord has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      processRecord(record) {
        // this code is called in a tight loop
        const colKey = [];
        const rowKey = [];
        this.props.cols.forEach(col => {

      Function getFilterConfigsFromFormdata has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function getFilterConfigsFromFormdata(form_data = {}) {
        const {
          date_filter,
          filter_configs = [],
          show_sqla_time_column,
      Severity: Major
      Found in superset-frontend/src/dashboard/util/getFilterConfigsFromFormdata.js - About 2 hrs to fix

        Function get_sqla_query has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def get_sqla_query(  # pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements
                self,
                apply_fetch_values_predicate: bool = False,
                columns: Optional[list[Column]] = None,
                extras: Optional[dict[str, Any]] = None,
        Severity: Major
        Found in superset/models/helpers.py - About 2 hrs to fix

          Function metadataBar has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const metadataBar = useMemo(() => {
              const items: ContentType[] = [];
              const dataset = datasetProps || result;
              if (dataset) {
                const {

            Function extractQueryFields has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function extractQueryFields(
              formData: FormDataResidual,
              aliases?: QueryFieldAliases,
            ): QueryFields {
              const queryFieldAliases: QueryFieldAliases = {

              Function handleError has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default async function handleError(error: ErrorInput): Promise<never> {
                // already a Superset error
                if (error instanceof SupersetApiError) {
                  throw error;
                }

                File models.py has 273 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/tags/models.py - About 2 hrs to fix

                  File index.tsx has 273 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 DrillDetailMenuItems.test.tsx has 272 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 reportsReducer has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function reportsReducer(state = {}, action) {
                        const actionHandlers = {
                          [SET_REPORT]() {
                            const { report, resourceId, creationMethod, filterField } = action;
                            // For now report count should only be one, but we are checking in case
                      Severity: Major
                      Found in superset-frontend/src/features/reports/ReportModal/reducer.js - About 2 hrs to fix

                        Function transformIntervalAnnotation has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function transformIntervalAnnotation(
                          layer: IntervalAnnotationLayer,
                          data: TimeseriesDataRecord[],
                          annotationData: AnnotationData,
                          colorScale: CategoricalColorScale,

                          Function contextmenu has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              contextmenu: (e: Event) => {
                                const handleNodeClick = (data: Data) => {
                                  const node = data.find(item => item.id === e.data.id);
                                  if (node?.name) {
                                    return [

                            Function create has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            ChartProps.createSelector = function create(): ChartPropsSelector {
                              return createSelector(
                                (input: ChartPropsConfig) => input.annotationData,
                                input => input.datasource,
                                input => input.formData,

                              File index.js has 271 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/exploreUtils/index.js - About 2 hrs to fix

                                File CustomFrame.tsx has 271 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

                                  ParsedQuery has 23 functions (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  class ParsedQuery:
                                      def __init__(
                                          self,
                                          sql_statement: str,
                                          strip_comments: bool = False,
                                  Severity: Minor
                                  Found in superset/sql_parse.py - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language