matteoferla/DnD-battler

View on GitHub

Showing 30 of 30 total issues

Avoid too many return statements within this function.
Open

            return multi
Severity: Major
Found in DnD_battler/creature/_level.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return self.parse_attack(attacks)
    Severity: Major
    Found in DnD_battler/creature/_level.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return attacks[0]
      Severity: Major
      Found in DnD_battler/creature/_level.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return self.parse_attack(attacks)
        Severity: Major
        Found in DnD_battler/creature/_level.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return equip_standard_weapon(self, weapon_name=attack)
          Severity: Major
          Found in DnD_battler/creature/_level.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return self.parse_attacks(attacks)
            Severity: Major
            Found in DnD_battler/creature/_level.py - About 30 mins to fix

              Function attack has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def attack(self,
                             enemy_ac: int,
                             advantage: Optional[int] = None,
                             add_ability_to_damage=True,
                             munchkin=False) -> int:
              Severity: Minor
              Found in DnD_battler/dice/attack_roll.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 __setitem__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __setitem__(self, item: str, value):
                      """
                      Sets attributes, not a subscript proper. Does some cleaning though
                      formerly _set.
                      Corrects the value to a known type if of known, thanks to self._attribute_types
              Severity: Minor
              Found in DnD_battler/creature/_safe_property.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 find_target has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def find_target(self, valid: bool = True):
                      """
                      calls ``self.find_targets`` and ``self.is_valid_target``
              
                      :param valid: filter by valid per self.is_valid_target
              Severity: Minor
              Found in DnD_battler/actions/action.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 _crit_check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _crit_check(self, result, verbose=0):
                      """
                      Checks if the dice is a crit.
              
                      :param result: dice roll result.
              Severity: Minor
              Found in DnD_battler/dice/xdice.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