airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

File RowLevelSecurityModal.tsx has 423 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/rls/RowLevelSecurityModal.tsx - About 6 hrs to fix

    Function Heatmap has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

    function Heatmap(element, props) {
      const {
        data,
        width,
        height,
    Severity: Minor
    Found in superset-frontend/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js - About 6 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 postprocess_datasets has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

    def postprocess_datasets(session: Session) -> None:
        """
        Postprocess datasets after insertion to
          - Quote table names for physical datasets (if needed)
          - Link referenced tables to virtual datasets

    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 dashboardLayout.test.js has 420 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/reducers/dashboardLayout.test.js - About 6 hrs to fix

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

        render() {
          const {
            component: columnComponent,
            parentComponent,
            index,
      Severity: Major
      Found in superset-frontend/src/dashboard/components/gridComponents/Column.jsx - About 6 hrs to fix

        File countries.ts has 420 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 419 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/ExploreChartPanel/index.jsx - About 6 hrs to fix

            File api.py has 419 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/sqllab/api.py - About 6 hrs to fix

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

              export default function transformProps(chartProps) {
                const {
                  width,
                  height,
                  annotationData,

                Function renderSliceConfiguration has 150 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  renderSliceConfiguration() {
                    const {
                      annotationType,
                      sourceType,
                      value,

                  Consider simplifying this complex logical expression.
                  Open

                              if not (
                                  self.can_access_schema(datasource)
                                  or self.can_access("datasource_access", datasource.perm or "")
                                  or self.is_owner(datasource)
                                  or (
                  Severity: Critical
                  Found in superset/security/manager.py - About 6 hrs to fix

                    File utils.py has 416 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/utils.py - About 6 hrs to fix

                      Function memoizedRows has 149 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const memoizedRows = useMemo(() => {
                          const renderSparklineCell = (valueField, column, entries) => {
                            let sparkData;
                            if (column.timeRatio) {
                              // Period ratio sparkline
                      Severity: Major
                      Found in superset-frontend/src/visualizations/TimeTable/TimeTable.jsx - About 5 hrs to fix

                        File DndFilterSelect.tsx has 415 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 work for additional information
                         * regarding copyright ownership.  The ASF licenses file

                          File transformProps.ts has 414 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 onSave has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              const onSave = async () => {
                                let dbConfigExtraExtensionOnSaveError;
                            
                                setLoading(true);
                            
                            
                            Severity: Major
                            Found in superset-frontend/src/features/databases/DatabaseModal/index.tsx - About 5 hrs to fix

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

                              export default function transformProps(
                                chartProps: HistogramChartProps,
                              ): HistogramTransformedProps {
                                const refs: Refs = {};
                                let focusedSeries: number | undefined;

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

                                export default function transformProps(chartProps: EchartsBubbleChartProps) {
                                  const { height, width, hooks, queriesData, formData, inContextMenu, theme } =
                                    chartProps;
                                
                                  const { data = [] } = queriesData[0];

                                  BaseDatasource has 43 functions (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  class BaseDatasource(AuditMixinNullable, ImportExportMixin):  # pylint: disable=too-many-public-methods
                                      """A common interface to objects that are queryable
                                      (tables and datasources)"""
                                  
                                      # ---------------------------------------------------------------
                                  Severity: Minor
                                  Found in superset/connectors/sqla/models.py - About 5 hrs to fix

                                    File getFilterScopeFromNodesTree.test.js has 407 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