Showing 231 of 446 total issues
Function __init__
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def __init__(self, result, adj, side, pos):
self.speaker = result.get_speaker(side, pos)
self.ghost = result.get_ghost(side, pos)
if adj is None:
- 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 liveness
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def liveness(self, team, teams_count, prelims, current_round):
live_info = {'text': team.wins_count, 'tooltip': ''}
# The actual calculation should be shifted to be a cached method on
# the relevant break category
- 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_rounds
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def get_rounds(self, options):
"""Returns a list of rounds implied by command-line arguments.
Implementation note: For caching purposes, this stores the result in
the "__rounds__" key of the options dict."""
- 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 dispatch
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def dispatch(self, request, *args, **kwargs):
t = self.tournament
if not getattr(settings, 'DISABLE_SENTRY', False):
from sentry_sdk import set_context
- 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 cast_round_results
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def cast_round_results(self, standings, rounds, step_preference):
"""For use by subclasses. Casts round results to integers if appropriate
according to tournament preferences."""
if self.tournament.pref(step_preference) % 1 == 0:
is_consensus_by_round = [self.tournament.ballots_per_debate(r.stage) == 'per-debate' for r in rounds]
- 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 run_allocation
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def run_allocation(self):
# Sort voting adjudicators in descending order by score
voting = [a for a in self.adjudicators if a._weighted_score >= self.min_voting_score and not a.trainee]
random.shuffle(voting)
- 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 10 (exceeds 8 allowed). Consider refactoring. Open
def __init__(self, *args, **kwargs):
self.fields['speakers'] = self.TeamSpeakerSerializer(*args, many=True, required=False, **kwargs)
super().__init__(*args, **kwargs)
- 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 email
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def email(self, event: Dict[str, Union[str, BulkNotification.EventType, List[int], Dict[str, Any]]]) -> None:
# Get database objects
if 'debate_id' in event['extra']:
debate = Debate.objects.select_related('round__tournament').get(pk=event['extra'].pop('debate_id'))
event['extra']['debate'] = debate
- 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
Avoid too many return
statements within this function. Open
return GraphPowerPairedDrawGenerator
Avoid too many return
statements within this function. Open
return obj.name
Avoid too many return
statements within this function. Open
return self.error_page(_("Your debate doesn't have a chair, so you can't enter results for it. "
Avoid too many return
statements within this function. Open
return obj.debate.matchup
Avoid too many return
statements within this function. Open
return super().post(request, *args, **kwargs)
Avoid too many return
statements within this function. Open
return "first_elimination"
Avoid too many return
statements within this function. Open
return super().post(request, *args, **kwargs)
Avoid too many return
statements within this function. Open
return gettext("result unknown")
Avoid too many return
statements within this function. Open
return obj.reference
Avoid too many return
statements within this function. Open
return self.error_page(_("It looks like the sides for this debate haven't yet been confirmed, "
Avoid too many return
statements within this function. Open
return "danger", "still-bad", 2
Avoid too many return
statements within this function. Open
return "<error displaying %s>" % model_name