TabbycatDebate/tabbycat

View on GitHub
tabbycat/draw/generator/powerpair.py

Summary

Maintainability
C
1 day
Test Coverage
B
89%

Function _intermediate_brackets_with_bubble_up_down has a Cognitive Complexity of 25 (exceeds 8 allowed). Consider refactoring.
Open

    def _intermediate_brackets_with_bubble_up_down(self, brackets):
        """Operates in-place.
        Requires Team.institution and Team.seen() to be defined."""
        self._intermediate_brackets(brackets)  # operates in-place
        # Check each of the intermediate brackets for conflicts.
Severity: Minor
Found in tabbycat/draw/generator/powerpair.py - About 3 hrs 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 _one_up_one_down has a Cognitive Complexity of 20 (exceeds 8 allowed). Consider refactoring.
Open

    def _one_up_one_down(self, pairings):
        """We pass the pairings to one_up_one_down.py, then infer annotations
        based on the result."""

        for bracket in pairings.values():
Severity: Minor
Found in tabbycat/draw/generator/powerpair.py - About 2 hrs 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 _intermediate_brackets_2 has a Cognitive Complexity of 20 (exceeds 8 allowed). Consider refactoring.
Open

    def _intermediate_brackets_2(cls, brackets):
        """Operates in-place.
        This implements the second intermediate brackets method, where all debates
        in the same intermediate bracket have the same number of wins, but there
        might be multiple intermediate brackets between brackets.
Severity: Minor
Found in tabbycat/draw/generator/powerpair.py - About 2 hrs 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 17 (exceeds 8 allowed). Consider refactoring.
Open

    def _pullup(self, brackets, indices):
        """'brackets' is what is returned by _make_raw_brackets().
        'pos' is a function taking the number of teams to choose from
        and number of teams required, and returning a list of indices
        for which teams to take as the pullup.
Severity: Minor
Found in tabbycat/draw/generator/powerpair.py - About 1 hr 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 _intermediate_brackets_1 has a Cognitive Complexity of 15 (exceeds 8 allowed). Consider refactoring.
Open

    def _intermediate_brackets_1(cls, brackets):
        """Operates in-place.
        This implements the first intermediate brackets method, where there is at most
        one intermediate bracket between brackets, but may have pullups from multiple
        brackets.
Severity: Minor
Found in tabbycat/draw/generator/powerpair.py - About 1 hr 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

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

There are no issues that match your filters.

Category
Status