Showing 153 of 245 total issues
Function _prepare_connection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _prepare_connection(func):
"""
A decorator that unpacks the host and connection from the job argument
and passes them as separate arguments to the wrapped function.
"""
- 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 _update_verbosity
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _update_verbosity(self):
if self.verbose < 0:
self.channel_map['status_bar'] = self.devnull
self.channel_map['connection'] = self.devnull
self.channel_map['errors'] = self.devnull
- 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 _next
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _next(self):
# Make sure that the end is not yet reached.
if len(self.path) == 0:
raise StopIteration()
- 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 set_from_match
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_from_match(self, key, regex_list, string):
"""
Given a list of functions or three-tuples (regex, value, confidence),
this function walks through them and checks whether any of the
items in the list matches the given string.
- 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 append
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def append(self, data):
"""
Appends the given data to the buffer, and triggers all connected
monitors, if any of them match the buffer content.
- 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 _recvline
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _recvline(self, channel):
while not b'\n' in self.buf:
if not self.running:
return None
try:
- 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_account
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_account(self, account):
if isinstance(account, Context) or isinstance(account, _Context):
return account.context()
if account is None:
account = self.last_account
- 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 _expect_any
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _expect_any(self, prompt_list, flush=True):
self._doinit()
# Cancelled by a callback during self._say().
if self.cancel:
- 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
Avoid too many return
statements within this function. Open
return match.groups()
Avoid too many return
statements within this function. Open
return msg % (total, aborted, succeeded)
Avoid too many return
statements within this function. Open
return func(self)
Avoid too many return
statements within this function. Open
return 4
Avoid too many return
statements within this function. Open
return 1
Avoid too many return
statements within this function. Open
return [str(lft) + str(rgt)]
Avoid too many return
statements within this function. Open
return [int(lft) <= int(rgt)]
Avoid too many return
statements within this function. Open
return [int(lft) + int(rgt)]
Avoid too many return
statements within this function. Open
return _error_401(self, 'qop with missing nc or cnonce')
Avoid too many return
statements within this function. Open
return 2
Avoid too many return
statements within this function. Open
return [lft or rgt]
Avoid too many return
statements within this function. Open
return _error_401(self, 'Invalid username or password')