airbnb/superset

View on GitHub

Showing 5,879 of 5,879 total issues

File api.py has 1000 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

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

    test('updateSlice with add to existing dashboard handles success', async () => {
      fetchMock.reset();
      fetchMock.put(updateSliceEndpoint, sliceResponsePayload);
      const dispatch = sinon.spy();
      const getState = sinon.spy(() => mockExploreState);
    Severity: Major
    Found in superset-frontend/src/explore/actions/saveModalActions.test.js and 1 other location - About 2 days to fix
    superset-frontend/src/explore/actions/saveModalActions.test.js on lines 181..206

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

    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('updateSlice with add to new dashboard handles success', async () => {
      fetchMock.reset();
      fetchMock.put(updateSliceEndpoint, sliceResponsePayload);
      const dispatch = sinon.spy();
      const getState = sinon.spy(() => mockExploreState);
    Severity: Major
    Found in superset-frontend/src/explore/actions/saveModalActions.test.js and 1 other location - About 2 days to fix
    superset-frontend/src/explore/actions/saveModalActions.test.js on lines 208..233

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

    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 43..67

    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: 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 35..59

    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

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

    export default function transformProps(
      chartProps: EchartsTimeseriesChartProps,
    ): TimeseriesChartTransformedProps {
      const {
        width,

      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

        Function ControlPanelsContainer has 478 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

          File index.tsx has 960 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

            File Select.test.tsx has 943 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 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 core.py has 908 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 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

                      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

                        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

                          File AsyncSelect.test.tsx has 875 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/AsyncSelect.test.tsx - About 2 days to fix

                            File sqlLab.test.js has 868 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
                              Severity
                              Category
                              Status
                              Source
                              Language