TabbycatDebate/tabbycat

View on GitHub

Showing 446 of 446 total issues

Function handle_object has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def handle_object(self, obj, name_field, delete_func, add_func, **options):
Severity: Minor
Found in tabbycat/adjfeedback/management/commands/generatefeedback.py - About 35 mins to fix

    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'):
    Severity: Minor
    Found in tabbycat/standings/round_results.py - About 35 mins to fix

      Function record_added_metric has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def record_added_metric(self, key, name, abbr, icon, ascending):
      Severity: Minor
      Found in tabbycat/standings/base.py - About 35 mins to fix

        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):
        Severity: Minor
        Found in tabbycat/standings/diversity.py - About 35 mins to fix

          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):
          Severity: Minor
          Found in tabbycat/standings/diversity.py - About 35 mins to fix

            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):
            Severity: Minor
            Found in tabbycat/standings/diversity.py - About 35 mins to fix

              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:
              Severity: Minor
              Found in tabbycat/draw/manager.py - About 35 mins to fix

              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:
              Severity: Minor
              Found in tabbycat/importer/management/commands/importtournament.py - About 35 mins to fix

              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 = []
              
              
              Severity: Minor
              Found in tabbycat/importer/forms.py - About 35 mins to fix

              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:
              Severity: Minor
              Found in tabbycat/importer/importers/base.py - About 35 mins to fix

              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]
              Severity: Minor
              Found in tabbycat/results/result.py - About 35 mins to fix

              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
              Severity: Minor
              Found in tabbycat/draw/generator/common.py - About 35 mins to fix

              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) {
              Severity: Minor
              Found in tabbycat/templates/allocations/DragAndDropStore.js - About 35 mins to fix

              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})
              Severity: Minor
              Found in tabbycat/draw/views.py - About 35 mins to fix

              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:
              Severity: Minor
              Found in tabbycat/results/management/commands/fixballotstatuses.py - About 35 mins to fix

              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 {
              Severity: Minor
              Found in tabbycat/results/utils.py - About 35 mins to fix

              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),
                          )
              Severity: Minor
              Found in tabbycat/checkins/management/commands/manageidentifiers.py - About 35 mins to fix

              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:
              Severity: Minor
              Found in tabbycat/participants/emoji.py - About 35 mins to fix

              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, result, adj, side, pos):
                      self.speaker = result.get_speaker(side, pos)
                      self.ghost = result.get_ghost(side, pos)
              
                      if adj is None:
              Severity: Minor
              Found in tabbycat/results/result_info.py - About 35 mins to fix

              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
              Severity: Minor
              Found in tabbycat/breakqual/utils.py - About 35 mins to fix

              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

              Severity
              Category
              Status
              Source
              Language