abhioncbr/docker-airflow

View on GitHub
airflowPatch1.9/models.py

Summary

Maintainability
F
5 mos
Test Coverage

File models.py has 4049 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Severity: Major
Found in airflowPatch1.9/models.py - About 1 wk to fix

    DAG has 64 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class DAG(BaseDag, LoggingMixin):
        """
        A dag (directed acyclic graph) is a collection of tasks with directional
        dependencies. A dag also has a schedule, a start end an end date
        (optional). For each schedule, (say daily or hourly), the DAG needs to run
    Severity: Major
    Found in airflowPatch1.9/models.py - About 1 day to fix

      Function process_file has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

          def process_file(self, filepath, only_if_updated=True, safe_mode=True):
              """
              Given a path to a python module or zip file, this method imports
              the module and look for dag objects within it.
              """
      Severity: Minor
      Found in airflowPatch1.9/models.py - About 1 day 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

      BaseOperator has 44 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class BaseOperator(LoggingMixin):
          """
          Abstract base class for all operators. Since operators create objects that
          become node in the dag, BaseOperator contains many recursive methods for
          dag crawling behavior. To derive this class, you are expected to override
      Severity: Minor
      Found in airflowPatch1.9/models.py - About 6 hrs to fix

        TaskInstance has 39 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class TaskInstance(Base, LoggingMixin):
            """
            Task instances store the state of a task instance. This table is the
            authority and single source of truth around what tasks have run and the
            state they are in.
        Severity: Minor
        Found in airflowPatch1.9/models.py - About 5 hrs to fix

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

              def __init__(
          Severity: Major
          Found in airflowPatch1.9/models.py - About 4 hrs to fix

            Function collect_dags has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
            Open

                def collect_dags(
                        self,
                        dag_folder=None,
                        only_if_updated=True):
                    """
            Severity: Minor
            Found in airflowPatch1.9/models.py - About 4 hrs 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_raw_task has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                def _run_raw_task(
                        self,
                        mark_success=False,
                        test_mode=False,
                        job_id=None,
            Severity: Minor
            Found in airflowPatch1.9/models.py - About 3 hrs 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_state has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                def update_state(self, session=None):
                    """
                    Determines the overall state of the DagRun based on the state
                    of its TaskInstances.
            
            
            Severity: Minor
            Found in airflowPatch1.9/models.py - About 2 hrs 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 clear_task_instances has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

            def clear_task_instances(tis, session, activate_dag_runs=True, dag=None):
                """
                Clears a set of task instances, but makes sure the running ones
                get killed.
                """
            Severity: Minor
            Found in airflowPatch1.9/models.py - About 2 hrs 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_hook has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                def get_hook(self):
                    try:
                        if self.conn_type == 'mysql':
                            from airflow.hooks.mysql_hook import MySqlHook
                            return MySqlHook(mysql_conn_id=self.conn_id)
            Severity: Minor
            Found in airflowPatch1.9/models.py - About 2 hrs 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 18 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(
            Severity: Major
            Found in airflowPatch1.9/models.py - About 2 hrs to fix

              Function handle_failure has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  def handle_failure(self, error, test_mode=False, context=None):
                      self.log.exception(error)
                      task = self.task
                      session = settings.Session()
                      self.end_date = datetime.utcnow()
              Severity: Minor
              Found in airflowPatch1.9/models.py - About 2 hrs 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 clear has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  def clear(
                          self, start_date=None, end_date=None,
                          only_failed=False,
                          only_running=False,
                          confirm_prompt=False,
              Severity: Minor
              Found in airflowPatch1.9/models.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 get_one has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  def get_one(
                              cls,
                              execution_date,
                              key=None,
                              task_id=None,
              Severity: Minor
              Found in airflowPatch1.9/models.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 generate_command has 14 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def generate_command(dag_id,
              Severity: Major
              Found in airflowPatch1.9/models.py - About 1 hr to fix

                Function _set_relatives has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _set_relatives(self, task_or_task_list, upstream=False):
                        try:
                            task_list = list(task_or_task_list)
                        except TypeError:
                            task_list = [task_or_task_list]
                Severity: Minor
                Found in airflowPatch1.9/models.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 topological_sort has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def topological_sort(self):
                        """
                        Sorts tasks in topographical order, such that a task comes after any of its
                        upstream dependencies.
                
                
                Severity: Minor
                Found in airflowPatch1.9/models.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 get_many has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    def get_many(
                                cls,
                                execution_date,
                                key=None,
                                task_ids=None,
                Severity: Minor
                Found in airflowPatch1.9/models.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 _check_and_change_state_before_execution has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _check_and_change_state_before_execution(
                            self,
                            verbose=True,
                            ignore_all_deps=False,
                            ignore_depends_on_past=False,
                Severity: Minor
                Found in airflowPatch1.9/models.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 a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __init__(
                            self,
                            task_id,
                            owner=configuration.get('operators', 'DEFAULT_OWNER'),
                            email=None,
                Severity: Minor
                Found in airflowPatch1.9/models.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 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def __init__(
                            self,
                            task_id,
                            owner=configuration.get('operators', 'DEFAULT_OWNER'),
                            email=None,
                Severity: Minor
                Found in airflowPatch1.9/models.py - About 1 hr to fix

                  Function generate_command has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def generate_command(dag_id,
                                           task_id,
                                           execution_date,
                                           mark_success=False,
                                           ignore_all_deps=False,
                  Severity: Minor
                  Found in airflowPatch1.9/models.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 command has 11 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def command(
                  Severity: Major
                  Found in airflowPatch1.9/models.py - About 1 hr to fix

                    Function command_as_list has 11 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def command_as_list(
                    Severity: Major
                    Found in airflowPatch1.9/models.py - About 1 hr to fix

                      Function run has 11 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def run(
                      Severity: Major
                      Found in airflowPatch1.9/models.py - About 1 hr to fix

                        Function previous_ti has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def previous_ti(self, session=None):
                                """ The task instance for the task that ran before this task instance """
                        
                                dag = self.task.dag
                                if dag:
                        Severity: Minor
                        Found in airflowPatch1.9/models.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 run has 10 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def run(
                        Severity: Major
                        Found in airflowPatch1.9/models.py - About 1 hr to fix

                          Function verify_integrity has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def verify_integrity(self, session=None):
                                  """
                                  Verifies the DagRun by checking for removed tasks or tasks that are not in the
                                  database yet. It will set state to removed or add the task if required.
                                  """
                          Severity: Minor
                          Found in airflowPatch1.9/models.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 _check_and_change_state_before_execution has 10 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def _check_and_change_state_before_execution(
                          Severity: Major
                          Found in airflowPatch1.9/models.py - About 1 hr to fix

                            Function __init__ has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def __init__(
                                        self, dag_id,
                                        description='',
                                        schedule_interval=timedelta(days=1),
                                        start_date=None, end_date=None,
                            Severity: Minor
                            Found in airflowPatch1.9/models.py - About 1 hr to fix

                              Function clear_dags has 9 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def clear_dags(
                              Severity: Major
                              Found in airflowPatch1.9/models.py - About 1 hr to fix

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

                                    def __init__(
                                Severity: Major
                                Found in airflowPatch1.9/models.py - About 1 hr to fix

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

                                      def get_dag(self, dag_id):
                                          """
                                          Gets the DAG out of the dictionary, and refreshes it if expired
                                          """
                                          # If asking for a known subdag, we want to refresh the parent
                                  Severity: Minor
                                  Found in airflowPatch1.9/models.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 get_task_instances has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def get_task_instances(self, state=None, session=None):
                                          """
                                          Returns the task instances for this dag run
                                          """
                                          TI = TaskInstance
                                  Severity: Minor
                                  Found in airflowPatch1.9/models.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 _check_and_change_state_before_execution has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      def _check_and_change_state_before_execution(
                                              self,
                                              verbose=True,
                                              ignore_all_deps=False,
                                              ignore_depends_on_past=False,
                                  Severity: Minor
                                  Found in airflowPatch1.9/models.py - About 1 hr to fix

                                    Function clear has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def clear(
                                    Severity: Major
                                    Found in airflowPatch1.9/models.py - About 1 hr to fix

                                      Function get_many has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          def get_many(
                                      Severity: Major
                                      Found in airflowPatch1.9/models.py - About 1 hr to fix

                                        Function find has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            def find(dag_id=None, run_id=None, execution_date=None,
                                                     state=None, external_trigger=None, no_backfills=False,
                                                     session=None):
                                                """
                                                Returns a set of dag runs for the given search criteria.
                                        Severity: Minor
                                        Found in airflowPatch1.9/models.py - About 55 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_dagrun has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            def create_dagrun(self,
                                        Severity: Major
                                        Found in airflowPatch1.9/models.py - About 50 mins to fix

                                          Function set has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                              def set(
                                          Severity: Major
                                          Found in airflowPatch1.9/models.py - About 50 mins to fix

                                            Function get_one has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                                def get_one(
                                            Severity: Major
                                            Found in airflowPatch1.9/models.py - About 50 mins to fix

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

                                                  def clear_dags(
                                                          cls, dags,
                                                          start_date=None,
                                                          end_date=None,
                                                          only_failed=False,
                                              Severity: Minor
                                              Found in airflowPatch1.9/models.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 find has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                  def find(dag_id=None, run_id=None, execution_date=None,
                                              Severity: Minor
                                              Found in airflowPatch1.9/models.py - About 45 mins to fix

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

                                                    def get(cls, key, default_var=None, deserialize_json=False, session=None):
                                                        obj = session.query(cls).filter(cls.key == key).first()
                                                        if obj is None:
                                                            if default_var is not None:
                                                                return default_var
                                                Severity: Minor
                                                Found in airflowPatch1.9/models.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

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                        with zip_file.open(mod.filename) as zf:
                                                                            self.log.debug("Reading %s from %s", mod.filename, filepath)
                                                                            content = zf.read()
                                                                            if not all([s in content for s in (b'DAG', b'airflow')]):
                                                                                self.file_last_changed[filepath] = (
                                                Severity: Major
                                                Found in airflowPatch1.9/models.py - About 45 mins to fix

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

                                                      def add_task(self, task):
                                                          """
                                                          Add a task to the DAG
                                                  
                                                          :param task: the task you want to add
                                                  Severity: Minor
                                                  Found in airflowPatch1.9/models.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

                                                  Consider simplifying this complex logical expression.
                                                  Open

                                                              if (not unfinished_tasks and
                                                                      any(r.state in (State.FAILED, State.UPSTREAM_FAILED) for r in roots)):
                                                                  self.log.info('Marking run %s failed', self)
                                                                  self.state = State.FAILED
                                                  
                                                  
                                                  Severity: Major
                                                  Found in airflowPatch1.9/models.py - About 40 mins to fix

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

                                                        def __init__(self, event, task_instance, owner=None, extra=None, **kwargs):
                                                    Severity: Minor
                                                    Found in airflowPatch1.9/models.py - About 35 mins to fix

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

                                                          def xcom_pull(
                                                      Severity: Minor
                                                      Found in airflowPatch1.9/models.py - About 35 mins to fix

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

                                                            def xcom_pull(
                                                        Severity: Minor
                                                        Found in airflowPatch1.9/models.py - About 35 mins to fix

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

                                                              def run(
                                                          Severity: Minor
                                                          Found in airflowPatch1.9/models.py - About 35 mins to fix

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

                                                                def _run_raw_task(
                                                            Severity: Minor
                                                            Found in airflowPatch1.9/models.py - About 35 mins to fix

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

                                                                  def sub_dag(self, task_regex, include_downstream=False,
                                                                              include_upstream=True):
                                                                      """
                                                                      Returns a subset of the current dag as a deep copy of the current dag
                                                                      based on a regex that should match one or many tasks, and includes
                                                              Severity: Minor
                                                              Found in airflowPatch1.9/models.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 get_template_context has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  def get_template_context(self, session=None):
                                                                      task = self.task
                                                                      from airflow import macros
                                                                      tables = None
                                                                      if 'tables' in task.params:
                                                              Severity: Minor
                                                              Found in airflowPatch1.9/models.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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  def __init__(
                                                                          self, dag_id,
                                                                          description='',
                                                                          schedule_interval=timedelta(days=1),
                                                                          start_date=None, end_date=None,
                                                              Severity: Minor
                                                              Found in airflowPatch1.9/models.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 kill_zombies has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  def kill_zombies(self, session=None):
                                                                      """
                                                                      Fails tasks that haven't had a heartbeat in too long
                                                                      """
                                                                      from airflow.jobs import LocalTaskJob as LJ
                                                              Severity: Minor
                                                              Found in airflowPatch1.9/models.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 render_templates has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  def render_templates(self):
                                                                      task = self.task
                                                                      jinja_context = self.get_template_context()
                                                                      if hasattr(self, 'task') and hasattr(self.task, 'dag'):
                                                                          if self.task.dag.user_defined_macros:
                                                              Severity: Minor
                                                              Found in airflowPatch1.9/models.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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  def __init__(self, event, task_instance, owner=None, extra=None, **kwargs):
                                                                      self.dttm = datetime.utcnow()
                                                                      self.event = event
                                                                      self.extra = extra
                                                              
                                                              
                                                              Severity: Minor
                                                              Found in airflowPatch1.9/models.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 update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  def update(dag_ids=None, dirty_only=True, session=None):
                                                                      """
                                                                      Updates the stats for dirty/out-of-sync dags
                                                              
                                                                      :param dag_ids: dag_ids to be updated
                                                              Severity: Minor
                                                              Found in airflowPatch1.9/models.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 JiraHook(jira_conn_id=self.conn_id)
                                                              Severity: Major
                                                              Found in airflowPatch1.9/models.py - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                                                return found_dags
                                                                Severity: Major
                                                                Found in airflowPatch1.9/models.py - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                                  return JdbcHook(jdbc_conn_id=self.conn_id)
                                                                  Severity: Major
                                                                  Found in airflowPatch1.9/models.py - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                                    return CloudantHook(cloudant_conn_id=self.conn_id)
                                                                    Severity: Major
                                                                    Found in airflowPatch1.9/models.py - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

                                                                                      return MsSqlHook(mssql_conn_id=self.conn_id)
                                                                      Severity: Major
                                                                      Found in airflowPatch1.9/models.py - About 30 mins to fix

                                                                        Avoid too many return statements within this function.
                                                                        Open

                                                                                        return OracleHook(oracle_conn_id=self.conn_id)
                                                                        Severity: Major
                                                                        Found in airflowPatch1.9/models.py - About 30 mins to fix

                                                                          Avoid too many return statements within this function.
                                                                          Open

                                                                                          return VerticaHook(vertica_conn_id=self.conn_id)
                                                                          Severity: Major
                                                                          Found in airflowPatch1.9/models.py - About 30 mins to fix

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                                            return HiveServer2Hook(hiveserver2_conn_id=self.conn_id)
                                                                            Severity: Major
                                                                            Found in airflowPatch1.9/models.py - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                              return DockerHook(docker_conn_id=self.conn_id)
                                                                              Severity: Major
                                                                              Found in airflowPatch1.9/models.py - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                                return SqliteHook(sqlite_conn_id=self.conn_id)
                                                                                Severity: Major
                                                                                Found in airflowPatch1.9/models.py - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

                                                                                                  return RedisHook(redis_conn_id=self.conn_id)
                                                                                  Severity: Major
                                                                                  Found in airflowPatch1.9/models.py - About 30 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                            return found_dags
                                                                                    Severity: Major
                                                                                    Found in airflowPatch1.9/models.py - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                                      return PrestoHook(presto_conn_id=self.conn_id)
                                                                                      Severity: Major
                                                                                      Found in airflowPatch1.9/models.py - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                        return WasbHook(wasb_conn_id=self.conn_id)
                                                                                        Severity: Major
                                                                                        Found in airflowPatch1.9/models.py - About 30 mins to fix

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

                                                                                              def get_val(self):
                                                                                                  if self._val and self.is_encrypted:
                                                                                                      try:
                                                                                                          fernet = get_fernet()
                                                                                                      except:
                                                                                          Severity: Minor
                                                                                          Found in airflowPatch1.9/models.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 resolve_template_files has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                          Open

                                                                                              def resolve_template_files(self):
                                                                                                  # Getting the content of files for template_field / template_ext
                                                                                                  for attr in self.template_fields:
                                                                                                      content = getattr(self, attr)
                                                                                                      if content is not None and \
                                                                                          Severity: Minor
                                                                                          Found in airflowPatch1.9/models.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 create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                          Open

                                                                                              def create(dag_id, session=None):
                                                                                                  """
                                                                                                  Creates the missing states the stats table for the dag specified
                                                                                          
                                                                                                  :param dag_id: dag id of the dag to create stats for
                                                                                          Severity: Minor
                                                                                          Found in airflowPatch1.9/models.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_failed_dep_statuses has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                          Open

                                                                                              def get_failed_dep_statuses(
                                                                                                      self,
                                                                                                      dep_context=None,
                                                                                                      session=None):
                                                                                                  dep_context = dep_context or DepContext()
                                                                                          Severity: Minor
                                                                                          Found in airflowPatch1.9/models.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 __hash__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                          Open

                                                                                              def __hash__(self):
                                                                                                  hash_components = [type(self)]
                                                                                                  for c in self._comps:
                                                                                                      # task_ids returns a list and lists can't be hashed
                                                                                                      if c == 'task_ids':
                                                                                          Severity: Minor
                                                                                          Found in airflowPatch1.9/models.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 are_dependencies_met has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                          Open

                                                                                              def are_dependencies_met(
                                                                                                      self,
                                                                                                      dep_context=None,
                                                                                                      session=None,
                                                                                                      verbose=False):
                                                                                          Severity: Minor
                                                                                          Found in airflowPatch1.9/models.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

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def get_template_context(self, session=None):
                                                                                                  task = self.task
                                                                                                  from airflow import macros
                                                                                                  tables = None
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 5 days to fix
                                                                                          airflowPatch1.8/models.py on lines 1464..1563

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 549.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  try:
                                                                                                      if self.conn_type == 'mysql':
                                                                                                          from airflow.hooks.mysql_hook import MySqlHook
                                                                                                          return MySqlHook(mysql_conn_id=self.conn_id)
                                                                                                      elif self.conn_type == 'google_cloud_platform':
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 4 days to fix
                                                                                          airflowPatch1.10/models.py on lines 748..798

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 431.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @staticmethod
                                                                                              @provide_session
                                                                                              def update(dag_ids=None, dirty_only=True, session=None):
                                                                                                  """
                                                                                                  Updates the stats for dirty/out-of-sync dags
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 days to fix
                                                                                          airflowPatch1.10/models.py on lines 4692..4743

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 336.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                          def clear_task_instances(tis, session, activate_dag_runs=True, dag=None):
                                                                                              """
                                                                                              Clears a set of task instances, but makes sure the running ones
                                                                                              get killed.
                                                                                              """
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 days to fix
                                                                                          airflowPatch1.10/models.py on lines 170..217

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 308.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def _set_relatives(self, task_or_task_list, upstream=False):
                                                                                                  try:
                                                                                                      task_list = list(task_or_task_list)
                                                                                                  except TypeError:
                                                                                                      task_list = [task_or_task_list]
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 days to fix
                                                                                          airflowPatch1.8/models.py on lines 2423..2464

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 303.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @staticmethod
                                                                                              def generate_command(dag_id,
                                                                                                                   task_id,
                                                                                                                   execution_date,
                                                                                                                   mark_success=False,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 2 days to fix
                                                                                          airflowPatch1.10/models.py on lines 1028..1095
                                                                                          airflowPatch1.8/models.py on lines 846..911

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 290.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                          class Log(Base):
                                                                                              """
                                                                                              Used to actively log events to the database
                                                                                              """
                                                                                          
                                                                                          
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 2 days to fix
                                                                                          airflowPatch1.10/models.py on lines 2085..2122
                                                                                          airflowPatch1.8/models.py on lines 1710..1747

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 278.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                          class Pool(Base):
                                                                                              __tablename__ = "slot_pool"
                                                                                          
                                                                                              id = Column(Integer, primary_key=True)
                                                                                              pool = Column(String(50), unique=True)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 days to fix
                                                                                          airflowPatch1.10/models.py on lines 5157..5210

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 273.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                          class Chart(Base):
                                                                                              __tablename__ = "chart"
                                                                                          
                                                                                              id = Column(Integer, primary_key=True)
                                                                                              label = Column(String(200))
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 days to fix
                                                                                          airflowPatch1.8/models.py on lines 3469..3491

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 253.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @staticmethod
                                                                                              @provide_session
                                                                                              def find(dag_id=None, run_id=None, execution_date=None,
                                                                                                       state=None, external_trigger=None, no_backfills=False,
                                                                                                       session=None):
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 days to fix
                                                                                          airflowPatch1.10/models.py on lines 4849..4896

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 246.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                              try:
                                                                                                                  filepath = os.path.join(root, f)
                                                                                                                  if not os.path.isfile(filepath):
                                                                                                                      continue
                                                                                                                  mod_name, file_ext = os.path.splitext(
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 days to fix
                                                                                          airflowPatch1.8/models.py on lines 403..425

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 241.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                          class DagModel(Base):
                                                                                          
                                                                                              __tablename__ = "dag"
                                                                                              """
                                                                                              These items are stored in the database for state related information
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 days to fix
                                                                                          airflowPatch1.8/models.py on lines 2511..2553

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 239.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @classmethod
                                                                                              def clear_dags(
                                                                                                      cls, dags,
                                                                                                      start_date=None,
                                                                                                      end_date=None,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 days to fix
                                                                                          airflowPatch1.10/models.py on lines 3823..3878

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 231.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def sub_dag(self, task_regex, include_downstream=False,
                                                                                                          include_upstream=True):
                                                                                                  """
                                                                                                  Returns a subset of the current dag as a deep copy of the current dag
                                                                                                  based on a regex that should match one or many tasks, and includes
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 days to fix
                                                                                          airflowPatch1.8/models.py on lines 3165..3197

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 220.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def get_task_instances(self, state=None, session=None):
                                                                                                  """
                                                                                                  Returns the task instances for this dag run
                                                                                                  """
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 4898..4924
                                                                                          airflowPatch1.8/models.py on lines 3934..3960

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 201.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def sync_to_db(self, owner=None, sync_time=None, session=None):
                                                                                                  """
                                                                                                  Save attributes about this DAG to the DB. Note that this method
                                                                                                  can be called for both DAGs and SubDAGs. A SubDag is actually a
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 4168..4201

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 200.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def get_dag(self, dag_id):
                                                                                                  """
                                                                                                  Gets the DAG out of the dictionary, and refreshes it if expired
                                                                                                  """
                                                                                                  # If asking for a known subdag, we want to refresh the parent
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 280..309
                                                                                          airflowPatch1.8/models.py on lines 188..217

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 194.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def next_retry_datetime(self):
                                                                                                  """
                                                                                                  Get datetime of the next retry if the task instance fails. For exponential
                                                                                                  backoff, retry_delay is used as base and will be converted to seconds.
                                                                                                  """
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 1364..1392

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 185.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def command_as_list(
                                                                                                      self,
                                                                                                      mark_success=False,
                                                                                                      ignore_all_deps=False,
                                                                                                      ignore_task_deps=False,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 983..1014
                                                                                          airflowPatch1.8/models.py on lines 801..832

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 166.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def verify_integrity(self, session=None):
                                                                                                  """
                                                                                                  Verifies the DagRun by checking for removed tasks or tasks that are not in the
                                                                                                  database yet. It will set state to removed or add the task if required.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.8/models.py on lines 4089..4117

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 165.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if dag_run:
                                                                                                      session.query(TaskInstance).filter(
                                                                                                          TaskInstance.dag_id == dag_run.dag_id,
                                                                                                          TaskInstance.execution_date == dag_run.execution_date,
                                                                                                          TaskInstance.task_id.in_(task_ids)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 2142..2164

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 163.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def render_template_from_field(self, attr, content, context, jinja_env):
                                                                                                  """
                                                                                                  Renders a template from a field. If the field is a string, it will
                                                                                                  simply render the string and return the result. If it is a collection or
                                                                                                  nested set of collections, it will traverse the structure and render
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.8/models.py on lines 2208..2230

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 162.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def pickle(self, session=None):
                                                                                                  dag = session.query(
                                                                                                      DagModel).filter(DagModel.dag_id == self.dag_id).first()
                                                                                                  dp = None
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 3951..3966
                                                                                          airflowPatch1.8/models.py on lines 3222..3237

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 160.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                          class TaskFail(Base):
                                                                                              """
                                                                                              TaskFail tracks the failed run durations of each task instance.
                                                                                              """
                                                                                          
                                                                                          
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.8/models.py on lines 1687..1707

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 156.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              @provide_session
                                                                                              def previous_ti(self, session=None):
                                                                                                  """ The task instance for the task that ran before this task instance """
                                                                                          
                                                                                          
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 1269..1297
                                                                                          airflowPatch1.8/models.py on lines 1063..1091

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 149.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @staticmethod
                                                                                              @provide_session
                                                                                              def create(dag_id, session=None):
                                                                                                  """
                                                                                                  Creates the missing states the stats table for the dag specified
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 4745..4767

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 145.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                          class KnownEvent(Base):
                                                                                              __tablename__ = "known_event"
                                                                                          
                                                                                              id = Column(Integer, primary_key=True)
                                                                                              label = Column(String(200))
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 4346..4364
                                                                                          airflowPatch1.8/models.py on lines 3504..3522

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 143.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def topological_sort(self):
                                                                                                  """
                                                                                                  Sorts tasks in topographical order, such that a task comes after any of its
                                                                                                  upstream dependencies.
                                                                                          
                                                                                          
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 3678..3727
                                                                                          airflowPatch1.8/models.py on lines 3025..3073

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 140.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @staticmethod
                                                                                              @provide_session
                                                                                              def get_num_task_instances(dag_id, task_ids, states=None, session=None):
                                                                                                  """
                                                                                                  Returns the number of task instances in the given DAG.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 4246..4272

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 139.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def pickle_info(self, session=None):
                                                                                                  d = {}
                                                                                                  d['is_picklable'] = True
                                                                                                  try:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 3936..3949

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 138.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def parse_from_uri(self, uri):
                                                                                                  temp_uri = urlparse(uri)
                                                                                                  hostname = temp_uri.hostname or ''
                                                                                                  if '%2f' in hostname:
                                                                                                      hostname = hostname.replace('%2f', '/').replace('%2F', '/')
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.8/models.py on lines 558..571

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 135.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def are_dependents_done(self, session=None):
                                                                                                  """
                                                                                                  Checks whether the dependents of this task instance have all succeeded.
                                                                                                  This is meant to be used by wait_for_downstream.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 1245..1267
                                                                                          airflowPatch1.8/models.py on lines 1039..1061

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 134.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                          class SlaMiss(Base):
                                                                                              """
                                                                                              Model that stores a history of the SLA that have been missed.
                                                                                              It is used to keep track of SLA failures over time and to avoid double
                                                                                              triggering alert emails.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 5213..5231
                                                                                          airflowPatch1.8/models.py on lines 4213..4231

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 130.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def resolve_template_files(self):
                                                                                                  # Getting the content of files for template_field / template_ext
                                                                                                  for attr in self.template_fields:
                                                                                                      content = getattr(self, attr)
                                                                                                      if content is not None and \
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 2774..2786

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 129.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def get_run_dates(self, start_date, end_date=None):
                                                                                                  """
                                                                                                  Returns a list of dates between the interval received as parameter using this
                                                                                                  dag's schedule interval. Returned dates can be used for execution dates.
                                                                                          
                                                                                          
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 3349..3379

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 129.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def bag_dag(self, dag, parent_dag, root_dag):
                                                                                                  """
                                                                                                  Adds the DAG into the bag, recurses into sub dags.
                                                                                                  """
                                                                                                  self.dags[dag.dag_id] = dag
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.8/models.py on lines 354..370

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 128.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @staticmethod
                                                                                              @provide_session
                                                                                              def set_dirty(dag_id, session=None):
                                                                                                  """
                                                                                                  :param dag_id: the dag_id to mark dirty
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 4668..4690

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 126.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if include_subdags:
                                                                                                      # Crafting the right filter for dag_id and task_ids combo
                                                                                                      conditions = []
                                                                                                      for dag in self.subdags + [self]:
                                                                                                          conditions.append(
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 day to fix
                                                                                          airflowPatch1.10/models.py on lines 3767..3778
                                                                                          airflowPatch1.8/models.py on lines 3100..3110

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 124.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def render_templates(self):
                                                                                                  task = self.task
                                                                                                  jinja_context = self.get_template_context()
                                                                                                  if hasattr(self, 'task') and hasattr(self.task, 'dag'):
                                                                                                      if self.task.dag.user_defined_macros:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 7 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1915..1928
                                                                                          airflowPatch1.8/models.py on lines 1567..1580

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 121.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def __deepcopy__(self, memo):
                                                                                                  # Swiwtcharoo to go around deepcopying objects coming through the
                                                                                                  # backdoor
                                                                                                  cls = self.__class__
                                                                                                  result = cls.__new__(cls)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 7 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3880..3893

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 119.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if not runnable and not mark_success:
                                                                                                      # FIXME: we might have hit concurrency limits, which means we probably
                                                                                                      # have been running prematurely. This should be handled in the
                                                                                                      # scheduling mechanism.
                                                                                                      self.state = State.NONE
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 7 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1521..1536

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 119.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                          class DagPickle(Base):
                                                                                              """
                                                                                              Dags can originate from different places (user repos, master repo, ...)
                                                                                              and also get executed in different places (different executors). This
                                                                                              object represents a version of a DAG and becomes a source of truth for
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 7 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 682..705

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 116.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def create_dagrun(self,
                                                                                                                run_id,
                                                                                                                state,
                                                                                                                execution_date=None,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 7 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4117..4166

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 115.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def render_template(self, attr, content, context):
                                                                                                  """
                                                                                                  Renders a template either from a file or directly in a field, and returns
                                                                                                  the rendered result.
                                                                                                  """
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 7 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 2748..2763
                                                                                          airflowPatch1.8/models.py on lines 2232..2247

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 113.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @dag.setter
                                                                                              def dag(self, dag):
                                                                                                  """
                                                                                                  Operators can be assigned to one DAG, one time. Repeat assignments to
                                                                                                  that same DAG are ok.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 7 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 2584..2599
                                                                                          airflowPatch1.8/models.py on lines 2096..2111

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 110.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def __hash__(self):
                                                                                                  hash_components = [type(self)]
                                                                                                  for c in self._comps:
                                                                                                      # task_ids returns a list and lists can't be hashed
                                                                                                      if c == 'task_ids':
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 6 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3283..3296
                                                                                          airflowPatch1.8/models.py on lines 2716..2729

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 109.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def refresh_from_db(self, session=None):
                                                                                                  """
                                                                                                  Reloads the current dagrun from the database
                                                                                                  :param session: database session
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 6 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4830..4847
                                                                                          airflowPatch1.8/models.py on lines 3875..3892

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 109.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @classmethod
                                                                                              @provide_session
                                                                                              def get_latest_runs(cls, session):
                                                                                                  """Returns the latest DagRun for each DAG. """
                                                                                                  subquery = (
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 6 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 5134..5154

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 107.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @classmethod
                                                                                              @provide_session
                                                                                              def get(cls, key, default_var=None, deserialize_json=False, session=None):
                                                                                                  obj = session.query(cls).filter(cls.key == key).first()
                                                                                                  if obj is None:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 6 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4434..4447
                                                                                          airflowPatch1.8/models.py on lines 3590..3603

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 105.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def deactivate_inactive_dags(self):
                                                                                                  active_dag_ids = [dag.dag_id for dag in list(self.dags.values())]
                                                                                                  session = settings.Session()
                                                                                                  for dag in session.query(
                                                                                                          DagModel).filter(~DagModel.dag_id.in_(active_dag_ids)).all():
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 6 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 458..466

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 104.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def get_last_dagrun(self, session=None, include_externally_triggered=False):
                                                                                                  """
                                                                                                  Returns the last dag run for this dag, None if there was none.
                                                                                                  Last dag run can be any type of run eg. scheduled or backfilled.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 6 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3395..3413
                                                                                          airflowPatch1.8/models.py on lines 2781..2799

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 104.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                          class User(Base):
                                                                                              __tablename__ = "users"
                                                                                          
                                                                                              id = Column(Integer, primary_key=True)
                                                                                              username = Column(String(ID_LEN), unique=True)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 6 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 477..492

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 103.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def xcom_pull(
                                                                                                      self,
                                                                                                      task_ids,
                                                                                                      dag_id=None,
                                                                                                      key=XCOM_RETURN_KEY,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 6 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 1635..1684

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 101.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def get_template_env(self):
                                                                                                  """
                                                                                                  Returns a jinja2 Environment while taking into account the DAGs
                                                                                                  template_searchpath, user_defined_macros and user_defined_filters
                                                                                                  """
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 6 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3627..3645

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 101.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def run(
                                                                                                      self,
                                                                                                      start_date=None,
                                                                                                      end_date=None,
                                                                                                      ignore_first_depends_on_past=False,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 6 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 2884..2901
                                                                                          airflowPatch1.8/models.py on lines 2369..2386

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 100.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def get_task_instances(self, session, start_date=None, end_date=None):
                                                                                                  """
                                                                                                  Get a set of task instance related to this task for a specific date
                                                                                                  range.
                                                                                                  """
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 6 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 2845..2857
                                                                                          airflowPatch1.8/models.py on lines 2327..2339

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 100.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @staticmethod
                                                                                              @provide_session
                                                                                              def deactivate_stale_dags(expiration_date, session=None):
                                                                                                  """
                                                                                                  Deactivate any DAGs that were last touched by the scheduler before
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 6 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4222..4244

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 99.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def current_state(self, session=None):
                                                                                                  """
                                                                                                  Get the very latest state from the database, if a session is passed,
                                                                                                  we use and looking up the state becomes part of the session, otherwise
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 6 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1146..1163
                                                                                          airflowPatch1.8/models.py on lines 945..962

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 98.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def dagbag_report(self):
                                                                                                  """Prints a report around DagBag loading stats"""
                                                                                                  report = textwrap.dedent("""\n
                                                                                                  -------------------------------------------------------------------
                                                                                                  DagBag loading stats for {dag_folder}
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 6 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 551..568
                                                                                          airflowPatch1.8/models.py on lines 438..455

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 98.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def run(
                                                                                                      self,
                                                                                                      verbose=True,
                                                                                                      ignore_all_deps=False,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 5 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1694..1719

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 96.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def __init__(
                                                                                                      self, conn_id=None, conn_type=None,
                                                                                                      host=None, login=None, password=None,
                                                                                                      schema=None, port=None, extra=None,
                                                                                                      uri=None):
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 5 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 662..677
                                                                                          airflowPatch1.8/models.py on lines 541..556

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 95.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def get_num_active_runs(self, external_trigger=None, session=None):
                                                                                                  """
                                                                                                  Returns the number of active "running" dag runs
                                                                                          
                                                                                          
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 5 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3556..3574

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 95.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def pool_full(self, session):
                                                                                                  """
                                                                                                  Returns a boolean as to whether the slot pool has room for this
                                                                                                  task to run
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 5 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1402..1421
                                                                                          airflowPatch1.8/models.py on lines 1178..1197

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 93.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def get_failed_dep_statuses(
                                                                                                      self,
                                                                                                      dep_context=None,
                                                                                                      session=None):
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 5 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1338..1356

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 93.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              @provide_session
                                                                                              def concurrency_reached(self, session=None):
                                                                                                  """
                                                                                                  Returns a boolean indicating whether the concurrency limit for this DAG
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 5 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 2878..2891

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 92.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  try:
                                                                                                      if self.state == State.UP_FOR_RETRY and task.on_retry_callback:
                                                                                                          task.on_retry_callback(context)
                                                                                                      if self.state == State.FAILED and task.on_failure_callback:
                                                                                                          task.on_failure_callback(context)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 5 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1772..1779

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 91.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @classmethod
                                                                                              def setdefault(cls, key, default, deserialize_json=False):
                                                                                                  """
                                                                                                  Like a Python builtin dict object, setdefault returns the current value
                                                                                                  for a key, and if it isn't there, stores the default value and returns it.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 5 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4407..4432

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 90.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def db_merge(self):
                                                                                                  BO = BaseOperator
                                                                                                  session = settings.Session()
                                                                                                  tasks = session.query(BO).filter(BO.dag_id == self.dag_id).all()
                                                                                                  for t in tasks:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 5 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 3289..3297

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 89.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @classmethod
                                                                                              @provide_session
                                                                                              def set(cls, key, value, serialize_json=False, session=None):
                                                                                          
                                                                                                  if serialize_json:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 5 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 3605..3616

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 89.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  for m in mods:
                                                                                                      for dag in list(m.__dict__.values()):
                                                                                                          if isinstance(dag, DAG):
                                                                                                              if not dag.full_filepath:
                                                                                                                  dag.full_filepath = filepath
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 5 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 303..311

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 89.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  try:
                                                                                                      if not mark_success:
                                                                                                          context = self.get_template_context()
                                                                                          
                                                                                                          task_copy = copy.copy(task)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 5 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1602..1674

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 87.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def email_alert(self, exception, is_retry=False):
                                                                                                  task = self.task
                                                                                                  title = "Airflow alert: {self}".format(**locals())
                                                                                                  exception = str(exception).replace('\n', '<br>')
                                                                                                  # For reporting purposes, we report based on 1-indexed,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 5 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1930..1945

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 87.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def tree_view(self):
                                                                                                  """
                                                                                                  Shows an ascii tree representation of the DAG
                                                                                                  """
                                                                                                  def get_downstream(task, level=0):
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 4 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3968..3979
                                                                                          airflowPatch1.8/models.py on lines 3239..3250

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 85.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def __hash__(self):
                                                                                                  hash_components = [type(self)]
                                                                                                  for c in self._comps:
                                                                                                      val = getattr(self, c, None)
                                                                                                      try:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 4 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 2512..2521
                                                                                          airflowPatch1.8/models.py on lines 2024..2033

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 83.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                              try:
                                                                                                                  sys.path.insert(0, filepath)
                                                                                                                  m = importlib.import_module(mod_name)
                                                                                                                  mods.append(m)
                                                                                                              except Exception as e:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 4 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 396..403

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 83.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                      if safe_mode and os.path.isfile(filepath):
                                                                                                          with open(filepath, 'rb') as f:
                                                                                                              content = f.read()
                                                                                                              if not all([s in content for s in (b'DAG', b'airflow')]):
                                                                                                                  self.file_last_changed[filepath] = file_last_changed_on_disk
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 4 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 245..250

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 82.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if unfinished_tasks and none_depends_on_past and none_task_concurrency:
                                                                                                      # todo: this can actually get pretty slow: one task costs between 0.01-015s
                                                                                                      no_dependencies_met = True
                                                                                                      for ut in unfinished_tasks:
                                                                                                          # We need to flag upstream and check for changes because upstream
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 4 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 5009..5023

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 82.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def set_dag_runs_state(
                                                                                                      self, state=State.RUNNING, session=None):
                                                                                                  drs = session.query(DagModel).filter_by(dag_id=self.dag_id).all()
                                                                                                  dirty_ids = []
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 4 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 3075..3083

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 82.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @classmethod
                                                                                              @provide_session
                                                                                              def delete(cls, xcoms, session=None):
                                                                                                  if isinstance(xcoms, XCom):
                                                                                                      xcoms = [xcoms]
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 4 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4640..4651
                                                                                          airflowPatch1.8/models.py on lines 3749..3760

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 81.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def xcom_push(
                                                                                                      self,
                                                                                                      key,
                                                                                                      value,
                                                                                                      execution_date=None):
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 4 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1953..1983
                                                                                          airflowPatch1.8/models.py on lines 1603..1633

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 81.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @staticmethod
                                                                                              @provide_session
                                                                                              def deactivate_unknown_dags(active_dag_ids, session=None):
                                                                                                  """
                                                                                                  Given a list of known DAGs, deactivate any other DAGs that are
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 4 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4203..4220
                                                                                          airflowPatch1.8/models.py on lines 3426..3443

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 80.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def command(
                                                                                                      self,
                                                                                                      mark_success=False,
                                                                                                      ignore_all_deps=False,
                                                                                                      ignore_depends_on_past=False,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 4 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 952..970
                                                                                          airflowPatch1.8/models.py on lines 770..788

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 79.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def set_password(self, value):
                                                                                                  if value:
                                                                                                      try:
                                                                                                          fernet = get_fernet()
                                                                                                          self._password = fernet.encrypt(bytes(value, 'utf-8')).decode()
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 4 hrs to fix
                                                                                          airflowPatch1.9/models.py on lines 636..646
                                                                                          airflowPatch1.9/models.py on lines 3978..3989

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 79.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def set_val(self, value):
                                                                                                  if value:
                                                                                                      try:
                                                                                                          fernet = get_fernet()
                                                                                                          self._val = fernet.encrypt(bytes(value, 'utf-8')).decode()
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 4 hrs to fix
                                                                                          airflowPatch1.9/models.py on lines 607..617
                                                                                          airflowPatch1.9/models.py on lines 636..646

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 79.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def set_extra(self, value):
                                                                                                  if value:
                                                                                                      try:
                                                                                                          fernet = get_fernet()
                                                                                                          self._extra = fernet.encrypt(bytes(value, 'utf-8')).decode()
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 4 hrs to fix
                                                                                          airflowPatch1.9/models.py on lines 607..617
                                                                                          airflowPatch1.9/models.py on lines 3978..3989

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 79.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def subdags(self):
                                                                                                  """
                                                                                                  Returns a list of the subdag objects associated to this DAG
                                                                                                  """
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 4 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3606..3621

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 78.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def detect_downstream_cycle(self, task=None):
                                                                                                  """
                                                                                                  When invoked, this routine will raise an exception if a cycle is
                                                                                                  detected downstream from self. It is invoked when tasks are added to
                                                                                                  the DAG to detect cycles.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 4 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 2353..2367

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 78.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  tis = (
                                                                                                      session.query(TI)
                                                                                                      .join(LJ, TI.job_id == LJ.id)
                                                                                                      .filter(TI.state == State.RUNNING)
                                                                                                      .filter(
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 4 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 438..445
                                                                                          airflowPatch1.8/models.py on lines 330..337

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 77.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  try:
                                                                                                      # This failed before in what may have been a git sync
                                                                                                      # race condition
                                                                                                      file_last_changed_on_disk = datetime.fromtimestamp(os.path.getmtime(filepath))
                                                                                                      if only_if_updated \
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 4 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 324..335

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 77.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def latest_execution_date(self):
                                                                                                  """
                                                                                                  Returns the latest date for which at least one dag run exists
                                                                                                  """
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 4 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 2936..2947

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 76.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def get_flat_relatives(self, upstream=False, l=None):
                                                                                                  """
                                                                                                  Get a flat list of relatives, either upstream or downstream.
                                                                                                  """
                                                                                                  if not l:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 4 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 2341..2351

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 74.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def get_task_instance(self, task_id, session=None):
                                                                                                  """
                                                                                                  Returns the task instance specified by task_id for this dag run
                                                                                          
                                                                                          
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 4 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4926..4941
                                                                                          airflowPatch1.8/models.py on lines 3962..3976

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 74.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def dry_run(self):
                                                                                                  self.log.info('Dry run')
                                                                                                  for attr in self.template_fields:
                                                                                                      content = getattr(self, attr)
                                                                                                      if content and isinstance(content, six.string_types):
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 4 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 2904..2910

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 74.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def clear_xcom_data(self, session=None):
                                                                                                  """
                                                                                                  Clears all XCom data from the database for the task instance
                                                                                                  """
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1209..1219
                                                                                          airflowPatch1.8/models.py on lines 1004..1014

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 72.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def get_extra(self):
                                                                                                  if self._extra and self.is_extra_encrypted:
                                                                                                      try:
                                                                                                          fernet = get_fernet()
                                                                                                      except:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.9/models.py on lines 595..605

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 72.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def get_password(self):
                                                                                                  if self._password and self.is_encrypted:
                                                                                                      try:
                                                                                                          fernet = get_fernet()
                                                                                                      except:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.9/models.py on lines 624..634

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 72.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def extra_dejson(self):
                                                                                                  """Returns the extra property by deserializing json."""
                                                                                                  obj = {}
                                                                                                  if self.extra:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 805..816

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 72.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                      with timeout(configuration.getint('core', "DAGBAG_IMPORT_TIMEOUT")):
                                                                                                          try:
                                                                                                              m = imp.load_source(mod_name, filepath)
                                                                                                              mods.append(m)
                                                                                                          except Exception as e:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 361..368

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 72.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                          try:
                                                                                                              task_copy.post_execute(context=context, result=result)
                                                                                                          except TypeError as e:
                                                                                                              if 'unexpected keyword argument' in str(e):
                                                                                                                  warnings.warn(
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1640..1651

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 71.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if not self.start_date and not task.start_date:
                                                                                                      raise AirflowException("Task is missing the start_date parameter")
                                                                                                  # if the task has no start date, assign it the same as the DAG
                                                                                                  elif not task.start_date:
                                                                                                      task.start_date = self.start_date
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3988..3996

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 71.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def get_previous_scheduled_dagrun(self, session=None):
                                                                                                  """The previous, SCHEDULED DagRun, if there is one"""
                                                                                                  dag = self.get_dag()
                                                                                          
                                                                                          
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4966..4973
                                                                                          airflowPatch1.8/models.py on lines 4001..4008

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 69.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if task.task_id in self.task_dict:
                                                                                                      # TODO: raise an error in Airflow 2.0
                                                                                                      warnings.warn(
                                                                                                          'The requested task could not be added to the DAG because a '
                                                                                                          'task with task_id {} is already in the DAG. Starting in '
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 3264..3275

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 69.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def __eq__(self, other):
                                                                                                  return (
                                                                                                      type(self) == type(other) and
                                                                                                      all(self.__dict__.get(c, None) == other.__dict__.get(c, None)
                                                                                                          for c in self._comps))
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 2500..2504
                                                                                          airflowPatch1.8/models.py on lines 2012..2016

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 67.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def paused_dags(self):
                                                                                                  session = settings.Session()
                                                                                                  dag_ids = [dp.dag_id for dp in session.query(DagModel).filter(
                                                                                                      DagModel.is_paused.__eq__(True))]
                                                                                                  session.commit()
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 468..474

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 67.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                          if task_copy.execution_timeout:
                                                                                                              try:
                                                                                                                  with timeout(int(
                                                                                                                          task_copy.execution_timeout.total_seconds())):
                                                                                                                      result = task_copy.execute(context=context)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1624..1633
                                                                                          airflowPatch1.8/models.py on lines 1365..1374

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 66.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def get_previous_dagrun(self, session=None):
                                                                                                  """The previous DagRun, if there is one"""
                                                                                          
                                                                                                  return session.query(DagRun).filter(
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4955..4963
                                                                                          airflowPatch1.8/models.py on lines 3990..3998

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 66.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  tis = session.query(TI).filter(
                                                                                                      TI.dag_id == self.dag_id,
                                                                                                      TI.execution_date >= start_date,
                                                                                                      TI.execution_date <= end_date,
                                                                                                      TI.task_id.in_([t.task_id for t in self.tasks]),
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3663..3667
                                                                                          airflowPatch1.8/models.py on lines 3010..3014

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 66.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def get_num_running_task_instances(self, session):
                                                                                                  TI = TaskInstance
                                                                                                  return session.query(TI).filter(
                                                                                                      TI.dag_id == self.dag_id,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 2036..2042

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 65.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                      if task.retries and self.try_number <= self.max_tries:
                                                                                                          self.state = State.UP_FOR_RETRY
                                                                                                          self.log.info('Marking task as UP_FOR_RETRY')
                                                                                                          if task.email_on_retry and task.email:
                                                                                                              self.email_alert(error, is_retry=True)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1754..1766

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 65.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                          Open

                                                                                              def __rshift__(self, other):
                                                                                                  """
                                                                                                  Implements Self >> Other == self.set_downstream(other)
                                                                                          
                                                                                                  If "Other" is a DAG, the DAG is assigned to the Operator.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 5 other locations - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 2525..2538
                                                                                          airflowPatch1.10/models.py on lines 2540..2553
                                                                                          airflowPatch1.8/models.py on lines 2037..2050
                                                                                          airflowPatch1.8/models.py on lines 2052..2065
                                                                                          airflowPatch1.9/models.py on lines 2287..2300

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 64.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                          Open

                                                                                              def __lshift__(self, other):
                                                                                                  """
                                                                                                  Implements Self << Other == self.set_upstream(other)
                                                                                          
                                                                                                  If "Other" is a DAG, the DAG is assigned to the Operator.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 5 other locations - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 2525..2538
                                                                                          airflowPatch1.10/models.py on lines 2540..2553
                                                                                          airflowPatch1.8/models.py on lines 2037..2050
                                                                                          airflowPatch1.8/models.py on lines 2052..2065
                                                                                          airflowPatch1.9/models.py on lines 2272..2285

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 64.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def previous_schedule(self, dttm):
                                                                                                  if isinstance(self._schedule_interval, six.string_types):
                                                                                                      cron = croniter(self._schedule_interval, dttm)
                                                                                                      return cron.get_prev(datetime)
                                                                                                  elif isinstance(self._schedule_interval, timedelta):
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 2759..2764

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 64.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def following_schedule(self, dttm):
                                                                                                  if isinstance(self._schedule_interval, six.string_types):
                                                                                                      cron = croniter(self._schedule_interval, dttm)
                                                                                                      return cron.get_next(datetime)
                                                                                                  elif isinstance(self._schedule_interval, timedelta):
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 2752..2757

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 64.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @staticmethod
                                                                                              def get_run(session, dag_id, execution_date):
                                                                                                  """
                                                                                                  :param dag_id: DAG ID
                                                                                                  :type dag_id: unicode
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 5111..5127
                                                                                          airflowPatch1.8/models.py on lines 4139..4155

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 63.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                          if ignore_file:
                                                                                                              f = open(os.path.join(root, ignore_file[0]), 'r')
                                                                                                              patterns += [p for p in f.read().split('\n') if p]
                                                                                                              f.close()
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 398..401

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 63.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if verbose:
                                                                                                      if mark_success:
                                                                                                          msg = "Marking success for {} on {}".format(self.task, self.execution_date)
                                                                                                          self.log.info(msg)
                                                                                                      else:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1562..1569

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 63.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def filepath(self):
                                                                                                  """
                                                                                                  File location of where the dag object is instantiated
                                                                                                  """
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3472..3479
                                                                                          airflowPatch1.8/models.py on lines 2858..2865

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 62.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def set_state(self, state):
                                                                                                  if self._state != state:
                                                                                                      self._state = state
                                                                                                      if self.dag_id is not None:
                                                                                                          # something really weird goes on here: if you try to close the session
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 3 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4811..4819

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 62.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def __eq__(self, other):
                                                                                                  return (
                                                                                                      type(self) == type(other) and
                                                                                                      # Use getattr() instead of __dict__ as __dict__ doesn't return
                                                                                                      # correct values for properties.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 2 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3269..3275
                                                                                          airflowPatch1.8/models.py on lines 2702..2708

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 61.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                      if enable_pickling:
                                                                                                          return pickle.loads(result.value)
                                                                                                      else:
                                                                                                          try:
                                                                                                              return json.loads(result.value.decode('UTF-8'))
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4593..4604

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 59.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if enable_pickling:
                                                                                                      value = pickle.dumps(value)
                                                                                                  else:
                                                                                                      try:
                                                                                                          value = json.dumps(value).encode('UTF-8')
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4527..4538

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 59.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def get_active_runs(self, session=None):
                                                                                                  """
                                                                                                  Returns a list of dag run execution dates currently running
                                                                                          
                                                                                          
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 2 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3540..3554
                                                                                          airflowPatch1.8/models.py on lines 2903..2916

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 59.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def get_dagrun(self, execution_date, session=None):
                                                                                                  """
                                                                                                  Returns the dag run for a given execution date if it exists, otherwise
                                                                                                  none.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 2 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3576..3593
                                                                                          airflowPatch1.8/models.py on lines 2918..2934

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 58.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def get_dagrun(self, session):
                                                                                                  """
                                                                                                  Returns the DagRun for this TaskInstance
                                                                                          
                                                                                          
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 2 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1423..1436
                                                                                          airflowPatch1.8/models.py on lines 1199..1211

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 57.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def append_only_new(self, l, item):
                                                                                                  if any([item is t for t in l]):
                                                                                                      raise AirflowException(
                                                                                                          'Dependency {self}, {item} already registered'
                                                                                                          ''.format(**locals()))
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 2415..2421

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 55.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def normalize_schedule(self, dttm):
                                                                                                  """
                                                                                                  Returns dttm + interval unless dttm is first interval then it returns dttm
                                                                                                  """
                                                                                                  following = self.following_schedule(dttm)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 2 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3381..3393
                                                                                          airflowPatch1.8/models.py on lines 2766..2779

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 54.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  session.query(cls).filter(
                                                                                                      cls.key == key,
                                                                                                      cls.execution_date == execution_date,
                                                                                                      cls.task_id == task_id,
                                                                                                      cls.dag_id == dag_id).delete()
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 2 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 4541..4545
                                                                                          airflowPatch1.8/models.py on lines 3662..3666

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 54.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if confirm_prompt:
                                                                                                      ti_list = "\n".join([str(t) for t in tis])
                                                                                                      question = (
                                                                                                          "You are about to delete these {count} tasks:\n"
                                                                                                          "{ti_list}\n\n"
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 2 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3798..3804
                                                                                          airflowPatch1.8/models.py on lines 3131..3137

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 53.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def set_state(self, state, session):
                                                                                                  self.state = state
                                                                                                  self.start_date = datetime.utcnow()
                                                                                                  self.end_date = datetime.utcnow()
                                                                                                  session.merge(self)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 1023..1028

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 53.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                          class ImportError(Base):
                                                                                              __tablename__ = "import_error"
                                                                                              id = Column(Integer, primary_key=True)
                                                                                              timestamp = Column(DateTime)
                                                                                              filename = Column(String(1024))
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 2 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 5234..5239
                                                                                          airflowPatch1.8/models.py on lines 4234..4239

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 53.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              @provide_session
                                                                                              def is_paused(self, session=None):
                                                                                                  """
                                                                                                  Returns a boolean indicating whether this DAG is paused
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 2 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 3506..3514
                                                                                          airflowPatch1.8/models.py on lines 2893..2901

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 51.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @provide_session
                                                                                              def error(self, session=None):
                                                                                                  """
                                                                                                  Forces the task instance's state to FAILED in the database.
                                                                                                  """
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 hrs to fix
                                                                                          airflowPatch1.10/models.py on lines 1165..1173

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 50.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def log_filepath(self):
                                                                                                  iso = self.execution_date.isoformat()
                                                                                                  log = os.path.expanduser(configuration.get('core', 'BASE_LOG_FOLDER'))
                                                                                                  return (
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 2 hrs to fix
                                                                                          airflowPatch1.8/models.py on lines 913..918

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 50.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  for ti in list(tis):
                                                                                                      # skip in db?
                                                                                                      if ti.state == State.REMOVED:
                                                                                                          tis.remove(ti)
                                                                                                      else:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 4991..4996
                                                                                          airflowPatch1.8/models.py on lines 4026..4031

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 49.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  qry = session.query(TI).filter(
                                                                                                      TI.dag_id == self.dag_id,
                                                                                                      TI.task_id == self.task_id,
                                                                                                      TI.execution_date == self.execution_date)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 1186..1189
                                                                                          airflowPatch1.8/models.py on lines 985..988

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 49.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if schedule_interval in cron_presets:
                                                                                                      self._schedule_interval = cron_presets.get(schedule_interval)
                                                                                                  elif schedule_interval == '@once':
                                                                                                      self._schedule_interval = None
                                                                                                  else:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 3231..3236
                                                                                          airflowPatch1.8/models.py on lines 2668..2673

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 49.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if not start_date:
                                                                                                      start_date = (datetime.utcnow() - timedelta(30)).date()
                                                                                                      start_date = datetime.combine(start_date, datetime.min.time())
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 hr to fix
                                                                                          airflowPatch1.8/models.py on lines 3006..3008

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 49.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if not task.end_date:
                                                                                                      task.end_date = self.end_date
                                                                                                  # otherwise, the task will end on the earlier of its own end date and
                                                                                                  # the DAG's end date
                                                                                                  elif task.end_date and self.end_date:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 3999..4004

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 49.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def set_duration(self):
                                                                                                  if self.end_date and self.start_date:
                                                                                                      self.duration = (self.end_date - self.start_date).total_seconds()
                                                                                                  else:
                                                                                                      self.duration = None
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 1947..1951
                                                                                          airflowPatch1.8/models.py on lines 1597..1601

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 48.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def mark_success_url(self):
                                                                                                  iso = self.execution_date.isoformat()
                                                                                                  BASE_URL = configuration.get('webserver', 'BASE_URL')
                                                                                                  return BASE_URL + (
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 3 other locations - About 1 hr to fix
                                                                                          airflowPatch1.8/models.py on lines 920..929
                                                                                          airflowPatch1.8/models.py on lines 931..943
                                                                                          airflowPatch1.9/models.py on lines 986..995

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 48.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def log_url(self):
                                                                                                  iso = self.execution_date.isoformat()
                                                                                                  BASE_URL = configuration.get('webserver', 'BASE_URL')
                                                                                                  return BASE_URL + (
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 3 other locations - About 1 hr to fix
                                                                                          airflowPatch1.8/models.py on lines 920..929
                                                                                          airflowPatch1.8/models.py on lines 931..943
                                                                                          airflowPatch1.9/models.py on lines 997..1009

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 48.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  query = (
                                                                                                      session.query(cls)
                                                                                                          .filter(and_(*filters))
                                                                                                          .order_by(cls.execution_date.desc(), cls.timestamp.desc())
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 4633..4635
                                                                                          airflowPatch1.8/models.py on lines 3741..3744

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 46.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def cli(self):
                                                                                                  """
                                                                                                  Exposes a CLI specific to this DAG
                                                                                                  """
                                                                                                  from airflow.bin import cli
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 4108..4115
                                                                                          airflowPatch1.8/models.py on lines 3332..3339

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 46.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                          class KnownEventType(Base):
                                                                                              __tablename__ = "known_event_type"
                                                                                          
                                                                                              id = Column(Integer, primary_key=True)
                                                                                              know_event_type = Column(String(200))
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 4336..4343
                                                                                          airflowPatch1.8/models.py on lines 3494..3501

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 46.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if self.state == State.RUNNING:
                                                                                                      msg = "Task Instance already running {}".format(self)
                                                                                                      self.log.warning(msg)
                                                                                                      session.commit()
                                                                                                      return False
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 1540..1544

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 46.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  try:
                                                                                                      if task.on_success_callback:
                                                                                                          task.on_success_callback(context)
                                                                                                  except Exception as e3:
                                                                                                      self.log.error("Failed when executing success callback")
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 1685..1690

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 46.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def get_task(self, task_id):
                                                                                                  if task_id in self.task_dict:
                                                                                                      return self.task_dict[task_id]
                                                                                                  raise AirflowException("Task {task_id} not found".format(**locals()))
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 3931..3934
                                                                                          airflowPatch1.8/models.py on lines 3202..3205

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 45.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def dry_run(self):
                                                                                                  task = self.task
                                                                                                  task_copy = copy.copy(task)
                                                                                                  self.task = task_copy
                                                                                          
                                                                                          
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 1726..1732
                                                                                          airflowPatch1.8/models.py on lines 1408..1414

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 45.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def date_range(self, start_date, num=None, end_date=datetime.utcnow()):
                                                                                                  if num:
                                                                                                      end_date = None
                                                                                                  return utils_date_range(
                                                                                                      start_date=start_date, end_date=end_date,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 3312..3317
                                                                                          airflowPatch1.8/models.py on lines 2745..2750

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 45.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def xcom_pull(
                                                                                                      self,
                                                                                                      context,
                                                                                                      task_ids,
                                                                                                      dag_id=None,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 hr to fix
                                                                                          airflowPatch1.8/models.py on lines 2494..2504

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 44.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if 'params' in self.default_args:
                                                                                                      self.params.update(self.default_args['params'])
                                                                                                      del self.default_args['params']
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 3188..3190
                                                                                          airflowPatch1.8/models.py on lines 2649..2651

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 42.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  query = (
                                                                                                      session.query(cls.value)
                                                                                                          .filter(and_(*filters))
                                                                                                          .order_by(cls.execution_date.desc(), cls.timestamp.desc()))
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 4586..4588

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 42.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if not TriggerRule.is_valid(trigger_rule):
                                                                                                      raise AirflowException(
                                                                                                          "The trigger_rule must be one of {all_triggers},"
                                                                                                          "'{d}.{t}'; received '{tr}'."
                                                                                                          .format(all_triggers=TriggerRule.all_triggers,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 hr to fix
                                                                                          airflowPatch1.8/models.py on lines 1941..1946

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 42.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def ready_for_retry(self):
                                                                                                  """
                                                                                                  Checks on whether the task instance is in the right state and timeframe
                                                                                                  to be retried.
                                                                                                  """
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 1394..1400
                                                                                          airflowPatch1.8/models.py on lines 1170..1176

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 41.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              def __init__(self, dag_id, state, count=0, dirty=False):
                                                                                                  self.dag_id = dag_id
                                                                                                  self.state = state
                                                                                                  self.count = count
                                                                                                  self.dirty = dirty
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 4662..4666

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 41.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def priority_weight_total(self):
                                                                                                  return sum([
                                                                                                      t.priority_weight
                                                                                                      for t in self.get_flat_relatives(upstream=False)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 hr to fix
                                                                                          airflowPatch1.8/models.py on lines 2151..2156

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 41.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if isinstance(retry_delay, timedelta):
                                                                                                      self.retry_delay = retry_delay
                                                                                                  else:
                                                                                                      self.log.debug("Retry_delay isn't timedelta object, assuming secs")
                                                                                                      self.retry_delay = timedelta(seconds=retry_delay)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 2423..2427

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 41.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def try_number(self):
                                                                                                  """
                                                                                                  Return the try number that this task number will be when it is acutally
                                                                                                  run.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 930..942

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 41.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if args or kwargs:
                                                                                                      # TODO remove *args and **kwargs in Airflow 2.0
                                                                                                      warnings.warn(
                                                                                                          'Invalid arguments were passed to {c}. Support for '
                                                                                                          'passing such arguments will be dropped in Airflow 2.0. '
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 2373..2380
                                                                                          airflowPatch1.8/models.py on lines 1919..1926

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 40.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def active_task_ids(self):
                                                                                                  return list(k for k, v in self.task_dict.items() if not v.adhoc)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 3464..3466
                                                                                          airflowPatch1.8/models.py on lines 2850..2852

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 40.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 6 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if include_prior_dates:
                                                                                                      filters.append(cls.execution_date <= execution_date)
                                                                                                  else:
                                                                                                      filters.append(cls.execution_date == execution_date)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 5 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 4581..4584
                                                                                          airflowPatch1.10/models.py on lines 4628..4631
                                                                                          airflowPatch1.8/models.py on lines 3700..3703
                                                                                          airflowPatch1.8/models.py on lines 3736..3739
                                                                                          airflowPatch1.9/models.py on lines 4159..4162

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 39.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 6 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if include_prior_dates:
                                                                                                      filters.append(cls.execution_date <= execution_date)
                                                                                                  else:
                                                                                                      filters.append(cls.execution_date == execution_date)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 5 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 4581..4584
                                                                                          airflowPatch1.10/models.py on lines 4628..4631
                                                                                          airflowPatch1.8/models.py on lines 3700..3703
                                                                                          airflowPatch1.8/models.py on lines 3736..3739
                                                                                          airflowPatch1.9/models.py on lines 4210..4213

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 39.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if not ignore_all_deps and not ignore_ti_state and self.state == State.SUCCESS:
                                                                                                      Stats.incr('previously_succeeded', 1, 1)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 1483..1484
                                                                                          airflowPatch1.8/models.py on lines 1254..1255

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 39.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                      mod_name = ('unusual_prefix_' +
                                                                                                                  hashlib.sha1(filepath.encode('utf-8')).hexdigest() +
                                                                                                                  '_' + org_mod_name)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 354..356
                                                                                          airflowPatch1.8/models.py on lines 254..256

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 39.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def xcom_push(
                                                                                                      self,
                                                                                                      context,
                                                                                                      key,
                                                                                                      value,
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 3003..3012
                                                                                          airflowPatch1.8/models.py on lines 2480..2489

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 38.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def dag(self):
                                                                                                  """
                                                                                                  Returns the Operator's DAG if set, otherwise raises an error
                                                                                                  """
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 1 hr to fix
                                                                                          airflowPatch1.10/models.py on lines 2573..2582
                                                                                          airflowPatch1.8/models.py on lines 2085..2094

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 38.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def is_premature(self):
                                                                                                  """
                                                                                                  Returns whether a task is in UP_FOR_RETRY state and its retry interval
                                                                                                  has elapsed.
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 55 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 1236..1243
                                                                                          airflowPatch1.8/models.py on lines 1030..1037

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 37.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def owner(self):
                                                                                                  return ", ".join(list(set([t.owner for t in self.tasks])))
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 55 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 3488..3490
                                                                                          airflowPatch1.8/models.py on lines 2874..2876

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 37.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def get_dag(self):
                                                                                                  """
                                                                                                  Returns the Dag associated with this DagRun.
                                                                                          
                                                                                                  :return: DAG
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 55 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 4943..4953
                                                                                          airflowPatch1.8/models.py on lines 3978..3988

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 37.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                          Open

                                                                                                      if (not unfinished_tasks and
                                                                                                              any(r.state in (State.FAILED, State.UPSTREAM_FAILED) for r in roots)):
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 4 other locations - About 55 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 5034..5035
                                                                                          airflowPatch1.10/models.py on lines 5042..5042
                                                                                          airflowPatch1.8/models.py on lines 4062..4063
                                                                                          airflowPatch1.9/models.py on lines 4635..4635

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 37.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 5 locations. Consider refactoring.
                                                                                          Open

                                                                                                      elif not unfinished_tasks and all(r.state in (State.SUCCESS, State.SKIPPED)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 4 other locations - About 55 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 5034..5035
                                                                                          airflowPatch1.10/models.py on lines 5042..5042
                                                                                          airflowPatch1.8/models.py on lines 4062..4063
                                                                                          airflowPatch1.9/models.py on lines 4629..4630

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 37.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                              __table_args__ = (
                                                                                                  Index('ti_dag_state', dag_id, state),
                                                                                                  Index('ti_state', state),
                                                                                                  Index('ti_state_lkp', dag_id, task_id, execution_date, state),
                                                                                                  Index('ti_pool', pool, state, priority_weight),
                                                                                          Severity: Minor
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 50 mins to fix
                                                                                          airflowPatch1.8/models.py on lines 742..746

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 36.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if not executor and local:
                                                                                                      executor = LocalExecutor()
                                                                                                  elif not executor:
                                                                                                      executor = GetDefaultExecutor()
                                                                                          Severity: Minor
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 50 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 4087..4090

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 36.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def dag_id(self):
                                                                                                  if self.has_dag():
                                                                                                      return self.dag.dag_id
                                                                                                  else:
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 45 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 2607..2612
                                                                                          airflowPatch1.8/models.py on lines 2119..2124

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 35.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if include_examples:
                                                                                                      example_dag_folder = os.path.join(
                                                                                                          os.path.dirname(__file__),
                                                                                                          'example_dags')
                                                                                                      self.collect_dags(example_dag_folder)
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 45 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 267..271
                                                                                          airflowPatch1.8/models.py on lines 175..179

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 35.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def __repr__(self):
                                                                                                  return (
                                                                                                      '<DagRun {dag_id} @ {execution_date}: {run_id}, '
                                                                                                      'externally triggered: {external_trigger}>'
                                                                                                  ).format(
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 40 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 4798..4806
                                                                                          airflowPatch1.8/models.py on lines 3845..3853

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 34.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if not test_mode:
                                                                                                      session.add(Log(self.state, self))
                                                                                                      session.merge(self)
                                                                                          Severity: Minor
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 35 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 1679..1681
                                                                                          airflowPatch1.8/models.py on lines 1393..1395

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 33.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def schedule_interval(self):
                                                                                                  """
                                                                                                  The schedule interval of the DAG always wins over individual tasks so
                                                                                                  that tasks within a DAG always line up. The task still needs a
                                                                                          Severity: Minor
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 30 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 2627..2637
                                                                                          airflowPatch1.8/models.py on lines 2139..2149

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 32.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def upstream_list(self):
                                                                                                  """@property: list of tasks directly upstream"""
                                                                                                  return [self.dag.get_task(tid) for tid in self._upstream_task_ids]
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 5 other locations - About 30 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 2788..2791
                                                                                          airflowPatch1.10/models.py on lines 2797..2800
                                                                                          airflowPatch1.8/models.py on lines 2272..2275
                                                                                          airflowPatch1.8/models.py on lines 2281..2284
                                                                                          airflowPatch1.9/models.py on lines 2518..2521

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 32.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                          Open

                                                                                              def set_dependency(self, upstream_task_id, downstream_task_id):
                                                                                                  """
                                                                                                  Simple utility method to set dependency between two tasks that
                                                                                                  already have been added to the DAG using add_task()
                                                                                                  """
                                                                                          Severity: Minor
                                                                                          Found in airflowPatch1.9/models.py and 2 other locations - About 30 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 3647..3653
                                                                                          airflowPatch1.8/models.py on lines 2995..3001

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 32.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                          Open

                                                                                              @property
                                                                                              def downstream_list(self):
                                                                                                  """@property: list of tasks directly downstream"""
                                                                                                  return [self.dag.get_task(tid) for tid in self._downstream_task_ids]
                                                                                          Severity: Major
                                                                                          Found in airflowPatch1.9/models.py and 5 other locations - About 30 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 2788..2791
                                                                                          airflowPatch1.10/models.py on lines 2797..2800
                                                                                          airflowPatch1.8/models.py on lines 2272..2275
                                                                                          airflowPatch1.8/models.py on lines 2281..2284
                                                                                          airflowPatch1.9/models.py on lines 2509..2512

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 32.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                          Open

                                                                                                  if not self.are_dependencies_met(
                                                                                                          dep_context=queue_dep_context,
                                                                                                          session=session,
                                                                                                          verbose=True):
                                                                                                      session.commit()
                                                                                          Severity: Minor
                                                                                          Found in airflowPatch1.9/models.py and 1 other location - About 30 mins to fix
                                                                                          airflowPatch1.10/models.py on lines 1492..1497

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 32.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

                                                                                          There are no issues that match your filters.

                                                                                          Category
                                                                                          Status