Showing 88 of 93 total issues
Function generate_task_group
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def generate_task_group(self, tg_name: str, tg_conf: Dict[str, Any]):
"""
Generate Task Groups, using YML's `generator` or `tasks`
"""
self.dag_output["imports"].append("from airflow.decorators import task_group\n"),
- 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_secrets
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def _get_secrets(self, exported_json_data, directory):
"""
Get Airbyte's connectionConfiguration keys and values for a specified filename
(source.json) and directory or object type: destinations/sources
"""
- 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
File api_caller.py
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
from typing import Any, Dict
import requests
from requests.auth import HTTPBasicAuth
File metadata.py
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
import csv
import json
from pathlib import Path
import questionary
Function _load_fivetran_local_secrets
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _load_fivetran_local_secrets(self, fivetran_object):
"""
Identify secret files' key:values and replace Fivetran object ones
"""
for secret in self.local_secrets:
- 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 setup_ssh
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def setup_ssh(self):
ssh_status = "[red]MISSING[/red]"
ssh_configured = False
ssh_keys_dir = "~/.ssh/"
self.ssh_keys_dir_abs = os.path.abspath(Path(ssh_keys_dir).expanduser())
- 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_secret_manager_data
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def load_secret_manager_data(task_instance) -> dict:
payload = {}
manager = task_instance.secrets_manager.lower()
if manager == "datacoves":
# Contact the secrets manager and retrieve Secrets
- 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 generate_model
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def generate_model(self, relation, destination, options):
destination.parent.mkdir(parents=True, exist_ok=True)
columns = self.adapter.get_columns_in_relation(relation)
nested_field_type = self.NESTED_FIELD_TYPES.get(self.adapter.__class__.__name__)
nested = [col.name for col in columns if col.dtype == nested_field_type]
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
def run(self) -> int:
project_dir = self.get_config_value("project_dir")
if not project_dir:
project_dir = os.environ.get("DBT_PROJECT_DIR", os.environ.get("DATACOVES__DBT_HOME"))
if not project_dir:
- 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 a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def sql_database(
credentials: Union[ConnectionStringCredentials, Engine, str] = dlt.secrets.value,
schema: Optional[str] = dlt.config.value,
metadata: Optional[MetaData] = None,
table_names: Optional[List[str]] = dlt.config.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 _get_secret_value_for_field
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _get_secret_value_for_field(self, secret_data, field, secret_target_name):
for k, v in secret_data.items():
if k.lower() == field:
return v
if isinstance(v, dict):
- 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_columns
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_metadata_columns(self, relation, cols):
"""
Get metadata col
"""
metadata = self.get_metadata()
- 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 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function table_rows
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def table_rows(
engine: Engine,
table: Table,
chunk_size: int,
incremental: Optional[dlt.sources.incremental[Any]] = 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 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 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 get_nested_keys
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_nested_keys(self, json_cols, relation):
config_db = self.get_config_value("database")
if config_db:
config_db += "."
else:
- 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 __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function sql_table
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def sql_table(