SpamExperts/OrangeAssassin

View on GitHub
oa/plugins/header_eval.py

Summary

Maintainability
F
1 wk
Test Coverage

File header_eval.py has 728 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Expose some eval rules that do checks on the headers."""

from __future__ import absolute_import
from __future__ import division

Severity: Major
Found in oa/plugins/header_eval.py - About 1 day to fix

    HeaderEval has 37 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class HeaderEval(oa.plugins.base.BasePlugin):
        hotmail_addr_with_forged_hotmail_received = 0
        hotmail_addr_but_no_hotmail_received = 0
        tocc_sorted_count = 7
        tocc_similar_count = 5
    Severity: Minor
    Found in oa/plugins/header_eval.py - About 4 hrs to fix

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

          def check_illegal_chars(self, msg, header, ratio, count, target=None):
              """look for 8-bit and other illegal characters that should be MIME
              encoded, these might want to exempt languages that do not use
              Latin-based alphabets, but only if the user wants it that way
              """
      Severity: Minor
      Found in oa/plugins/header_eval.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

      Cyclomatic complexity is too high in method check_illegal_chars. (19)
      Open

          def check_illegal_chars(self, msg, header, ratio, count, target=None):
              """look for 8-bit and other illegal characters that should be MIME
              encoded, these might want to exempt languages that do not use
              Latin-based alphabets, but only if the user wants it that way
              """
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Function check_for_to_in_subject has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_for_to_in_subject(self, msg, test, target=None):
              """
              Check if to address is in Subject field.
      
              If it is called with 'address', check if full address is in subject,
      Severity: Minor
      Found in oa/plugins/header_eval.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

      Cyclomatic complexity is too high in method check_for_forged_yahoo_received_headers. (15)
      Open

          def check_for_forged_yahoo_received_headers(self, msg, target=None):
              """Check for forged yahoo received headers"""
              from_addr = ''.join(msg.get_all_addr_header("From"))
              rcvd = ''.join(msg.get_decoded_header("Received"))
              if "yahoo.com" not in from_addr:
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method received_within_months. (12)
      Open

          def received_within_months(self, msg, min, max, target=None):
              """Check if the date from received is in past"""
              if min == "undef":
                  min = None
              if max == "undef":
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method check_for_forged_juno_received_headers. (11)
      Open

          def check_for_forged_juno_received_headers(self, msg, target=None):
              from_addr = ''.join(msg.get_all_addr_header("From"))
              if not from_addr.rsplit("@", 1)[-1].endswith("juno.com"):
                  return False
              if self.gated_through_received_hdr_remover(msg):
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method _check_for_forged_hotmail_received_headers. (11)
      Open

          def _check_for_forged_hotmail_received_headers(self, msg):
              self.hotmail_addr_but_no_hotmail_received = 0
              self.hotmail_addr_with_forged_hotmail_received = 0
              rcvd = msg.msg.get("Received")
              if not rcvd:
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method _check_recipients. (11)
      Open

          def _check_recipients(self, msg):
              """Check for similar recipients addresses.
      
              Return the ratio of possibly similar recipient of
              the total number of possible combinations.
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method check_for_to_in_subject. (11)
      Open

          def check_for_to_in_subject(self, msg, test, target=None):
              """
              Check if to address is in Subject field.
      
              If it is called with 'address', check if full address is in subject,
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method check_for_shifted_date. (10)
      Open

          def check_for_shifted_date(self, msg, min=None, max=None, target=None):
              """Check if the difference between Date header and date from received
              headers its between min,max interval
      
              * min: minimum time express in hours
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method check_for_msn_groups_headers. (9)
      Open

          def check_for_msn_groups_headers(self, msg, target=None):
              """Check if the email's destination is a msn group"""
              to = ''.join(msg.get_decoded_header('To'))
              if not Regex(r"<(\S+)\@groups\.msn\.com>").search(to):
                  return False
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method check_for_faraway_charset_in_headers. (8)
      Open

          def check_for_faraway_charset_in_headers(self, msg, target=None):
              """Check if the Subject/From header is in a NOT ok locale.
      
              This eval rule requires the ok_locales setting configured,
              and not set to ALL.
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method check_ratware_envelope_from. (7)
      Open

          def check_ratware_envelope_from(self, msg, target=None):
              """Check if envelope-from address is ratware or not."""
              to_header = msg.msg.get("To")
              envelope_from = msg.sender_address
              if not to_header or not envelope_from:
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method check_for_forged_gw05_received_headers. (7)
      Open

          def check_for_forged_gw05_received_headers(self, msg, target=None):
              gw05_re = Regex(r"from\s(\S+)\sby\s(\S+)\swith\sESMTP\;\s+\S\S\S,"
                              r"\s+\d+\s+\S\S\S\s+\d{4}\s+\d\d:\d\d:\d\d\s+[-+]*"
                              r"\d{4}", re.X | re.I)
              for rcv in msg.get_decoded_header("Received"):
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method check_for_forged_eudoramail_received_headers. (7)
      Open

          def check_for_forged_eudoramail_received_headers(self, msg, target=None):
              """Check if the email has forged eudoramail received header"""
              from_addr = ''.join(msg.get_all_addr_header("From"))
              if from_addr.rsplit("@", 1)[-1] != "eudoramail.com":
                  return False
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

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

          def check_for_faraway_charset_in_headers(self, msg, target=None):
              """Check if the Subject/From header is in a NOT ok locale.
      
              This eval rule requires the ok_locales setting configured,
              and not set to ALL.
      Severity: Minor
      Found in oa/plugins/header_eval.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_for_forged_yahoo_received_headers has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_for_forged_yahoo_received_headers(self, msg, target=None):
              """Check for forged yahoo received headers"""
              from_addr = ''.join(msg.get_all_addr_header("From"))
              rcvd = ''.join(msg.get_decoded_header("Received"))
              if "yahoo.com" not in from_addr:
      Severity: Minor
      Found in oa/plugins/header_eval.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

      Cyclomatic complexity is too high in method _get_received_header_times. (6)
      Open

          def _get_received_header_times(self, msg):
              try:
                  return self.get_local(msg, "received_header_times")
              except KeyError:
                  pass
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method check_equal_from_domains. (6)
      Open

          def check_equal_from_domains(self, msg, target=None):
              """Check if the domain from `From` header and `EnvelopeFrom` header
              are different."""
              from_addr = ''.join(msg.get_all_addr_header("From"))
              envfrom = msg.sender_address
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method gated_through_received_hdr_remover. (6)
      Open

          def gated_through_received_hdr_remover(self, msg, target=None):
              """Check if the email is gated through ezmlm"""
              txt = ''.join(msg.get_decoded_header("Mailing-List"))
              rcvd = ''.join(msg.get_decoded_header("Received"))
              if Regex(r"^contact \S+\@\S+\; run by ezmlm$").search(txt):
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method check_messageid_not_usable. (6)
      Open

          def check_messageid_not_usable(self, msg, target=None):
              list_unsubscribe = msg.msg.get("List-Unsubscribe")
              if list_unsubscribe:
                  if Regex(r"<mailto:(?:leave-\S+|\S+-unsubscribe)\@\S+>$").search(
                          list_unsubscribe):
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in class HeaderEval. (6)
      Open

      class HeaderEval(oa.plugins.base.BasePlugin):
          hotmail_addr_with_forged_hotmail_received = 0
          hotmail_addr_but_no_hotmail_received = 0
          tocc_sorted_count = 7
          tocc_similar_count = 5
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method _get_date_header_time. (6)
      Open

          def _get_date_header_time(self, msg):
              try:
                  return self.get_local(msg, "date_header_time")
              except KeyError:
                  pass
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Cyclomatic complexity is too high in method check_for_unique_subject_id. (6)
      Open

          def check_for_unique_subject_id(self, msg, target=None):
              """Check if in subject appears an unique id"""
              subject = "".join(msg.get_decoded_header("Subject"))
              id = None
              unique_id_re_list = [
      Severity: Minor
      Found in oa/plugins/header_eval.py by radon

      Cyclomatic Complexity

      Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

      Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

      Construct Effect on CC Reasoning
      if +1 An if statement is a single decision.
      elif +1 The elif statement adds another decision.
      else +0 The else statement does not cause a new decision. The decision is at the if.
      for +1 There is a decision at the start of the loop.
      while +1 There is a decision at the while statement.
      except +1 Each except branch adds a new conditional path of execution.
      finally +0 The finally block is unconditionally executed.
      with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
      assert +1 The assert statement internally roughly equals a conditional statement.
      Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
      Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

      Source: http://radon.readthedocs.org/en/latest/intro.html

      Function _check_for_forged_hotmail_received_headers has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def _check_for_forged_hotmail_received_headers(self, msg):
              self.hotmail_addr_but_no_hotmail_received = 0
              self.hotmail_addr_with_forged_hotmail_received = 0
              rcvd = msg.msg.get("Received")
              if not rcvd:
      Severity: Minor
      Found in oa/plugins/header_eval.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_for_msn_groups_headers has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_for_msn_groups_headers(self, msg, target=None):
              """Check if the email's destination is a msn group"""
              to = ''.join(msg.get_decoded_header('To'))
              if not Regex(r"<(\S+)\@groups\.msn\.com>").search(to):
                  return False
      Severity: Minor
      Found in oa/plugins/header_eval.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_for_forged_juno_received_headers has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_for_forged_juno_received_headers(self, msg, target=None):
              from_addr = ''.join(msg.get_all_addr_header("From"))
              if not from_addr.rsplit("@", 1)[-1].endswith("juno.com"):
                  return False
              if self.gated_through_received_hdr_remover(msg):
      Severity: Minor
      Found in oa/plugins/header_eval.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_recipients has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def _check_recipients(self, msg):
              """Check for similar recipients addresses.
      
              Return the ratio of possibly similar recipient of
              the total number of possible combinations.
      Severity: Minor
      Found in oa/plugins/header_eval.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 received_within_months has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def received_within_months(self, msg, min, max, target=None):
              """Check if the date from received is in past"""
              if min == "undef":
                  min = None
              if max == "undef":
      Severity: Minor
      Found in oa/plugins/header_eval.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_for_shifted_date has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_for_shifted_date(self, msg, min=None, max=None, target=None):
              """Check if the difference between Date header and date from received
              headers its between min,max interval
      
              * min: minimum time express in hours
      Severity: Minor
      Found in oa/plugins/header_eval.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 _get_date_header_time has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def _get_date_header_time(self, msg):
              try:
                  return self.get_local(msg, "date_header_time")
              except KeyError:
                  pass
      Severity: Minor
      Found in oa/plugins/header_eval.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 check_for_forged_gw05_received_headers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_for_forged_gw05_received_headers(self, msg, target=None):
              gw05_re = Regex(r"from\s(\S+)\sby\s(\S+)\swith\sESMTP\;\s+\S\S\S,"
                              r"\s+\d+\s+\S\S\S\s+\d{4}\s+\d\d:\d\d:\d\d\s+[-+]*"
                              r"\d{4}", re.X | re.I)
              for rcv in msg.get_decoded_header("Received"):
      Severity: Minor
      Found in oa/plugins/header_eval.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 _get_received_header_times has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def _get_received_header_times(self, msg):
              try:
                  return self.get_local(msg, "received_header_times")
              except KeyError:
                  pass
      Severity: Minor
      Found in oa/plugins/header_eval.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 check_ratware_envelope_from has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_ratware_envelope_from(self, msg, target=None):
              """Check if envelope-from address is ratware or not."""
              to_header = msg.msg.get("To")
              envelope_from = msg.sender_address
              if not to_header or not envelope_from:
      Severity: Minor
      Found in oa/plugins/header_eval.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 check_header_count_range has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def check_header_count_range(self, msg, header, minr, maxr, target=None):
      Severity: Minor
      Found in oa/plugins/header_eval.py - About 35 mins to fix

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

            def check_illegal_chars(self, msg, header, ratio, count, target=None):
        Severity: Minor
        Found in oa/plugins/header_eval.py - About 35 mins to fix

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

              def subject_is_all_caps(self, msg, target=None):
                  """Checks if the subject is all capital letters.
          
                  This eval rule ignore short subjects, one word subject and
                  the prepended notations. (E.g. ``Re:``)
          Severity: Minor
          Found in oa/plugins/header_eval.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 check_for_fake_aol_relay_in_rcvd has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def check_for_fake_aol_relay_in_rcvd(self, msg, target=None):
                  """Check for common AOL fake received header."""
                  for recv in msg.get_decoded_header("Received"):
                      if not Regex(r" rly-[a-z][a-z]\d\d\.", re.I).search(recv):
                          continue
          Severity: Minor
          Found in oa/plugins/header_eval.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 False
          Severity: Major
          Found in oa/plugins/header_eval.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return False
            Severity: Major
            Found in oa/plugins/header_eval.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return True
              Severity: Major
              Found in oa/plugins/header_eval.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return False
                Severity: Major
                Found in oa/plugins/header_eval.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return False
                  Severity: Major
                  Found in oa/plugins/header_eval.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return False
                    Severity: Major
                    Found in oa/plugins/header_eval.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return False
                      Severity: Major
                      Found in oa/plugins/header_eval.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                        return True
                        Severity: Major
                        Found in oa/plugins/header_eval.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                          return True
                          Severity: Major
                          Found in oa/plugins/header_eval.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                                    return True
                            Severity: Major
                            Found in oa/plugins/header_eval.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return False
                              Severity: Major
                              Found in oa/plugins/header_eval.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                        return True
                                Severity: Major
                                Found in oa/plugins/header_eval.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return True
                                  Severity: Major
                                  Found in oa/plugins/header_eval.py - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return False
                                    Severity: Major
                                    Found in oa/plugins/header_eval.py - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                  return False
                                      Severity: Major
                                      Found in oa/plugins/header_eval.py - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                return False
                                        Severity: Major
                                        Found in oa/plugins/header_eval.py - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                          return True
                                          Severity: Major
                                          Found in oa/plugins/header_eval.py - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                    return False
                                            Severity: Major
                                            Found in oa/plugins/header_eval.py - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                      return False
                                              Severity: Major
                                              Found in oa/plugins/header_eval.py - About 30 mins to fix

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

                                                    def gated_through_received_hdr_remover(self, msg, target=None):
                                                        """Check if the email is gated through ezmlm"""
                                                        txt = ''.join(msg.get_decoded_header("Mailing-List"))
                                                        rcvd = ''.join(msg.get_decoded_header("Received"))
                                                        if Regex(r"^contact \S+\@\S+\; run by ezmlm$").search(txt):
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.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 check_messageid_not_usable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    def check_messageid_not_usable(self, msg, target=None):
                                                        list_unsubscribe = msg.msg.get("List-Unsubscribe")
                                                        if list_unsubscribe:
                                                            if Regex(r"<mailto:(?:leave-\S+|\S+-unsubscribe)\@\S+>$").search(
                                                                    list_unsubscribe):
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.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 check_for_unique_subject_id has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    def check_for_unique_subject_id(self, msg, target=None):
                                                        """Check if in subject appears an unique id"""
                                                        subject = "".join(msg.get_decoded_header("Subject"))
                                                        id = None
                                                        unique_id_re_list = [
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.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

                                                XXX found
                                                Open

                                                        # XXX We should really be checking ALL headers here,
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by fixme

                                                XXX found
                                                Open

                                                        # XXX not just Subject and From.
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by fixme

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

                                                    def check_in_TL_TLDS(self, address):
                                                        if address in self["util_rb_tld"]:
                                                            return True
                                                        if address in self["util_rb_2tld"]:
                                                            return True
                                                Severity: Major
                                                Found in oa/plugins/header_eval.py and 1 other location - About 3 hrs to fix
                                                oa/plugins/wlbl_eval.py on lines 237..244

                                                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

                                                        try:
                                                            if min:
                                                                min = int(min)
                                                            if max:
                                                                max = int(max)
                                                Severity: Major
                                                Found in oa/plugins/header_eval.py and 1 other location - About 1 hr to fix
                                                oa/plugins/header_eval.py on lines 777..785

                                                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

                                                        try:
                                                            if min:
                                                                min = int(min)
                                                            if max:
                                                                max = int(max)
                                                Severity: Major
                                                Found in oa/plugins/header_eval.py and 1 other location - About 1 hr to fix
                                                oa/plugins/header_eval.py on lines 810..818

                                                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 min or diff >= min) and
                                                                (not max or diff < max)):
                                                            return True
                                                Severity: Major
                                                Found in oa/plugins/header_eval.py and 1 other location - About 1 hr to fix
                                                oa/plugins/header_eval.py on lines 794..796

                                                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 2 locations. Consider refactoring.
                                                Open

                                                        if ((not min or number_months >= min) and
                                                                (not max or number_months < max)):
                                                            return True
                                                Severity: Major
                                                Found in oa/plugins/header_eval.py and 1 other location - About 1 hr to fix
                                                oa/plugins/header_eval.py on lines 820..822

                                                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 4 locations. Consider refactoring.
                                                Open

                                                                    if Regex(r"(?:re|fw):\s*(?:\w+\s+)?" + re.escape(to) + "$")\
                                                                            .search(subject):
                                                                        return True
                                                Severity: Major
                                                Found in oa/plugins/header_eval.py and 3 other locations - About 45 mins to fix
                                                oa/plugins/header_eval.py on lines 589..590
                                                oa/plugins/header_eval.py on lines 594..596
                                                oa/plugins/header_eval.py on lines 597..599

                                                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

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

                                                                    if Regex(r"^" + re.escape(to) + "$").search(subject):
                                                                        return True
                                                Severity: Major
                                                Found in oa/plugins/header_eval.py and 3 other locations - About 45 mins to fix
                                                oa/plugins/header_eval.py on lines 591..593
                                                oa/plugins/header_eval.py on lines 594..596
                                                oa/plugins/header_eval.py on lines 597..599

                                                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

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

                                                                    if Regex(r"\s*" + re.escape(to) + "[,:;!?-]$")\
                                                                            .search(subject):
                                                                        return True
                                                Severity: Major
                                                Found in oa/plugins/header_eval.py and 3 other locations - About 45 mins to fix
                                                oa/plugins/header_eval.py on lines 589..590
                                                oa/plugins/header_eval.py on lines 591..593
                                                oa/plugins/header_eval.py on lines 597..599

                                                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

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

                                                                    if Regex(r"^" + re.escape(to) + "\s*[,:;!?-](\s).*")\
                                                                            .search(subject):
                                                                        return True
                                                Severity: Major
                                                Found in oa/plugins/header_eval.py and 3 other locations - About 45 mins to fix
                                                oa/plugins/header_eval.py on lines 589..590
                                                oa/plugins/header_eval.py on lines 591..593
                                                oa/plugins/header_eval.py on lines 594..596

                                                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

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

                                                        try:
                                                            ratio = float(ratio)
                                                        except ValueError:
                                                            self.ctxt.log.warn("HeaderEval::Plugin check_illegal_chars "
                                                                                  "invalid option: %s", ratio)
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py and 1 other location - About 35 mins to fix
                                                oa/plugins/header_eval.py on lines 153..158

                                                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

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

                                                        try:
                                                            count = int(count)
                                                        except ValueError:
                                                            self.ctxt.log.warn("HeaderEval::Plugin check_illegal_chars "
                                                                                  "invalid option: %s", count)
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py and 1 other location - About 35 mins to fix
                                                oa/plugins/header_eval.py on lines 147..152

                                                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

                                                Continuation line over-indented for visual indent
                                                Open

                                                                    from_addr.rsplit("@", 1)[-1] == "reply.yahoo.com"):
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Continuation lines indentation.

                                                Continuation lines should align wrapped elements either vertically
                                                using Python's implicit line joining inside parentheses, brackets
                                                and braces, or using a hanging indent.
                                                
                                                When using a hanging indent these considerations should be applied:
                                                - there should be no arguments on the first line, and
                                                - further indentation should be used to clearly distinguish itself
                                                  as a continuation line.
                                                
                                                Okay: a = (\n)
                                                E123: a = (\n    )
                                                
                                                Okay: a = (\n    42)
                                                E121: a = (\n   42)
                                                E122: a = (\n42)
                                                E123: a = (\n    42\n    )
                                                E124: a = (24,\n     42\n)
                                                E125: if (\n    b):\n    pass
                                                E126: a = (\n        42)
                                                E127: a = (24,\n      42)
                                                E128: a = (24,\n    42)
                                                E129: if (a or\n    b):\n    pass
                                                E131: a = (\n    42\n 24)

                                                Invalid escape sequence '.'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '\d'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '\s'
                                                Open

                                                                regex = re.match("(\S+)@.*", to)
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '\d'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Continuation line missing indentation or outdented
                                                Open

                                                                IP_ADDRESS.pattern), re.X)
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Continuation lines indentation.

                                                Continuation lines should align wrapped elements either vertically
                                                using Python's implicit line joining inside parentheses, brackets
                                                and braces, or using a hanging indent.
                                                
                                                When using a hanging indent these considerations should be applied:
                                                - there should be no arguments on the first line, and
                                                - further indentation should be used to clearly distinguish itself
                                                  as a continuation line.
                                                
                                                Okay: a = (\n)
                                                E123: a = (\n    )
                                                
                                                Okay: a = (\n    42)
                                                E121: a = (\n   42)
                                                E122: a = (\n42)
                                                E123: a = (\n    42\n    )
                                                E124: a = (24,\n     42\n)
                                                E125: if (\n    b):\n    pass
                                                E126: a = (\n        42)
                                                E127: a = (24,\n      42)
                                                E128: a = (24,\n    42)
                                                E129: if (a or\n    b):\n    pass
                                                E131: a = (\n    42\n 24)

                                                Invalid escape sequence '.'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '\d'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '\w'
                                                Open

                                                                 "(?: with ESMTP)? id \w+").search(rcvd):
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Continuation line over-indented for visual indent
                                                Open

                                                                                  "invalid option: %s", count)
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Continuation lines indentation.

                                                Continuation lines should align wrapped elements either vertically
                                                using Python's implicit line joining inside parentheses, brackets
                                                and braces, or using a hanging indent.
                                                
                                                When using a hanging indent these considerations should be applied:
                                                - there should be no arguments on the first line, and
                                                - further indentation should be used to clearly distinguish itself
                                                  as a continuation line.
                                                
                                                Okay: a = (\n)
                                                E123: a = (\n    )
                                                
                                                Okay: a = (\n    42)
                                                E121: a = (\n   42)
                                                E122: a = (\n42)
                                                E123: a = (\n    42\n    )
                                                E124: a = (24,\n     42\n)
                                                E125: if (\n    b):\n    pass
                                                E126: a = (\n        42)
                                                E127: a = (24,\n      42)
                                                E128: a = (24,\n    42)
                                                E129: if (a or\n    b):\n    pass
                                                E131: a = (\n    42\n 24)

                                                Invalid escape sequence '\/'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '.'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence ')'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Continuation line over-indented for visual indent
                                                Open

                                                                                  "invalid option: %s", ratio)
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Continuation lines indentation.

                                                Continuation lines should align wrapped elements either vertically
                                                using Python's implicit line joining inside parentheses, brackets
                                                and braces, or using a hanging indent.
                                                
                                                When using a hanging indent these considerations should be applied:
                                                - there should be no arguments on the first line, and
                                                - further indentation should be used to clearly distinguish itself
                                                  as a continuation line.
                                                
                                                Okay: a = (\n)
                                                E123: a = (\n    )
                                                
                                                Okay: a = (\n    42)
                                                E121: a = (\n   42)
                                                E122: a = (\n42)
                                                E123: a = (\n    42\n    )
                                                E124: a = (24,\n     42\n)
                                                E125: if (\n    b):\n    pass
                                                E126: a = (\n        42)
                                                E127: a = (24,\n      42)
                                                E128: a = (24,\n    42)
                                                E129: if (a or\n    b):\n    pass
                                                E131: a = (\n    42\n 24)

                                                Invalid escape sequence '.'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '\d'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '\w'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Continuation line under-indented for visual indent
                                                Open

                                                                                                                     subject)
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Continuation lines indentation.

                                                Continuation lines should align wrapped elements either vertically
                                                using Python's implicit line joining inside parentheses, brackets
                                                and braces, or using a hanging indent.
                                                
                                                When using a hanging indent these considerations should be applied:
                                                - there should be no arguments on the first line, and
                                                - further indentation should be used to clearly distinguish itself
                                                  as a continuation line.
                                                
                                                Okay: a = (\n)
                                                E123: a = (\n    )
                                                
                                                Okay: a = (\n    42)
                                                E121: a = (\n   42)
                                                E122: a = (\n42)
                                                E123: a = (\n    42\n    )
                                                E124: a = (24,\n     42\n)
                                                E125: if (\n    b):\n    pass
                                                E126: a = (\n        42)
                                                E127: a = (24,\n      42)
                                                E128: a = (24,\n    42)
                                                E129: if (a or\n    b):\n    pass
                                                E131: a = (\n    42\n 24)

                                                Invalid escape sequence '\w'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '\d'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '.'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '.'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '\d'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '('
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Invalid escape sequence '.'
                                                Open

                                                        if Regex("by \w+\.\w+\.yahoo\.com \(\d+\.\d+\.\d+\/\d+\.\d+\.\d+\)"
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Line too long (84 > 79 characters)
                                                Open

                                                                            r"[\[\(]{0}[\]\)].*by".format(IP_ADDRESS.pattern), re.X)
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Limit all lines to a maximum of 79 characters.

                                                There are still many devices around that are limited to 80 character
                                                lines; plus, limiting windows to 80 characters makes it possible to
                                                have several windows side-by-side.  The default wrapping on such
                                                devices looks ugly.  Therefore, please limit all lines to a maximum
                                                of 79 characters. For flowing long blocks of text (docstrings or
                                                comments), limiting the length to 72 characters is recommended.
                                                
                                                Reports error E501.

                                                Invalid escape sequence '\s'
                                                Open

                                                                    if Regex(r"^" + re.escape(to) + "\s*[,:;!?-](\s).*")\
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                Line too long (80 > 79 characters)
                                                Open

                                                                    if Regex(r"(?:re|fw):\s*(?:\w+\s+)?" + re.escape(to) + "$")\
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Limit all lines to a maximum of 79 characters.

                                                There are still many devices around that are limited to 80 character
                                                lines; plus, limiting windows to 80 characters makes it possible to
                                                have several windows side-by-side.  The default wrapping on such
                                                devices looks ugly.  Therefore, please limit all lines to a maximum
                                                of 79 characters. For flowing long blocks of text (docstrings or
                                                comments), limiting the length to 72 characters is recommended.
                                                
                                                Reports error E501.

                                                Invalid escape sequence '\s'
                                                Open

                                                                    if Regex(r"^" + re.escape(to) + "\s*[,:;!?-](\s).*")\
                                                Severity: Minor
                                                Found in oa/plugins/header_eval.py by pep8

                                                Invalid escape sequences are deprecated in Python 3.6.

                                                Okay: regex = r'\.png$'
                                                W605: regex = '\.png$'

                                                There are no issues that match your filters.

                                                Category
                                                Status