airbnb/superset

View on GitHub

Showing 5,879 of 5,879 total issues

Function ExploreViewContainer has 418 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ExploreViewContainer(props) {
  const dynamicPluginContext = usePluginContext();
  const dynamicPlugin = dynamicPluginContext.dynamicPlugins[props.vizType];
  const isDynamicPluginLoading = dynamicPlugin && dynamicPlugin.mounting;
  const wasDynamicPluginLoading = usePrevious(isDynamicPluginLoading);

    Function PivotTableChart has 406 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function PivotTableChart(props: PivotTableProps) {
      const {
        data,
        height,
        width,

      File index.tsx has 836 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/components/SqlEditor/index.tsx - About 2 days to fix

        File index.tsx has 829 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/pages/DatasetList/index.tsx - About 1 day to fix

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

          test('Renders only an overflow tag if dropdown is open in oneLine mode', async () => {
            render(
              <AsyncSelect
                {...defaultProps}
                value={[OPTIONS[0], OPTIONS[1], OPTIONS[2]]}
          Severity: Major
          Found in superset-frontend/src/components/Select/AsyncSelect.test.tsx and 1 other location - About 1 day to fix
          superset-frontend/src/components/Select/Select.test.tsx on lines 786..817

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

          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('Renders only an overflow tag if dropdown is open in oneLine mode', async () => {
            render(
              <Select
                {...defaultProps}
                value={[OPTIONS[0], OPTIONS[1], OPTIONS[2]]}
          Severity: Major
          Found in superset-frontend/src/components/Select/Select.test.tsx and 1 other location - About 1 day to fix
          superset-frontend/src/components/Select/AsyncSelect.test.tsx on lines 793..824

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

          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 821 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/pages/ChartList/index.tsx - About 1 day to fix

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

                {
                  group: ['James'],
                  values: [
                    {
                      x: -157766400000.0,
            superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-paired-t-test/data.ts on lines 136..248

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

            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

                {
                  group: ['David'],
                  values: [
                    {
                      x: -157766400000.0,
            superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-paired-t-test/data.ts on lines 249..361

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

            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 AsyncSelect has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
            Open

              (
                {
                  allowClear,
                  allowNewOptions = false,
                  ariaLabel,
            Severity: Minor
            Found in superset-frontend/src/components/Select/AsyncSelect.tsx - About 1 day 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 TableRenderers.jsx has 813 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 SliceHeaderControls has 379 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const SliceHeaderControls = (props: SliceHeaderControlsPropsWithRouter) => {
                const [dropdownIsOpen, setDropdownIsOpen] = useState(false);
                const [tableModalIsOpen, setTableModalIsOpen] = useState(false);
                const [drillModalIsOpen, setDrillModalIsOpen] = useState(false);
                const [selectedKeys, setSelectedKeys] = useState<string[]>([]);

                File utilities.js has 798 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.tsx has 792 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 791 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/views/core.py - About 1 day to fix

                      File birth_names.py has 788 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/birth_names.py - About 1 day to fix

                        Function PivotTableChart has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export default function PivotTableChart(props: PivotTableProps) {
                          const {
                            data,
                            height,
                            width,

                        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 hooks.ts has 781 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/views/CRUD/hooks.ts - About 1 day to fix

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

                            it('sorts integers correctly', () => {
                              const integerProps = {
                                orderedColumnKeys: ['columnB'],
                                data: [{ columnB: 21 }, { columnB: 0 }, { columnB: 623 }],
                                height: 500,
                          superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx on lines 156..197

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

                          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('sorts floating numbers correctly', () => {
                              const floatProps = {
                                orderedColumnKeys: ['columnC'],
                                data: [{ columnC: 45.67 }, { columnC: 1.23 }, { columnC: 89.0000001 }],
                                height: 500,
                          superset-frontend/src/components/FilterableTable/FilterableTable.test.tsx on lines 121..154

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

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language