airbnb/caravel

View on GitHub
superset/result_set.py

Summary

Maintainability
C
1 day
Test Coverage

Function __init__ has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(  # pylint: disable=too-many-locals
        self,
        data: DbapiResult,
        cursor_description: DbapiDescription,
        db_engine_spec: type[BaseEngineSpec],
Severity: Minor
Found in superset/result_set.py - About 5 hrs 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

Avoid deeply nested control flow statements.
Open

                            if sample.tzinfo:
                                tz = sample.tzinfo
                                series = pd.Series(array[column])
                                series = pd.to_datetime(series)
                                pa_data[i] = pa.Array.from_pandas(
Severity: Major
Found in superset/result_set.py - About 45 mins to fix

    Function stringify_values has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def stringify_values(array: NDArray[Any]) -> NDArray[Any]:
        result = np.copy(array)
    
        with np.nditer(result, flags=["refs_ok"], op_flags=[["readwrite"]]) as it:
            for obj in it:
    Severity: Minor
    Found in superset/result_set.py - About 35 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

    Avoid too many return statements within this function.
    Open

            return None
    Severity: Major
    Found in superset/result_set.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return "DATETIME"
      Severity: Major
      Found in superset/result_set.py - About 30 mins to fix

        Function dedup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def dedup(l: list[str], suffix: str = "__", case_sensitive: bool = True) -> list[str]:  # noqa: E741
            """De-duplicates a list of string by suffixing a counter
        
            Always returns the same number of entries as provided, and always returns
            unique values. Case sensitive comparison by default.
        Severity: Minor
        Found in superset/result_set.py - About 25 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

        There are no issues that match your filters.

        Category
        Status