Showing 211 of 428 total issues
Avoid too many return
statements within this function. Open
Open
return str(obj)
Avoid too many return
statements within this function. Open
Open
return super().post(request, *args, **kwargs)
Avoid too many return
statements within this function. Open
Open
return redirect_tournament('tournament-public-index', t)
Avoid too many return
statements within this function. Open
Open
return super().post(request, *args, **kwargs)
Avoid too many return
statements within this function. Open
Open
return "<error displaying %s>" % model_name
Avoid too many return
statements within this function. Open
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
Open
return GraphPowerPairedWithAllocatedSidesDrawGenerator
Avoid too many return
statements within this function. Open
Open
return "first_elimination"
Avoid too many return
statements within this function. Open
Open
return obj.reference
Avoid too many return
statements within this function. Open
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
Open
return SwapRandomWithAllocatedSidesDrawGenerator
Avoid too many return
statements within this function. Open
Open
return AustralsPowerPairedWithAllocatedSidesDrawGenerator
Avoid too many return
statements within this function. Open
Open
return obj.debate.matchup
Avoid too many return
statements within this function. Open
Open
return obj.name
Avoid too many return
statements within this function. Open
Open
return AustralsPowerPairedDrawGenerator
Avoid too many return
statements within this function. Open
Open
return obj.adjudicator.name
Avoid too many return
statements within this function. Open
Open
return redirect_round('availability-index', self.round.next)
Avoid too many return
statements within this function. Open
Open
return None
Function make_pairings
has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring. Open
Open
def make_pairings(self, rooms, indices):
"""Creates the BPPairing objects. Also flags pull-up rooms."""
teams_in_room = [[None, None, None, None] for i in range(len(indices) // 4)]
for t, r in indices:
teams_in_room[r // 4][r % 4] = self.teams[t]
- 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 _pullup
has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring. Open
Open
def _pullup(self, brackets, pos):
"""'brackets' is what is returned by _make_raw_brackets().
'pos' is a function taking the number of teams to choose from,
and returning an index for which team to take as the pullup.
Operates in-place. Does not remove empty brackets."""
- 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"