Showing 186 of 349 total issues
Function send_bcc_email
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_bcc_email(BCC, SUBJECT, body,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, event, user, amount, stripe_id, last4):
Function add_withdrawal
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_withdrawal(amount, notes, reimbursee, admin, timestamp=None):
Function transfer_user_money
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def transfer_user_money(sender, recipient, amount, notes, admin):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, request, user, post, staff_post=False, deleted=False):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, transaction, amount, item_id, quantity, wholesale):
Function ajax_bool
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function ajax_bool (js_obj, object, field, id, status) {
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, box, item, quantity, percentage, enabled=True):
Function add_reimbursement
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_reimbursement(amount, notes, reimbursee, admin, timestamp=None):
Function send_email
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_email(TO, SUBJECT, body,
Function limitable_all_wrapper
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def limitable_all_wrapper(*args, limit=None, offset=None, count=False, **kwargs):
Function bitcoin_deposit
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def bitcoin_deposit(user, amount, btc_transaction, address, amount_btc):
Function limitable_request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def limitable_request(request, fn, prefix=None, limit=None, count=False):
Function admin_users_archive_old_submit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def admin_users_archive_old_submit(request):
count = 0
users = User.get_normal_users()
for user in users:
if user.days_since_last_purchase is not None and user.days_since_last_purchase >= 180:
- 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_item_from_barcode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_item_from_barcode(barcode):
try:
item = Item.from_barcode(barcode)
except:
# Could not find the item. Check to see if the user scanned a box
- 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 all_accessable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def all_accessable(cls, user, only_enabled=False):
# Get all pools the user can access
pools = []
for pool in Pool.all_by_owner(user, only_enabled):
if not only_enabled or pool.enabled:
- 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 dynamic_item_img
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def dynamic_item_img(request):
item = Item.from_id(request.matchdict['item_id'])
response = Response(content_type='image/jpeg')
class Hack():
def __init__(self, img):
- 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 make_link
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def make_link(obj, str_len=0):
if obj is None:
return ''
elif type(obj) is box.Box:
return '<a href="/admin/box/edit/{}">{}</a>'.format(obj.id, shorten(obj.name, str_len))
- 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_days_on_shame
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_days_on_shame(user, rows):
directions = {
'purchase': -1, # user balance goes down by amount
'cashdeposit': 1, # user balance goes up by amount
'ccdeposit': 1,
- 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 admin_pool_addmember_submit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def admin_pool_addmember_submit(request):
try:
pool = Pool.from_id(request.POST['pool-id'])
# Look up the user that is being added to the pool
- 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"