Showing 231 of 446 total issues
Function get_response_dict
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_response_dict(self, request, obj, checked, event, **kwargs):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, container, chair=None, panellists=None, trainees=None, from_db=False):
Function handle_object
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handle_object(self, obj, name_field, delete_func, add_func, **options):
Function add_team_round_results
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_team_round_results(standings, rounds, opponents=False, lookup=None, id_attr='instance_id'):
Function record_added_metric
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def record_added_metric(self, key, name, abbr, icon, ascending):
Function compile_grouped_means_by_gender
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def compile_grouped_means_by_gender(titles, queryset, gender_field, group_field, group_values):
Function compile_grouped_counts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def compile_grouped_counts(title, queryset, group_field, group_values, group_labels):
Function compile_grouped_gender_counts
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def compile_grouped_gender_counts(titles, queryset, gender_field, group_field, group_values):
Function get_generator_type
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def get_generator_type(self):
break_size = self.round.break_category.break_size
if break_size % 6 == 0 and ispow2(break_size // 6):
nprev_rounds = self.round.break_category.round_set.filter(seq__lt=self.round.seq).count()
if nprev_rounds == 0:
- 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_importer_class
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def get_importer_class(self):
importer_spec_filepath = os.path.join(self.dirpath, ".importer")
importer_spec_arg = self.options['importer']
if not os.path.exists(importer_spec_filepath) and importer_spec_arg 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 clean_institutions_raw
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def clean_institutions_raw(self):
lines = self.cleaned_data['institutions_raw'].split('\n')
errors = []
institutions = []
- 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 update_with_validation_error
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def update_with_validation_error(self, lineno, model, ve):
"""Adds the information in a Django ValidationError to this error."""
if hasattr(ve, 'error_dict'):
for field, error_list in list(ve.error_dict.items()):
for error in error_list:
- 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 save
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def save(self):
super().save()
for adj, sheet in self.scoresheets.items():
da = self.debateadjs[adj]
- 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, teams, results=None, rrseq=None, **kwargs):
self.teams = teams
self.team_flags = dict()
self.results = results
self.rrseq = rrseq
- 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 allTeams
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
allTeams: state => {
let teams = {}
for (let debateOrPanelID in state.debatesOrPanels) {
let debateOrPanel = state.debatesOrPanels[debateOrPanelID]
if ('teams' in debateOrPanel) {
- 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_position_cost_function_str
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def get_position_cost_function_str(self):
cost_func = self.tournament.pref('bp_position_cost')
if cost_func == 'entropy':
renyi_order = self.tournament.pref('bp_renyi_order')
cost_func_str = _("Rényi entropy of order %(order)s" % {'order': renyi_order})
- 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 10 (exceeds 8 allowed). Consider refactoring. Open
def handle_tournament(self, tournament, **options):
for bsub in BallotSubmission.objects.filter(debate__round__tournament=tournament):
debate_status = bsub.debate.result_status
original = (bsub.discarded, bsub.confirmed)
if debate_status == Debate.STATUS_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 readable_ballotsub_result
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def readable_ballotsub_result(debateresult):
""" Make a human-readable representation of a debate result """
def get_display_name(dt, t, use_codes):
return {
- 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 10 (exceeds 8 allowed). Consider refactoring. Open
def handle_tournament(self, tournament, **options):
if options['model'] == 'person':
queryset = Person.objects.filter(
Q(adjudicator__tournament=tournament) | Q(speaker__team__tournament=tournament),
)
- 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 populate_code_names_from_emoji
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def populate_code_names_from_emoji(teams, overwrite=True):
"""Populates team code names based on existing emoji."""
count = 0
for team in teams:
- 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"