datacoves/dbt-coves

View on GitHub

Showing 89 of 94 total issues

Avoid deeply nested control flow statements.
Open

                        for k, v in secret_data.items():
                            self._replace_dict_key(object_details, k, v)

Severity: Major
Found in dbt_coves/tasks/load/fivetran.py - About 45 mins to fix

    Function render_templates has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def render_templates(self, relation, columns, destination, options=None, json_cols=None):
    Severity: Minor
    Found in dbt_coves/tasks/generate/base.py - About 35 mins to fix

      Function new_object_exists_in_current_yml has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def new_object_exists_in_current_yml(
      Severity: Minor
      Found in dbt_coves/tasks/generate/base.py - About 35 mins to fix

        Function api_call has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def api_call(
        Severity: Minor
        Found in dbt_coves/utils/api_caller.py - About 35 mins to fix

          Function update_connector_table_config has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def update_connector_table_config(
          Severity: Minor
          Found in dbt_coves/utils/api_caller.py - About 35 mins to fix

            Function render_property_file has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def render_property_file(self, template, context, model_yml, templates_folder):
            Severity: Minor
            Found in dbt_coves/tasks/generate/base.py - About 35 mins to fix

              Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(
              Severity: Minor
              Found in dbt_coves/tasks/generate/airflow_generators/fivetran.py - About 35 mins to fix

                Function generate_or_append_metadata has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def generate_or_append_metadata(self, relation, destination, options, action, existing_rows):
                Severity: Minor
                Found in dbt_coves/tasks/generate/metadata.py - About 35 mins to fix

                  Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(
                  Severity: Minor
                  Found in dbt_coves/tasks/generate/airflow_generators/base.py - About 35 mins to fix

                    Function print_row has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def print_row(
                    Severity: Minor
                    Found in dbt_coves/tasks/setup/utils.py - About 35 mins to fix

                      Function _create_or_update_source has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _create_or_update_source(self, exported_json_data):
                              """
                              Decide whether creating or updating an existing source\
                              (if it's name corresponds to an existing name in JSON exported configuration)
                              """
                      Severity: Minor
                      Found in dbt_coves/tasks/load/airbyte.py - About 35 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 dbt_init has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def dbt_init(self, config_folder=None):
                              if not config_folder:
                                  config_folder = self.get_config_folder(mandatory=False)
                      
                              if config_folder:
                      Severity: Minor
                      Found in dbt_coves/tasks/setup/dbt.py - About 35 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 _create_or_update_connection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _create_or_update_connection(self, connection_json: dict):
                              """
                              Identify source_id and destination_id by their names
                              Update or create connection
                              """
                      Severity: Minor
                      Found in dbt_coves/tasks/load/airbyte.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def run(self):
                              ymls_path = self.get_config_value("yml_path")
                              dags_path = self.get_config_value("dags_path")
                              if not (ymls_path and dags_path):
                                  raise MissingArgumentException(["--yml-path", "--dags-path"], self.coves_config)
                      Severity: Minor
                      Found in dbt_coves/tasks/generate/airflow_dags.py - About 35 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 _create_or_update_destination has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _create_or_update_destination(self, exported_json_data):
                              """
                              Decide whether creating or updating an existing destination
                              (if it's name corresponds to an existing name in JSON exported configuration)
                              """
                      Severity: Minor
                      Found in dbt_coves/tasks/load/airbyte.py - About 35 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

                      Avoid too many return statements within this function.
                      Open

                          return exit_code
                      Severity: Major
                      Found in dbt_coves/core/main.py - About 30 mins to fix

                        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 _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

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language