Showing 2,441 of 6,157 total issues
Function histogram
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def histogram(
Function execute_sql_statement
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute_sql_statement( # pylint: disable=too-many-statements, too-many-locals
Avoid deeply nested control flow statements. Open
if serialized_payload_size > max_bytes:
logger.info("Result size exceeds the allowed limit.")
raise SupersetErrorException(
SupersetError(
message=f"Result size ({serialized_payload_size / BYTES_IN_MB:.2f} MB) exceeds the allowed limit of {sql_lab_payload_max_mb} MB.",
Function _check_cte_is_select
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _check_cte_is_select(self, oxide_parse: list[dict[str, Any]]) -> bool:
"""
Check if a oxide parsed CTE contains only SELECT statements
:param oxide_parse: parsed CTE
- 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 isinstance(filtr["val"], list):
if isinstance(existing_filters[filter_key], list):
# Add filters for unequal lists
# order doesn't matter
if set(existing_filters[filter_key]) != set(filtr["val"]):
Function cache_warmup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cache_warmup(
strategy_name: str, *args: Any, **kwargs: Any
) -> Union[dict[str, list[str]], str]:
"""
Warm up cache.
- 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
Function estimate_query_cost
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def estimate_query_cost( # pylint: disable=too-many-arguments
Function latest_sub_partition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def latest_sub_partition(
cls,
database: Database,
table: Table,
**kwargs: Any,
- 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 column_type is None:
column_type = types.String()
logger.info(
"Did not recognize type %s of column %s",
field_info[1],
Avoid deeply nested control flow statements. Open
if field_info[1] == "array" or field_info[1] == "row":
stack.append((field_info[0], field_info[1]))
full_parent_path = cls._get_full_name(stack)
result.append(
cls._create_column_info(full_parent_path, column_type)
Function update_impersonation_config
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_impersonation_config( # pylint: disable=too-many-arguments
Function update_impersonation_config
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_impersonation_config( # pylint: disable=too-many-arguments
Function normalize_df
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def normalize_df(self, df: pd.DataFrame, query_object: QueryObject) -> pd.DataFrame:
# todo: should support "python_date_format" and "get_column" in each datasource
def _get_timestamp_format(
source: BaseDatasource, column: str | None
) -> str | None:
- 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
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Avoid deeply nested control flow statements. Open
if post_processing.get("operation") == "pivot":
post_processing["options"]["index"] = [granularity]
# If no temporal x-axis, then get the default temporal filter
if not filter_to_remove:
Avoid deeply nested control flow statements. Open
if not single_field:
continue
# split on whitespace to get field name and data type
field_info = cls._split_data_type(single_field, r"\s")
Function get_prequeries
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_prequeries(
Function get_dbapi_exception_mapping
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_dbapi_exception_mapping(cls) -> dict[type[Exception], type[Exception]]:
# pylint: disable=import-outside-toplevel
from requests import exceptions as requests_exceptions
from trino import exceptions as trino_exceptions
- 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
Function update_impersonation_config
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_impersonation_config( # pylint: disable=too-many-arguments
Function _get_fields
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_fields(cls, cols: list[ResultSetColumnType]) -> list[ColumnClause]:
"""
Format column clauses where names are in quotes and labels are specified
:param cols: columns
:return: column clauses
- 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"