getindata/dbt-airflow-factory

View on GitHub

Showing 4 of 86 total issues

Function create_failure_handler has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def create_failure_handler(self, handlers_config: dict) -> Callable:
        def failure_handler(context: Any) -> None:
            for handler_definition in handlers_config:
                if handler_definition["type"] == "slack":
                    connection = BaseHook.get_connection(handler_definition["connection_id"])
Severity: Minor
Found in dbt_airflow_factory/notifications/handler.py - About 1 hr 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 __init__ has 9 arguments (exceeds 6 allowed). Consider refactoring.
Open

    def __init__(
Severity: Major
Found in dbt_airflow_factory/notifications/ms_teams_webhook_hook.py - About 50 mins to fix

    Function __init__ has 9 arguments (exceeds 6 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in dbt_airflow_factory/notifications/ms_teams_webhook_operator.py - About 50 mins to fix

      Avoid too many return statements within this function.
      Open

              return self._create_task_for_model(
      Severity: Major
      Found in dbt_airflow_factory/tasks_builder/builder.py - About 30 mins to fix
        Severity
        Category
        Status
        Source
        Language