Showing 551 of 2,707 total issues
Avoid too many return
statements within this function. Open
return {'success': True}
Avoid too many return
statements within this function. Open
return answer.strip().lower() in answers
Avoid too many return
statements within this function. Open
return False, 'Something wrong'
Avoid too many return
statements within this function. Open
return redirect('challenge_index_view')
Avoid too many return
statements within this function. Open
return "%s %s %s" % (self.type, self.user_from, self.spell)
Avoid too many return
statements within this function. Open
return redirect('challenge_index_view')
Avoid too many return
statements within this function. Open
return {'success': True}
Avoid too many return
statements within this function. Open
return redirect('challenge_index_view')
Avoid too many return
statements within this function. Open
return {'success': True, 'result': result}
Avoid too many return
statements within this function. Open
return {'success': True}
Avoid too many return
statements within this function. Open
return True, None
Avoid too many return
statements within this function. Open
return {'success': False, 'error': 'Unknown action'}
Function forum_actions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def forum_actions(request):
action = request.GET.get('action', None)
f_id = request.GET.get('f_id', '').split()
f_id = map(int, f_id)
queryset = Forum.objects.filter(id__in=f_id)
- 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 main
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def main():
if len(sys.argv) != 3:
print 'Usage: python add_users.py <list-of-emails.txt> <new-race>'
sys.exit(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 mobile_browser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def mobile_browser(request):
if request.META.has_key("HTTP_USER_AGENT"):
s = request.META["HTTP_USER_AGENT"].lower()
for i in ('nokia', 'mobile'):
if i in s:
- 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_cpanel_games
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_cpanel_games():
"""
Returns a dict of games having a cpanel page:
gs({'games/specialquest':'Special Quest'})
"""
- 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 qpool_actions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def qpool_actions(request):
action = request.GET.get('action', None)
qs = request.GET.get('qs', '').split(',')
qs.remove('')
qs = map(int, qs)
- 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 qpool_export
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def qpool_export(request, cat):
category = get_object_or_404(Category, name=cat)
response = HttpResponse(mimetype='text/txt')
response[
'Content-Disposition'] = 'attachment; filename=question_%s_export.txt' % slugify(
- 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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create(self, request):
question = QotdGame.get_for_today()
try:
qotduser = request.user.get_profile().get_extension(QotdUser)
except models.Model.DoesNotExist:
- 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 render_header
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render_header(context):
s = get_library('header')
order = [k for k in Setting.get('header-order').get_value().split(',') if k]
if not order:
order = s.get_blocks()
- 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"