airbnb/caravel

View on GitHub

Showing 2,441 of 6,157 total issues

Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(  # pylint: disable=too-many-arguments
Severity: Major
Found in superset/exceptions.py - About 50 mins to fix

    Function formatTooltip has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      params: any,
      xAxisLabel: string,
      yAxisLabel: string,
      sizeLabel: string,
      xAxisFormatter: NumberFormatter,

      Avoid deeply nested control flow statements.
      Open

                    if (pointRadiusUnit === 'Kilometers') {
                      pointLabel = `${roundDecimal(pointRadius, 2)}km`;
                      pointRadius = kmToPixels(pointRadius, pointLatitude, zoom);
                    } else if (pointRadiusUnit === 'Miles') {
                      pointLabel = `${roundDecimal(pointRadius, 2)}mi`;

        Function displayHeaderCell has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          needToggle,
          ArrowIcon,
          onArrowClick,
          value,
          namesMapping,

          Avoid deeply nested control flow statements.
          Open

                      if (value >= 0) {
                        continue;
                      }
          Severity: Major
          Found in superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonRow.jsx - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                          if (n.children[j].weight / n.sum < partitionThreshold) {
                            break;
                          }
            Severity: Major
            Found in superset-frontend/plugins/legacy-plugin-chart-partition/src/Partition.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          for (let x = xMin; x < xMax; x += period) {
                            xValues.push(x);
                          }
              Severity: Major
              Found in superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                              if (n.children[j].weight / n.sum < partitionThreshold) {
                                removeIndices.push(j);
                              }
                Severity: Major
                Found in superset-frontend/plugins/legacy-plugin-chart-partition/src/Partition.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                if (clusterLabel >= 10000) {
                                  clusterLabel = `${Math.round(clusterLabel / 1000)}k`;
                                } else if (clusterLabel >= 1000) {
                                  clusterLabel = `${Math.round(clusterLabel / 100) / 10}k`;
                                }

                    Function handleChartDataResponse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function handleChartDataResponse(response, json, useLegacyApi) {
                      if (isFeatureEnabled(FeatureFlag.GlobalAsyncQueries)) {
                        // deal with getChartDataRequest transforming the response data
                        const result = 'result' in json ? json.result : json;
                        switch (response.status) {
                    Severity: Minor
                    Found in superset-frontend/src/components/Chart/chartAction.js - About 45 mins 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 exploreJSON has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      formData,
                      force = false,
                      timeout,
                      key,
                      dashboardId,
                    Severity: Minor
                    Found in superset-frontend/src/components/Chart/chartAction.js - About 45 mins to fix

                      Function constructor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                        constructor(adhocMetric) {
                          this.expressionType = adhocMetric.expressionType || EXPRESSION_TYPES.SIMPLE;
                          if (this.expressionType === EXPRESSION_TYPES.SIMPLE) {
                            // try to be clever in the case of transitioning from Sql expression back to simple expression
                            const inferredColumn = inferSqlExpressionColumn(adhocMetric);

                      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 runQueryFromSqlEditor has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        database,
                        queryEditor,
                        defaultQueryLimit,
                        tempTable,
                        ctas,
                      Severity: Minor
                      Found in superset-frontend/src/SqlLab/actions/sqlLab.js - About 45 mins to fix

                        Function getComponentWidthFromDrop has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export default function getComponentWidthFromDrop({
                          dropResult,
                          layout: components,
                        }) {
                          const { source, destination, dragging } = dropResult;
                        Severity: Minor
                        Found in superset-frontend/src/dashboard/util/getComponentWidthFromDrop.js - About 45 mins 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 postChartFormData has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          formData,
                          force = false,
                          timeout,
                          key,
                          dashboardId,
                        Severity: Minor
                        Found in superset-frontend/src/components/Chart/chartAction.js - About 45 mins to fix

                          Function prepareCopyToClipboardTabularData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function prepareCopyToClipboardTabularData(data, columns) {
                            let result = columns.length
                              ? `${columns.map(getColumnName).join('\t')}\n`
                              : '';
                            for (let i = 0; i < data.length; i += 1) {
                          Severity: Minor
                          Found in superset-frontend/src/utils/common.js - About 45 mins 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 main has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def main(event_type: str, sha: str, repo: str) -> None:
                              """Main function to check for file changes based on event context."""
                              print("SHA:", sha)
                              print("EVENT_TYPE", event_type)
                              if event_type == "pull_request":
                          Severity: Minor
                          Found in scripts/change_detector.py - About 45 mins 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 get_docker_tags has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def get_docker_tags(
                          Severity: Minor
                          Found in scripts/build_docker.py - About 45 mins to fix

                            Function run_cypress_for_test_file has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def run_cypress_for_test_file(
                            Severity: Minor
                            Found in scripts/cypress_run.py - About 45 mins to fix

                              Function findTopLevelComponentIds has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function findTopLevelComponentIds(layout) {
                                const topLevelNodes = [];
                              
                                function recurseFromNode({
                                  node,
                              Severity: Minor
                              Found in superset-frontend/src/dashboard/util/logging/findTopLevelComponentIds.js - About 45 mins 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