Showing 231 of 446 total issues
Avoid too many return
statements within this function. Open
return obj.adjudicator.name + " (" + str(obj.score) + ")"
Avoid too many return
statements within this function. Open
return GraphPowerPairedWithAllocatedSidesDrawGenerator
Avoid too many return
statements within this function. Open
return None if omit_tournament else obj.name
Avoid too many return
statements within this function. Open
return SwapRandomWithAllocatedSidesDrawGenerator
Avoid too many return
statements within this function. Open
return SwapRandomDrawGenerator
Avoid too many return
statements within this function. Open
return obj.adjudicator.name
Avoid too many return
statements within this function. Open
return str(obj)
Avoid too many return
statements within this function. Open
return AustralsPowerPairedWithAllocatedSidesDrawGenerator
Avoid too many return
statements within this function. Open
return AustralsPowerPairedDrawGenerator
Avoid too many return
statements within this function. Open
return redirect_round('availability-index', self.round.next)
Avoid too many return
statements within this function. Open
return gettext('Team %d') % (side + 1)
Avoid too many return
statements within this function. Open
return perm
Avoid too many return
statements within this function. Open
return redirect_tournament('tournament-public-index', t)
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return cached_perm
Function make_pairings
has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring. Open
def make_pairings(self, rooms, indices):
"""Creates the PolyPairing 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 assignment_cost
has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring. Open
def assignment_cost(self, t1, t2, size, bracket=None):
penalty = super().assignment_cost(t1, t2, size)
if penalty is None:
return 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 __init__
has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring. Open
def __init__(self, view=None, **kwargs):
"""Constructor.
- If `tournament` is specified, it becomes the default tournament for
the builder.
- If `admin` is True (default is False), then relevant links will go
- 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 _collate_elim_motion_annotations
has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring. Open
def _collate_elim_motion_annotations(self):
"""Collect annotations (which will be attributes) and convert them to
dictionaries to allow for easy iteration in the template."""
for motion in self.elim_motions_dict.values():
- 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
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"