abhioncbr/docker-airflow

View on GitHub

Showing 312 of 1,025 total issues

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

    def handle_failure(self, error, test_mode=False, context=None, session=None):
        self.log.exception(error)
        task = self.task
        self.end_date = timezone.utcnow()
        self.set_duration()
Severity: Minor
Found in airflowPatch1.10/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 index has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def index(self):
        session = Session()
        DM = models.DagModel
        qry = None

Severity: Minor
Found in airflowPatch1.8/views.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 16 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

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

      Function duration has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def duration(self):
              session = settings.Session()
              dag_id = request.args.get('dag_id')
              dag = dagbag.get_dag(dag_id)
              base_date = request.args.get('base_date')
      Severity: Minor
      Found in airflowPatch1.9/views.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 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 upgrade has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      def upgrade():
          conn = op.get_bind()
          inspector = Inspector.from_engine(conn)
          tables = inspector.get_table_names()
      
      
      Severity: Minor
      Found in airflowPatch1.9/e3a246e0dc1_current_schema.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 upgrade has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      def upgrade():
          conn = op.get_bind()
          inspector = Inspector.from_engine(conn)
          tables = inspector.get_table_names()
      
      
      Severity: Minor
      Found in airflowPatch1.10/e3a246e0dc1_current_schema.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 duration has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def duration(self, session=None):
              default_dag_run = conf.getint('webserver', 'default_dag_run_display_number')
              dag_id = request.args.get('dag_id')
              dag = dagbag.get_dag(dag_id)
              base_date = request.args.get('base_date')
      Severity: Minor
      Found in airflowPatch1.10/views.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 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.10/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 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.8/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 15 (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.10/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 upgrade has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      def upgrade():
          conn = op.get_bind()
          inspector = Inspector.from_engine(conn)
          tables = inspector.get_table_names()
      
      
      Severity: Minor
      Found in airflowPatch1.8/e3a246e0dc1_current_schema.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 generate_command has 14 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

          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.8/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

          Severity
          Category
          Status
          Source
          Language