datacoves/dbt-coves

View on GitHub

Showing 93 of 93 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

    Avoid deeply nested control flow statements.
    Open

                            if (airbyte_schema == schema or not airbyte_schema) and conn.get(
                                "connectionId"
                            ) not in connection_ids:
                                connection_ids.append(conn["connectionId"])
            if connection_ids:
    Severity: Major
    Found in dbt_coves/tasks/generate/airflow_generators/airbyte.py - About 45 mins to fix

      Function integrated has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def integrated(self):
              """
              Returns the values read from the config file plus the overrides from cli flags
              """
              config_copy = self._config.dict()
      Severity: Minor
      Found in dbt_coves/config/config.py - About 45 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 main has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def main(parser: argparse.ArgumentParser = parser, test_cli_args: List[str] = list()) -> int:
          tracking.do_not_track()
      
          exit_code = 0
          cli_args = test_cli_args or []
      Severity: Minor
      Found in dbt_coves/core/main.py - About 45 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 list_from_dbt_ls has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def list_from_dbt_ls(self, output):
              user_selectors = list()
              if self.get_config_value("select"):
                  user_selectors.append("--select")
                  user_selectors.append(self.get_config_value("select"))
      Severity: Minor
      Found in dbt_coves/tasks/generate/properties.py - About 45 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 __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 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 __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 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 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 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 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 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 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 _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 _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 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_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

                        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

                        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
                          Severity
                          Category
                          Status
                          Source
                          Language