Showing 4 of 4 total issues
Function send_message
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def send_message(self, from_email, to, cc=None, bcc=None,
Function send_message
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
def send_message(self, from_email, to, cc=None, bcc=None,
subject=None, text=None, html=None, tags=None,
reply_to=None, headers=None, inlines=None, attachments=None, campaign_id=None):
# sanity checks
assert (text or html)
- 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 add_list_member
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def add_list_member(self, list_name, address, name=None, params=None,
Function add_list_member
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def add_list_member(self, list_name, address, name=None, params=None,
subscribed=True, upsert=False):
data = {'address': address}
if name:
data['name'] = 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"