Showing 7 of 13 total issues
Function check
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def check(self, user_ip, user_agent, comment_author=None, comment_author_email=None, comment_author_url=None,
Function submit
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def submit(self, is_spam, user_ip, user_agent, comment_author=None, comment_author_email=None,
Function submit_spam
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def submit_spam(self, user_ip, user_agent, comment_author=None, comment_author_email=None,
Function submit_ham
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def submit_ham(self, user_ip, user_agent, comment_author=None, comment_author_email=None,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, api_key, blog=None, application_user_agent=None, timeout=None, is_test=False):
Function check
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def check(self, user_ip, user_agent, comment_author=None, comment_author_email=None, comment_author_url=None,
comment_content=None, referrer='unknown', blog=None, permalink=None, comment_type=None, blog_lang=None,
comment_date=None, comment_post_modified=None, user_role=None, is_test=False, recheck_reason=None):
parameters = self._get_parameters(locals())
r = self._request(self.get_check_url(), parameters)
- 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_parameters
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def _get_parameters(self, data):
data.pop('self', None)
data = dict((key, value) for key, value in data.items() if value is not None)
data['is_test'] = data.get('is_test') or self.is_test
data['charset'] = self.charset
- 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"