File base.py
has 1981 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
BaseEngineSpec
has 90 functions (exceeds 20 allowed). Consider refactoring. Open
class BaseEngineSpec: # pylint: disable=too-many-public-methods
"""Abstract class for database engine specific configurations
Attributes:
allows_alias_to_source_column: Whether the engine is able to pick the
Function apply_top_to_sql
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def apply_top_to_sql(cls, sql: str, limit: int) -> str:
"""
Alters the SQL statement to apply a TOP clause
:param limit: Maximum number of rows to be returned by the query
:param sql: SQL query
- 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 get_timestamp_expr
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_timestamp_expr(
cls,
col: ColumnClause,
pdf: str | None,
time_grain: 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 select_star
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def select_star( # pylint: disable=too-many-arguments,too-many-locals
cls,
database: Database,
table: Table,
engine: Engine,
- 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 fetch_data
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def fetch_data(cls, cursor: Any, limit: int | None = None) -> list[tuple[Any, ...]]:
"""
:param cursor: Cursor instance
:param limit: Maximum number of rows to be returned by the cursor
- 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 select_star
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def select_star( # pylint: disable=too-many-arguments,too-many-locals
Function _sort_time_grains
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _sort_time_grains(
cls, val: tuple[str | None, str], index: int
) -> float | int | str:
"""
Return an ordered time-based value of a portion of a time grain
- 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 validate_parameters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate_parameters(
cls, properties: BasicPropertiesType
) -> list[SupersetError]:
"""
Validates any number of parameters, for progressive validation.
- 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 get_url_for_impersonation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_url_for_impersonation(
Function adjust_engine_params
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def adjust_engine_params( # pylint: disable=unused-argument
Function execute
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute( # pylint: disable=unused-argument
Function where_latest_partition
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def where_latest_partition( # pylint: disable=unused-argument
Function get_column_types
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_column_types(
cls,
column_type: str | None,
) -> tuple[TypeEngine, GenericDataType] | 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute( # pylint: disable=unused-argument
cls,
cursor: Any,
query: str,
database: Database,
- 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"