lib/mail_handler/reply_handler.rb
Method permanently_failed_addresses
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.permanently_failed_addresses(message)
if MailHandler.empty_return_path?(message)
# Some sort of auto-response
# Check for Exim’s X-Failed-Recipients header
- 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
Method is_oof?
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.is_oof?(message)
# Check for out-of-office
if MailHandler.get_header_string("X-POST-MessageClass", message) == "9; Autoresponder"
return true
- 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
Method permanently_failed_addresses
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.permanently_failed_addresses(message)
if MailHandler.empty_return_path?(message)
# Some sort of auto-response
# Check for Exim’s X-Failed-Recipients header
Avoid too many return
statements within this method. Open
Open
return true if subject == "out of office"
Avoid too many return
statements within this method. Open
Open
return true if subject.start_with? "out of office autoreply:"
Avoid too many return
statements within this method. Open
Open
return true if subject == "out of office reply"
Avoid too many return
statements within this method. Open
Open
return true if subject.end_with? "is out of the office"