airbnb/caravel

View on GitHub

Showing 5,976 of 5,976 total issues

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

        op.create_table(
            "sl_tables",
            sa.Column("uuid", sa.Numeric(precision=16), nullable=True),
            sa.Column("created_on", sa.DateTime(), nullable=True),
            sa.Column("changed_on", sa.DateTime(), nullable=True),
    superset/migrations/versions/2024-05-24_11-31_02f4f7811799_remove_sl__tables.py on lines 44..72

    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 271.

    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

        op.create_table(
            "sl_datasets",
            sa.Column("uuid", sa.Numeric(precision=16), nullable=True),
            sa.Column("created_on", sa.DateTime(), nullable=True),
            sa.Column("changed_on", sa.DateTime(), nullable=True),
    superset/migrations/versions/2024-05-24_11-31_02f4f7811799_remove_sl__tables.py on lines 74..102

    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 271.

    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

    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

    File api.py has 1006 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/datasets/api.py - About 2 days to fix

      Function ControlPanelsContainer has 503 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const ControlPanelsContainer = (props: ControlPanelsContainerProps) => {
        const { colors } = useTheme();
        const pluginContext = useContext(PluginContext);
      
        const prevState = usePrevious(props.exploreState);
      Severity: Major
      Found in superset-frontend/src/explore/components/ControlPanelsContainer.tsx - About 2 days to fix

        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

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

        const OPTIONS: Option[] = [
          { label: 'John', value: 1, gender: 'Male' },
          { label: 'Liam', value: 2, gender: 'Male' },
          { label: 'Olivia', value: 3, gender: 'Female' },
          { label: 'Emma', value: 4, gender: 'Female' },
        Severity: Major
        Found in superset-frontend/src/components/Select/Select.test.tsx and 1 other location - About 2 days to fix
        superset-frontend/src/components/Select/AsyncSelect.test.tsx on lines 34..58

        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 423.

        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

        const OPTIONS = [
          { label: 'John', value: 1, gender: 'Male' },
          { label: 'Liam', value: 2, gender: 'Male' },
          { label: 'Olivia', value: 3, gender: 'Female' },
          { label: 'Emma', value: 4, gender: 'Female' },
        Severity: Major
        Found in superset-frontend/src/components/Select/AsyncSelect.test.tsx and 1 other location - About 2 days to fix
        superset-frontend/src/components/Select/Select.test.tsx on lines 42..66

        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 423.

        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 index.tsx has 972 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/features/databases/UploadDataModel/index.tsx - About 2 days to fix

          Function TableChart has 481 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            File core.py has 942 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/models/core.py - About 2 days to fix

              File Select.test.tsx has 942 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/components/Select/Select.test.tsx - About 2 days to fix

                File sqlLab.test.js has 930 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.test.js - About 2 days to fix

                  File data.ts has 930 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

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

                    def downgrade():
                        bind = op.get_bind()
                        insp = sa.engine.reflection.Inspector.from_engine(bind)
                    
                        # First, drop the foreign key constraint prior to altering columns.
                    superset/migrations/versions/2019-10-02_00-29_b6fa807eac07_make_names_non_nullable.py on lines 40..80

                    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 242.

                    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

                    def upgrade():
                        bind = op.get_bind()
                        insp = sa.engine.reflection.Inspector.from_engine(bind)
                    
                        # First, drop the foreign key constraint prior to altering columns.
                    superset/migrations/versions/2019-10-02_00-29_b6fa807eac07_make_names_non_nullable.py on lines 84..123

                    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 242.

                    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 AnnotationLayer.jsx has 911 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 data.ts has 907 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