airbnb/superset

View on GitHub

Showing 5,879 of 5,879 total issues

Function DashboardList has 660 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function DashboardList(props: DashboardListProps) {
  const { addDangerToast, addSuccessToast, user } = props;

  const { roles } = useSelector<any, UserWithPermissionsAndRoles>(
    state => state.user,
Severity: Major
Found in superset-frontend/src/pages/DashboardList/index.tsx - About 3 days to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    test('CSV, form post', async () => {
      render(<UploadDataModal {...csvProps} />, {
        useRedux: true,
      });
    
    
    superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx on lines 488..547

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 559.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    test('Excel, form post', async () => {
      render(<UploadDataModal {...excelProps} />, {
        useRedux: true,
      });
    
    
    superset-frontend/src/features/databases/UploadDataModel/UploadDataModal.test.tsx on lines 431..486

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 559.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    File supported_charts_dashboard.py has 1232 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: Major
    Found in superset/examples/supported_charts_dashboard.py - About 3 days to fix

      File sql_parse.py has 1208 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: Major
      Found in superset/sql_parse.py - About 3 days to fix

        File sqlLab.js has 1194 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: Major
        Found in superset-frontend/src/SqlLab/actions/sqlLab.js - About 3 days to fix

          File FiltersConfigForm.tsx has 1184 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 presto.py has 1132 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: Major
            Found in superset/db_engine_specs/presto.py - About 2 days to fix

              File data.ts has 1127 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 schemas.py has 1095 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: Major
                Found in superset/databases/schemas.py - About 2 days to fix

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

                  export default function transformProps(
                    chartProps: EchartsMixedTimeseriesProps,
                  ): EchartsMixedTimeseriesChartTransformedProps {
                    const {
                      width,

                    Function Select has a Cognitive Complexity of 136 (exceeds 5 allowed). Consider refactoring.
                    Open

                      (
                        {
                          allowClear,
                          allowNewOptions = false,
                          allowSelectAll = true,
                    Severity: Minor
                    Found in superset-frontend/src/components/Select/Select.tsx - About 2 days 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 convert_filter_scopes_to_native_filters has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def convert_filter_scopes_to_native_filters(  # pylint: disable=invalid-name,too-many-branches,too-many-locals,too-many-nested-blocks,too-many-statements
                        json_metadata: dict[str, Any],
                        position_json: dict[str, Any],
                        filter_boxes: list[Slice],
                    ) -> list[dict[str, Any]]:
                    Severity: Minor
                    Found in superset/migrations/shared/native_filters.py - About 2 days 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 api.py has 1052 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: Major
                    Found in superset/charts/api.py - About 2 days to fix

                      Function Rose has 519 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function Rose(element, props) {
                        const {
                          data,
                          width,
                          height,
                      Severity: Major
                      Found in superset-frontend/plugins/legacy-plugin-chart-rose/src/Rose.js - About 2 days to fix

                        File NVD3Vis.js has 1018 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /* eslint-disable react/sort-prop-types */
                        /**
                         * 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: Major
                        Found in superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js - About 2 days to fix

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              it('should bulk delete correctly', () => {
                                interceptBulkDelete();
                                toggleBulkSelect();
                          
                                // bulk deletes in card-view
                          superset-frontend/cypress-base/cypress/e2e/dashboard_list/list.test.ts on lines 159..194

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 441.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              it('should bulk delete correctly', () => {
                                interceptBulkDelete();
                                toggleBulkSelect();
                          
                                // bulk deletes in card-view
                          superset-frontend/cypress-base/cypress/e2e/chart_list/list.test.ts on lines 220..251

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 441.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Function AlertReportModal has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
                            addDangerToast,
                            onAdd,
                            onHide,
                            show,
                          Severity: Minor
                          Found in superset-frontend/src/features/alerts/AlertReportModal.tsx - About 2 days 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 TableChart has a Cognitive Complexity of 124 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export default function TableChart<D extends DataRecord = DataRecord>(
                            props: TableChartTransformedProps<D> & {
                              sticky?: DataTableProps<D>['sticky'];
                            },
                          ) {
                          Severity: Minor
                          Found in superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx - About 2 days 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

                          Severity
                          Category
                          Status
                          Source
                          Language