airbnb/superset

View on GitHub

Showing 2,409 of 6,079 total issues

File Rose.js has 570 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/plugins/legacy-plugin-chart-rose/src/Rose.js - About 1 day to fix

    Function redraw has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
    Open

      redraw({ width, height, ctx, isDragging, project }) {
        const {
          aggregation,
          compositeOperation,
          dotRadius,

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

    export default function EchartsMixedTimeseries({
      height,
      width,
      echartOptions,
      setDataMask,

    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 Icicle has 236 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Icicle(element, props) {
      const {
        width,
        height,
        data,

      File saveModalActions.test.ts has 560 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/explore/actions/saveModalActions.test.ts - About 1 day to fix

        Function upgrade has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
        Open

        def upgrade():
            bind = op.get_bind()
            session = db.Session(bind=bind)
        
            dashboards = session.query(Dashboard).all()

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

        export default function transformProps(
          chartProps: EchartsTimeseriesChartProps,
        ): TimeseriesChartTransformedProps {
          const {
            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 __init__.py has 558 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/initialization/__init__.py - About 1 day to fix

          File AsyncSelect.tsx has 554 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.tsx - About 1 day to fix

            Function saveDashboardRequest has 232 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function saveDashboardRequest(data, id, saveType) {
              return (dispatch, getState) => {
                dispatch({ type: UPDATE_COMPONENTS_PARENTS_LIST });
                dispatch(saveDashboardStarted());
            
            
            Severity: Major
            Found in superset-frontend/src/dashboard/actions/dashboardState.js - About 1 day to fix

              File transformers.ts has 549 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 sqlLabReducer has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
                Open

                export default function sqlLabReducer(state = {}, action) {
                  const actionHandlers = {
                    [actions.ADD_QUERY_EDITOR]() {
                      const mergeUnsavedState = alterInArr(
                        state,
                Severity: Minor
                Found in superset-frontend/src/SqlLab/reducers/sqlLab.js - 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 api.py has 545 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/reports/api.py - About 1 day to fix

                  Function PluginFilterSelect has 227 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function PluginFilterSelect(props: PluginFilterSelectProps) {
                    const {
                      coltypeMap,
                      data,
                      filterState,

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

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

                        render() {
                          const {
                            adhocMetric: propsAdhocMetric,
                            savedMetric: propsSavedMetric,
                            columns,

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

                        export default function transformProps(
                          chartProps: EchartsSunburstChartProps,
                        ): SunburstTransformedProps {
                          const {
                            formData,

                          Function CustomFrame has 225 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function CustomFrame(props: FrameComponentProps) {
                            const { customRange, matchedFlag } = customTimeRangeDecode(props.value);
                            const [datePickerLocale, setDatePickerLocale] = useState<
                              PickerLocale | undefined | null
                            >(null);

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

                              render() {
                                const {
                                  showChangeDatasourceModal,
                                  showEditDatasourceModal,
                                  showSaveDatasetModal,

                              Function upgrade has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def upgrade():
                                  bind = op.get_bind()
                                  session = db.Session(bind=bind)
                              
                                  for slc in session.query(Slice).all():

                              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