File contest.py
has 491 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import collections
import datetime
import functools
import itertools
Function _acm_scoreboard
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def _acm_scoreboard(is_export, _, tdoc, ranked_tsdocs, udict, dudict, pdict):
columns = []
columns.append({'type': 'rank', 'value': _('Rank')})
columns.append({'type': 'user', 'value': _('User')})
columns.append({'type': 'display_name', 'value': _('Display Name')})
- 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 _assignment_scoreboard
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def _assignment_scoreboard(is_export, _, tdoc, ranked_tsdocs, udict, dudict, pdict):
columns = []
columns.append({'type': 'rank', 'value': _('Rank')})
columns.append({'type': 'user', 'value': _('User')})
columns.append({'type': 'display_name', 'value': _('Display Name')})
- 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 _assignment_stat
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _assignment_stat(tdoc, journal):
effective = {}
for j in journal:
if j['pid'] in tdoc['pids'] and not (j['pid'] in effective and effective[j['pid']]['accept']):
effective[j['pid']] = j
- 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 _oi_scoreboard
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _oi_scoreboard(is_export, _, tdoc, ranked_tsdocs, udict, dudict, pdict):
columns = []
columns.append({'type': 'rank', 'value': _('Rank')})
columns.append({'type': 'user', 'value': _('User')})
columns.append({'type': 'display_name', 'value': _('Display Name')})
- 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 _acm_scoreboard
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _acm_scoreboard(is_export, _, tdoc, ranked_tsdocs, udict, dudict, pdict):
Function _oi_scoreboard
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _oi_scoreboard(is_export, _, tdoc, ranked_tsdocs, udict, dudict, pdict):
Function _assignment_scoreboard
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _assignment_scoreboard(is_export, _, tdoc, ranked_tsdocs, udict, dudict, pdict):
Function _acm_stat
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _acm_stat(tdoc, journal):
naccept = collections.defaultdict(int)
effective = {}
for j in journal:
if j['pid'] in tdoc['pids'] and not (j['pid'] in effective and effective[j['pid']]['accept']):
- 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"