TabbycatDebate/tabbycat

View on GitHub

Showing 213 of 429 total issues

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

    def receive_debate_change(self, content, key, content_name, field_name, serializer):
Severity: Minor
Found in tabbycat/draw/consumers.py - About 35 mins to fix

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

        def add_team_ballots(self, side_tag, result, adj, scoresheet, side):
    Severity: Minor
    Found in tabbycat/importer/archive.py - About 35 mins to fix

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

          def __init__(self, teams, bracket, room_rank, flags=[], team_flags={}):
      Severity: Minor
      Found in tabbycat/draw/generator/pairing.py - About 35 mins to fix

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

            def build(self, draw, teams, side_histories_before, side_histories_now, standings):
        Severity: Minor
        Found in tabbycat/draw/tables.py - About 35 mins to fix

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

              def __init__(self, teams, bracket, room_rank, flags=[], team_flags={}):
          Severity: Minor
          Found in tabbycat/draw/generator/pairing.py - About 35 mins to fix

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

                def add_debate_adjudicators_column(self, debates, title="Adjudicators",
            Severity: Minor
            Found in tabbycat/utils/tables.py - About 35 mins to fix

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

                  def __init__(self, teams, bracket, room_rank, flags=[], team_flags={}):
              Severity: Minor
              Found in tabbycat/draw/generator/pairing.py - About 35 mins to fix

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

                    def build(self, debates, teams, side_histories_before, side_histories_now, standings):
                Severity: Minor
                Found in tabbycat/draw/tables.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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(self, container, chair=None, panellists=None, trainees=None, from_db=False):
                    Severity: Minor
                    Found in tabbycat/adjallocation/allocation.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 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 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 get_response_dict has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def get_response_dict(self, request, obj, checked, event, **kwargs):
                              Severity: Minor
                              Found in tabbycat/api/views.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 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 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 get_rounds has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
                                  Open

                                      def get_rounds(self, options):
                                          """Returns a list of rounds implied by command-line arguments.
                                          Implementation note: For caching purposes, this stores the result in
                                          the "__rounds__" key of the options dict."""
                                  
                                  
                                  Severity: Minor
                                  Found in tabbycat/utils/management/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 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language