File thread.py
has 947 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# Copyright © 2018 Dylan Baker
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import argparse
Function apply
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def apply(self, ui):
tbuffer = ui.current_buffer
# set message/reply indentation if changed
if self.indent is not None:
- 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 determine_sender
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def determine_sender(mail, action='reply'):
"""
Inspect a given mail to reply/forward/bounce and find the most appropriate
account to act from and construct a suitable From-Header to use.
- 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 apply
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def apply(self, ui):
logging.debug(self.movement)
original_focus = ui.get_deep_focus()
tbuffer = ui.current_buffer
if self.movement == 'parent':
- 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 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, cmd, all=False, separately=False, background=False,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, query=None, visible=None, raw=None, all_headers=None,
Avoid deeply nested control flow statements. Open
if name:
ui.notify('saved %s as: %s' % (name, dest))
else:
ui.notify('saved attachment as: %s' % dest)
else:
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'):
Avoid deeply nested control flow statements. Open
if settings.get(action + '_force_address'):
address = str(account.address)
else:
address = seen_address
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, message=None, all=False, listreply=None, spawn=None,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, all=False, separately=False, raw=False, add_tags=False,
TODO found Open
# TODO: add next by date..
- Exclude checks
TODO found Open
# TODO add 'next matching' if threadbuffer stores the original query
- Exclude checks
XXX found Open
# XXX: could this be repalced with "'needsterminal' not in entry"?
- Exclude checks