jaroslavtyc/drd-plus-health

View on GitHub

Showing 669 of 669 total issues

Method __construct has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

        SeriousWound $seriousWound, // wound can be healed, but never disappears - just stays healed
        AfflictionProperty $property,
        AfflictionDangerousness $dangerousness,
        AfflictionDomain $domain,
        AfflictionVirulence $virulence,
Severity: Major
Found in Health/Afflictions/AfflictionByWound.php - About 1 hr to fix

    Method __construct has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            Health $health,
            AfflictionProperty $property,
            AfflictionDangerousness $dangerousness,
            AfflictionDomain $domain,
            AfflictionVirulence $virulence,
    Severity: Major
    Found in Health/Afflictions/Affliction.php - About 1 hr to fix

      Method It_is_linked_with_health_immediately has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function It_is_linked_with_health_immediately()
          {
              $woundBoundary = $this->mockery(WoundBoundary::class);
              $woundBoundary->shouldReceive('getValue')
                  ->andReturn(5);
      Severity: Minor
      Found in tests/Health/Afflictions/AfflictionByWoundTest.php - About 1 hr to fix

        Method I_should_roll_against_malus_from_wounds_because_of_heal_of_ordinary_wound has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function I_should_roll_against_malus_from_wounds_because_of_heal_of_ordinary_wound($willValue, $rollValue, $expectedMalus): void
            {
                $health = $this->createHealthToTest($woundBoundary = $this->createWoundBoundary(10));
                $health->addWound($this->createWoundSize(4),
                    SeriousWoundOriginCode::getElementalWoundOrigin(),
        Severity: Minor
        Found in tests/Health/HealthTest.php - About 1 hr to fix

          The class HealthTest has 50 public methods and attributes. Consider reducing the number of public items to less than 45.
          Open

          class HealthTest extends TestWithMockery
          {
              /**
               * @test
               */
          Severity: Minor
          Found in tests/Health/HealthTest.php by phpmd

          ExcessivePublicCount

          Since: 0.1

          A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

          Example

          public class Foo {
              public $value;
              public $something;
              public $var;
              // [... more more public attributes ...]
          
              public function doWork() {}
              public function doMoreWork() {}
              public function doWorkAgain() {}
              // [... more more public methods ...]
          }

          Source https://phpmd.org/rules/codesize.html#excessivepubliccount

          Method I_can_not_heal_already_treated_serious_wound has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function I_can_not_heal_already_treated_serious_wound(): void
              {
                  $this->expectException(\DrdPlus\Health\Exceptions\ExpectedFreshWoundToHeal::class);
                  $health = $this->createHealthToTest($woundBoundary = $this->createWoundBoundary(5));
                  $seriousWound = $health->addWound(
          Severity: Minor
          Found in tests/Health/HealthTest.php - About 1 hr to fix

            Method Malus_is_not_increased_on_new_heal_by_worse_roll has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function Malus_is_not_increased_on_new_heal_by_worse_roll(): void
                {
                    $health = $this->createHealthToTest($woundBoundary = $this->createWoundBoundary(5));
                    self::assertSame(0, $health->getSignificantMalusFromPains($woundBoundary));
            
            
            Severity: Minor
            Found in tests/Health/HealthTest.php - About 1 hr to fix

              Method I_can_use_it has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function I_can_use_it(): Wound
                  {
                      $wound = $this->createWound(
                          $health = $this->createHealth(),
                          new WoundSize($woundSizeValue = 3),
              Severity: Minor
              Found in tests/Health/WoundTest.php - About 1 hr to fix

                Method createForRegeneration has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        RaceCode $raceCode,
                        SubRaceCode $subRaceCode,
                        Toughness $toughness,
                        ActivityAffectingHealingCode $activityAffectingHealingCode,
                        ConditionsAffectingHealingCode $conditionsAffectingHealingCode,
                Severity: Major
                Found in Health/HealingPower.php - About 1 hr to fix

                  The class Hunger has a coupling between objects value of 14. Consider to reduce the number of dependencies under 13.
                  Open

                  class Hunger extends Affliction
                  {
                  
                      /**
                       * @param Health $health

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  The class Bleeding has a coupling between objects value of 18. Consider to reduce the number of dependencies under 13.
                  Open

                  class Bleeding extends AfflictionByWound
                  {
                      public const BLEEDING = 'bleeding';
                  
                      /**

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  The class Pain has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13.
                  Open

                  class Pain extends AfflictionByWound
                  {
                      public const PAIN = 'pain';
                  
                      /**

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  The class Health has a coupling between objects value of 33. Consider to reduce the number of dependencies under 13.
                  Open

                  class Health extends StrictObject
                  {
                      /**
                       * @var array|Wound[]
                       */
                  Severity: Minor
                  Found in Health/Health.php by phpmd

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  The class SeveredArm has a coupling between objects value of 16. Consider to reduce the number of dependencies under 13.
                  Open

                  class SeveredArm extends AfflictionByWound
                  {
                      public const SEVERED_ARM = 'severed_arm';
                      public const COMPLETELY_SEVERED_ARM = 'completely_severed_arm';
                      public const COMPLETELY_SEVERED_ARM_SIZE = 6;

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  The class Cold has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
                  Open

                  class Cold extends AfflictionByWound
                  {
                      public const COLD = 'cold';
                  
                      /**

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  The class CrackedBones has a coupling between objects value of 14. Consider to reduce the number of dependencies under 13.
                  Open

                  class CrackedBones extends AfflictionByWound
                  {
                      public const CRACKED_BONES = 'cracked_bones';
                  
                      /**

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  The class AfflictionByWoundTest has a coupling between objects value of 23. Consider to reduce the number of dependencies under 13.
                  Open

                  abstract class AfflictionByWoundTest extends AfflictionTest
                  {
                  
                      /**
                       * @test

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  The class BleedingTest has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
                  Open

                  class BleedingTest extends AfflictionByWoundTest
                  {
                      /**
                       * @return Bleeding
                       */

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  The class Thirst has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
                  Open

                  class Thirst extends Affliction
                  {
                  
                      /**
                       * @param Health $health

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  The class SeveredArmTest has a coupling between objects value of 14. Consider to reduce the number of dependencies under 13.
                  Open

                  class SeveredArmTest extends AfflictionByWoundTest
                  {
                      /**
                       * @return SeveredArm
                       */

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  Severity
                  Category
                  Status
                  Source
                  Language