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],
- Read upRead up
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(
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:
- Read upRead up
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
Avoid too many return
statements within this function. Open
return "DATETIME"
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.
- Read upRead up
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"