TabbycatDebate/tabbycat

View on GitHub

Showing 211 of 428 total issues

Avoid too many return statements within this function.
Open

                return str(obj)
Severity: Major
Found in tabbycat/actionlog/models.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return super().post(request, *args, **kwargs)
    Severity: Major
    Found in tabbycat/checkins/views.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return redirect_tournament('tournament-public-index', t)
      Severity: Major
      Found in tabbycat/tournaments/mixins.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return super().post(request, *args, **kwargs)
        Severity: Major
        Found in tabbycat/draw/views.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return "<error displaying %s>" % model_name
          Severity: Major
          Found in tabbycat/actionlog/models.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return self.error_page(_("It looks like the sides for this debate haven't yet been confirmed, "
            Severity: Major
            Found in tabbycat/results/views.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return GraphPowerPairedWithAllocatedSidesDrawGenerator
              Severity: Major
              Found in tabbycat/draw/generator/__init__.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return "first_elimination"
                Severity: Major
                Found in tabbycat/draw/manager.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return obj.reference
                  Severity: Major
                  Found in tabbycat/actionlog/models.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return self.error_page(_("Your debate doesn't have a chair, so you can't enter results for it. "
                    Severity: Major
                    Found in tabbycat/results/views.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return SwapRandomWithAllocatedSidesDrawGenerator
                      Severity: Major
                      Found in tabbycat/draw/generator/__init__.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                        return AustralsPowerPairedWithAllocatedSidesDrawGenerator
                        Severity: Major
                        Found in tabbycat/draw/generator/__init__.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                              return obj.debate.matchup
                          Severity: Major
                          Found in tabbycat/actionlog/models.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                            return obj.name
                            Severity: Major
                            Found in tabbycat/actionlog/models.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                              return AustralsPowerPairedDrawGenerator
                              Severity: Major
                              Found in tabbycat/draw/generator/__init__.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                return obj.adjudicator.name
                                Severity: Major
                                Found in tabbycat/actionlog/models.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                              return redirect_round('availability-index', self.round.next)
                                  Severity: Major
                                  Found in tabbycat/tournaments/views.py - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                return None
                                    Severity: Major
                                    Found in tabbycat/adjallocation/allocation.py - About 30 mins to fix

                                      Function make_pairings has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
                                      Open

                                          def make_pairings(self, rooms, indices):
                                              """Creates the BPPairing 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]
                                      Severity: Minor
                                      Found in tabbycat/draw/generator/bphungarian.py - About 25 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 _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."""
                                      Severity: Minor
                                      Found in tabbycat/draw/generator/powerpair.py - About 25 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