Showing 93 of 93 total issues
Function generate_or_append_metadata
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def generate_or_append_metadata(self, relation, destination, options, action, existing_rows):
destination.parent.mkdir(parents=True, exist_ok=True)
if action == "append":
python_fs_action = "a"
if action == "create":
- 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 dag_args_to_string
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def dag_args_to_string(self, yaml, indent=2):
"""
Converts a dictionary to a string of arguments for the DAG constructor.
"""
dag_args = ""
- 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 sqla_col_to_column_schema
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def sqla_col_to_column_schema(sql_col: ColumnAny) -> Optional[TColumnSchema]:
"""Infer dlt schema column type from an sqlalchemy type.
Precision and scale is inferred from that types that support it,
such as numeric, varchar, int, bigint
- 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 sql_table
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def sql_table(
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function dbt_deps
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def dbt_deps(self, config_folder=None):
if not config_folder:
config_folder = self.get_config_folder(mandatory=False)
if config_folder:
- 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 make_query
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def make_query(self) -> SelectAny:
table = self.table
query = table.select()
if not self.incremental:
return 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_connection_schema
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _get_connection_schema(self, conn, destination_config):
"""Given an airybte connection, returns a schema name"""
namespace_definition = conn["namespaceDefinition"]
if namespace_definition == "source" or (
- 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 run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def run(self) -> int:
self.extraction_results = set()
extract_destination = self.get_config_value("path")
self.api_key = self.get_config_value("api_key")
- 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 _dbt_schema_table_in_connector
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _dbt_schema_table_in_connector(self, connector_schemas, dbt_schema, dbt_table):
for schema_details in connector_schemas.values():
if schema_details.get("name_in_destination", "").lower() == dbt_schema:
for table_details in schema_details.get("tables", {}).values():
if table_details.get("name_in_destination", "").lower() == dbt_table:
- 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 _load_fivetran_datacoves_secrets
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _load_fivetran_datacoves_secrets(self, fivetran_object):
for secret in self.secret_manager_data:
for destination_data in fivetran_object.values():
object_details = destination_data["details"]
if object_details["id"] == secret.get("slug", ""):
- 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 replace_env_vars
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def replace_env_vars(self, yaml_dict: Dict) -> Dict:
# regex -> {{ env_var('ENV_VAR_NAME', 'DEFAULT_VALUE') }}
env_var_pattern = re.compile(
r"\{\{\s*env_var\s*\(\s*['\"]?\s*([^'\"]+)['\"]?\s*(?:,\s*['\"]?\s*([^'\"]+)['\"]?\s*)?\)\s*\}\}"
)
- 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 sql_database
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def sql_database(
Function modify_property_file
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def modify_property_file(
Function run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run(self):
self.loading_results = {
"sources": {"updated": [], "created": []},
"destinations": {"updated": [], "created": []},
"connections": {"updated": [], "created": []},
- 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_metadata
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_metadata(self):
"""
If metadata path is configured, returns a dictionary with column keys
and their corresponding values.
If metadata is already set, do not load again and return the existing value.
- 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_or_create_fivetran_destination
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _update_or_create_fivetran_destination(self, exported_destination, target_group_id):
"""
Given exported destination data
- update if ID exists
- create a new one if doesn't
- 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 render_property_files
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_property_files(
Function table_rows
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def table_rows(
Avoid deeply nested control flow statements. Open
for schema_id, schema_data in connector_data.get("schemas", {}).items():
if (
self._dbt_schema_table_in_connector(
{schema_id: schema_data},
source_schema.lower(),