Showing 231 of 446 total issues
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, teams, bracket, room_rank, flags=[], team_flags={}, winner=None):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, teams, bracket, room_rank, num_sides=4, flags=[], team_flags={}):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, teams, bracket, room_rank, flags=[], team_flags={}, advancing=[]):
Function _define_rooms_anywhere
has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring. Open
def _define_rooms_anywhere(points):
"""Defines rooms so that pull-up teams can go anywhere in the next
bracket up."""
counts = Counter(points)
rooms = []
- 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 add_speakers
has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring. Open
def add_speakers(self, side_tag, debate, result, side):
for pos in self.t.positions:
speaker = result.get_speaker(side, pos)
if speaker is not 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_bp
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def liveness_bp(is_general, current_round, break_size, total_teams, total_rounds, team_scores=[]):
Avoid deeply nested control flow statements. Open
for ballot in side.findall('ballot'):
for adj in [self.adjudicators.get(a) for a in ballot.get('adjudicators', "").split(" ")]:
if int(ballot.get('rank')) == 1:
dr.add_winner(adj, side_code)
dr.save()
Function import_venues
has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring. Open
def import_venues(self, f, auto_create_categories=True):
interpreter = make_interpreter(tournament=self.tournament,
DELETE=['category', lambda x: x.startswith('available:')])
venues = self._import(f, vm.Venue, interpreter)
- 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 deeply nested control flow statements. Open
if numeric_scores:
dr.set_speaker(side_code, pos, self.speakers.get(speech.get('speaker')))
if consensus:
dr.set_score(side_code, pos, float(speech.find('ballot').text))
else:
Function liveness_twoteam
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def liveness_twoteam(is_general, current_round, break_size, total_teams, total_rounds, team_scores=[]):
Function add_result
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_result(debate, submitter_type, user, discarded=False, confirmed=False, reply_random=False):
Function save_ballot
has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring. Open
def save_ballot(self):
# 4. Save the sides
if self.choosing_sides:
self.result.set_sides(*self.cleaned_data['choose_sides'])
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, teams, bracket, room_rank, num_sides=2, flags=[], team_flags={}):
Function duplicateAdjudicatorAllocations
has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring. Open
duplicateAdjudicatorAllocations: (state) => {
let allocatedIDs = []
let doubleAllocatedIDs = []
for (let debateOrPanelID in state.debatesOrPanels) {
const debate = state.debatesOrPanels[debateOrPanelID]
- 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_irons_list
has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring. Open
def get_irons_list(self):
iron_speeches = []
use_code_names = use_team_code_names_data_entry(self.tournament, True)
for d in self._get_draw():
for debateteam in d.debateteams:
- 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 handle_tournament
has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring. Open
def handle_tournament(self, tournament, **options):
writer = csv.writer(self.stdout)
headings = [
- 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 deeply nested control flow statements. Open
if ('teams' in debate && debate.teams) {
for (const keyAndEntry of Object.entries(debate.teams)) {
let team = keyAndEntry[1]
// Team can be a number (ID) or null (e.g. when editing sides)
if (team !== null && typeof team === 'object' && 'break_categories' in team) {
Avoid deeply nested control flow statements. Open
for criterion_score in ss.speakercriterionscore_set.all():
score = criterion_score.score
score = int(score) if int_step and int(score) == score else score
result.set_criterion_score(ss.debate_team.side, ss.position, criterion_score.criterion, score)
else:
Avoid deeply nested control flow statements. Open
if i == 0:
cell['class'] = 'highlight-col'
row.append(cell)
Function post
has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring. Open
def post(self, request, *args, **kwargs):
t = self.tournament
try:
person = Person.objects.get(url_key=kwargs['url_key'])
- 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"