Showing 287 of 802 total issues
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return str(result)
Avoid too many return
statements within this function. Open
return _ExistsHeaderRule(name, **kwargs)
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return True
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
- Read upRead up
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:
- Read upRead up
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):
- Read upRead up
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]):
- Read upRead up
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
- Read upRead up
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()
- Read upRead up
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
- Read upRead up
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]:
- Read upRead up
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"