Showing 26 of 210 total issues
Avoid too many return
statements within this function. Open
return json.dumps(content), HTTPStatus.BAD_REQUEST, {'ContentType':'application/json'}
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return None
- Create a ticketCreate a ticket
Function api_contest_results
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def api_contest_results():
user = get_queryparam('user')
contest = get_queryparam('contest')
force = get_queryparam('force')
returnJSON = None
- Read upRead up
- Create a ticketCreate a ticket
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 api_usergroup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def api_usergroup():
"""
Contest Endpoint: POST with Content-Type = application/json
{
"groupname": groupname (String)
- Read upRead up
- Create a ticketCreate a ticket
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 insert_to_database
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def insert_to_database(self, handle: str): # pylint: disable=arguments-differ
if self.submissions:
for submission in reversed(self.submissions):
verdict,time = submission['verdict'], submission['creationTimeSeconds']
user = models.get_userid(handle)
- Read upRead up
- Create a ticketCreate a ticket
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 api_contests
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def api_contests():
if request.method == 'GET':
if get_queryparam('visible'):
# get all visible contests
contests = models.select_contest(
- Read upRead up
- Create a ticketCreate a ticket
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"