TabbycatDebate/tabbycat

View on GitHub

Showing 231 of 446 total issues

Avoid too many return statements within this function.
Open

                return obj.adjudicator.name + " (" + str(obj.score) + ")"
Severity: Major
Found in tabbycat/actionlog/models.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 None if omit_tournament else 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 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 SwapRandomDrawGenerator
          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 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 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 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 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 gettext('Team %d') % (side + 1)
                      Severity: Major
                      Found in tabbycat/tournaments/utils.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return perm
                        Severity: Major
                        Found in tabbycat/users/permissions.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 None
                            Severity: Major
                            Found in tabbycat/adjallocation/allocation.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return cached_perm
                              Severity: Major
                              Found in tabbycat/users/permissions.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 PolyPairing 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 assignment_cost has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
                                Open

                                    def assignment_cost(self, t1, t2, size, bracket=None):
                                        penalty = super().assignment_cost(t1, t2, size)
                                        if penalty is None:
                                            return None
                                
                                
                                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

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

                                    def __init__(self, view=None, **kwargs):
                                        """Constructor.
                                        - If `tournament` is specified, it becomes the default tournament for
                                          the builder.
                                        - If `admin` is True (default is False), then relevant links will go
                                Severity: Minor
                                Found in tabbycat/utils/tables.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 _collate_elim_motion_annotations has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
                                Open

                                    def _collate_elim_motion_annotations(self):
                                        """Collect annotations (which will be attributes) and convert them to
                                        dictionaries to allow for easy iteration in the template."""
                                
                                        for motion in self.elim_motions_dict.values():
                                Severity: Minor
                                Found in tabbycat/motions/statistics.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