SpamExperts/OrangeAssassin

View on GitHub

Showing 287 of 802 total issues

Avoid too many return statements within this function.
Open

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

    Avoid too many return statements within this function.
    Open

                        return
    Severity: Major
    Found in oa/rules/parser.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

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

        Avoid too many return statements within this function.
        Open

                        return str(result)
        Severity: Major
        Found in oa/plugins/free_mail.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return _ExistsHeaderRule(name, **kwargs)
          Severity: Major
          Found in oa/rules/header.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

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

              Avoid too many return statements within this function.
              Open

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

                Avoid too many return statements within this function.
                Open

                                    return
                Severity: Major
                Found in oa/rules/parser.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return True
                  Severity: Major
                  Found in oa/received_parser.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/dkim.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

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

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

                              def msgid(self):
                                  """Generate a unique ID for the message.
                                  
                                  If the message already has an ID that should be unique, in the
                                  Message-ID header, then simply use that. Otherwise, generate an
                          Severity: Minor
                          Found in oa/message.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_found_forged has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def check_found_forged(self, address, found_forged):
                                  """If it is forged, check the address in list """
                                  if found_forged:
                                      wlist = self['parsed_whitelist_allow_relays']
                                      for addr in wlist:
                          Severity: Minor
                          Found in oa/plugins/wlbl_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 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 get_all_addr_header has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def get_all_addr_header(self, header_name):
                                  """Get a list of all the addresses from this header."""
                                  values = list()
                                  for value in self.get_decoded_header(header_name):
                                      for dummy, addr in email.utils.getaddresses([value]):
                          Severity: Minor
                          Found in oa/message.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_razor2 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def check_razor2(self, msg, full="", target=None):
                                  """ Checks a mail against the distributed Razor Catalogue
                                  by communicating with a Razor Catalogue Server.
                                      If we have returncode = 1 => it's not a spam
                                      If we have returncode = 0 => it's a spam
                          Severity: Minor
                          Found in oa/plugins/razor2.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 _save_stats has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def _save_stats(self, msg, payload, subtype):
                                  """Extracts and saves image stats once per unique image."""
                          
                                  image_id = md5(payload).hexdigest()
                          
                          
                          Severity: Minor
                          Found in oa/plugins/image_info.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_http_redirector has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def check_for_http_redirector(self, msg, target=None):
                                  """Checks if the uri has been redirected.
                                      -use HTTP_REDIR regex in order to extract the
                                      destination domain and compare it with source
                                      domain
                          Severity: Minor
                          Found in oa/plugins/uri_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_address_in_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def check_address_in_list(self, addresses, list_name):
                                  """Check if addresses match the regexes from list_name.
                                  """
                                  for address in addresses:
                                      for regex in self[list_name]:
                          Severity: Minor
                          Found in oa/plugins/wlbl_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

                          Severity
                          Category
                          Status
                          Source
                          Language