Showing 151 of 272 total issues
Function refresh
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def refresh():
# update total result count
if not self.allm:
# remove thread from resultset if it doesn't match the search query
# any more and refresh selected threadline otherwise
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, completer, on_exit,
Avoid deeply nested control flow statements. Open
if cmd == 'toggle':
presenttags = self.collect_tags(querystring)
to_remove = []
to_add = []
for tag in tags:
Function choice
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def choice(self, message, choices=None, select=None, cancel=None,
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, mode, name, help=None, usage=None,
Function _set_envelope
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _set_envelope(self):
if self.envelope is None:
if self.rest:
if self.rest.startswith('mailto'):
self.envelope = mailto_to_envelope(self.rest)
- 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 _is_attachment
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _is_attachment(part, ct_override=None):
"""Takes a mimepart and returns a bool indicating if it's an attachment
Takes an optional argument to override the content type.
"""
- 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 _assemble_structure
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _assemble_structure(self, summary_only=False):
if summary_only:
return [(self._get_summary(), None)]
mainstruct = []
- 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 deeply nested control flow statements. Open
if header.lower() in ['to', 'cc', 'bcc']:
res = self._contactscompleter.complete(params,
localpos)
elif header.lower() == 'from':
res = self._accountscompleter.complete(params,
Avoid deeply nested control flow statements. Open
if settings.get(action + '_force_realname'):
realname = account.realname
else:
realname = seen_name
if settings.get(action + '_force_address'):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, choices, callback, cancel=None, select=None,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, tags='', action='add', allmessages=False, flush=True,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, all=False, separately=False, raw=False, add_tags=False,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, tags='', action='add', all=False, flush=True,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, commandline, regex, reflags=0,
Function prompt
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def prompt(self, prefix, text='', completer=None, tab=0, history=None):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, message=None, all=False, listreply=None, spawn=None,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, envelope=None, spawn=None, refocus=True, part=None,
Function get_key
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_key(keyid, validate=False, encrypt=False, sign=False,
Function main
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def main():
palette = [
('header', 'black,underline', 'light gray', 'standout,underline',
'black,underline', '#88a'),
('panel', 'light gray', 'dark blue', '',
- 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"