datacoves/dbt-coves

View on GitHub

Showing 93 of 93 total issues

Function _print_load_results has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _print_load_results(self):
        """
        Inform the user successful loading results
        """
        console.print("[green][b]Load successful :heavy_check_mark:[/b][/green]")
Severity: Minor
Found in dbt_coves/tasks/load/airbyte.py - About 25 mins to fix

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_id_by_table_name has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_connection_id_by_table_name(self, table_name):
        """
        Given a table name, returns the corresponding airbyte connection
        """
        for conn in self.airbyte_api.airbyte_connections_list:
Severity: Minor
Found in dbt_coves/tasks/load/airbyte.py - About 25 mins to fix

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 deep_merge has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def deep_merge(new_values, default_values):
    """Merge new values into default values dict, overrding existing values"""

    def merge(source, destination):
        for key, value in source.items():
Severity: Minor
Found in dbt_coves/utils/yaml.py - About 25 mins to fix

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 new_object_exists_in_current_yml has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def new_object_exists_in_current_yml(
        self,
        current_yml,
        template,
        context,
Severity: Minor
Found in dbt_coves/tasks/generate/base.py - About 25 mins to fix

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 trackable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def trackable(task, **kwargs):
    def wrapper(task_instance, **kwargs):
        exit_code = task(task_instance)
        if task_instance.args.uuid and not task_instance.args.disable_tracking:
            try:
Severity: Minor
Found in dbt_coves/utils/tracking.py - About 25 mins to fix

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 _discover_secrets has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _discover_secrets(self, yml_dag: Dict[str, Any]):
        """
        Load secrets locally/remotely, and merge their 'nodes' into YML file ones
        """
        if self.secrets_path:
Severity: Minor
Found in dbt_coves/tasks/generate/airflow_dags.py - About 25 mins to fix

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 6 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self):
        self.no_prompt = self.get_config_value("no_prompt")
        config_database = self.get_config_value("database")
        self.db = config_database or self.config.credentials.database

Severity: Minor
Found in dbt_coves/tasks/generate/metadata.py - About 25 mins to fix

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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def generate(self, models, manifest):
        prop_destination = self.get_config_value("destination").lower()
        options = {
            "model_prop_update_all": False,
            "model_prop_recreate_all": False,
Severity: Minor
Found in dbt_coves/tasks/generate/properties.py - About 25 mins to fix

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_config_folder has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get_config_folder(cls, workspace_path=None, mandatory=True):
        if not workspace_path:
            workspace_path = Path.cwd()
        config_folders = [path for path in Path(workspace_path).rglob("**/.dbt_coves/")]
        if not config_folders:
Severity: Minor
Found in dbt_coves/config/config.py - About 25 mins to fix

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 locate_config has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def locate_config(self) -> None:
        # If path is relative to cwd
        if self._config_path == Path(str()):
            logger.debug("Trying to find .dbt_coves in current folder")

Severity: Minor
Found in dbt_coves/config/config.py - About 25 mins to fix

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_fivetran_connector_name_for_id has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_fivetran_connector_name_for_id(self, connector_id):
        """
        Create a name for Fivetran tasks based on a Connector ID
        """
        for dest_data in self.fivetran_data.values():
Severity: Minor
Found in dbt_coves/tasks/generate/airflow_generators/fivetran.py - About 25 mins to fix

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 _print_load_results has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _print_load_results(self):
        for obj_type, result_dict in self.load_results.items():
            for activity, result in result_dict.items():
                if len(result) > 0:
                    console.print(
Severity: Minor
Found in dbt_coves/tasks/load/fivetran.py - About 25 mins to fix

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_target_connector_schema_config has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _update_target_connector_schema_config(self, connector, extracted_schemas):
        connector_id = connector["id"]
        connector_schemas = self.fivetran_api._get_connector_schemas(connector_id)
        if connector_schemas:
            self.fivetran_api.update_connector_schema_config(connector_id, extracted_schemas)
Severity: Minor
Found in dbt_coves/tasks/load/fivetran.py - About 25 mins to fix

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

Severity
Category
Status
Source
Language