Showing 186 of 349 total issues
Avoid too many return
statements within this function. Open
return HTTPFound(location=request.route_url('admin_user_purchase_add'))
Avoid too many return
statements within this function. Open
return HTTPFound(location=request.route_url('admin_box_edit', box_id=int(request.POST['box-id'])))
Avoid too many return
statements within this function. Open
return HTTPFound(location=request.route_url('admin_event', event_id=event.id))
Avoid too many return
statements within this function. Open
return HTTPFound(location=request.route_url('admin_events'))
Avoid too many return
statements within this function. Open
return HTTPFound(location=request.route_url('admin_user_balance_edit'))
Avoid too many return
statements within this function. Open
return HTTPFound(location=request.route_url('admin_events'))
Avoid too many return
statements within this function. Open
return HTTPFound(location=request.route_url('admin_reimbursees'))
Avoid too many return
statements within this function. Open
return HTTPFound(location=request.route_url('admin_user_balance_edit'))
Avoid too many return
statements within this function. Open
return HTTPFound(location=request.route_url('admin_cash_reconcile'))
Avoid too many return
statements within this function. Open
return HTTPFound(location=request.route_url('admin_item_edit', item_id=int(request.POST['item-id'])))
Function toggle_state_success
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function toggle_state_success (data) {
var parent = $("#"+$(this).attr("data-parent"))
if ($(this).hasClass('require-refresh')) {
location.reload();
- 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_events_by_type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __get_events_by_type(cls, event_type):
q = DBSession.query(event.Event)\
.join(Transaction)
if event_type == 'cash':
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, event, user, amount):
cashbox_c = account.get_cash_account("cashbox")
prev = cashbox_c.balance
Transaction.__init__(self, event, None, user, None, cashbox_c, amount)
new = cashbox_c.balance
- 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_user_archive
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def admin_user_archive(request):
try:
user = User.from_id(int(request.matchdict['user_id']))
# Cannot archive already archived user
- 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_inventory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def admin_inventory(request):
items1 = DBSession.query(Item)\
.filter(Item.enabled==True)\
.filter(Item.in_stock!=0)\
.order_by(Item.name).all()
- 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 toggle_state_success
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function toggle_state_success (data) {
var parent = $("#"+$(this).attr("data-parent"));
if ($(this).hasClass('require-refresh')) {
location.reload();
- 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_data_highcharts_period
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def admin_data_highcharts_period(metric, period):
start = get_start(0)
end = get_end()
if metric == 'items':
data = PurchaseLineItem.quantity_by_period(period, start=ftz(start), end=ftz(end))
- 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 show_correct_purchase_button
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function show_correct_purchase_button () {
if ($("#purchase-complete:visible").length == 1) {
// If we are on the purchase complete page, show logout
$("#purchase-button-purchaselogout").hide();
$("#purchase-button-purchase").hide();
- 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 user_pool_changename_submit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def user_pool_changename_submit(request):
try:
pool = Pool.from_id(request.POST['pool-id'])
if pool.owner != request.user.id:
request.session.flash('You do not have permission to view that pool.', 'error')
- 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 from_barcode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def from_barcode(cls, barcode):
box_list = DBSession.query(cls).filter(cls.barcode.ilike('%{}%'.format(barcode))).all()
for box in box_list:
#split string into individual barcodes
box_barcode_sub = box.barcode.split(';')
- 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"