jaroslavtyc/drd-plus-health

View on GitHub
Health/Afflictions/Affliction.php

Summary

Maintainability
A
1 hr
Test Coverage

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

    The method __construct has 11 parameters. Consider reducing the number of parameters to less than 10.
    Open

        protected function __construct(
            Health $health,
            AfflictionProperty $property,
            AfflictionDangerousness $dangerousness,
            AfflictionDomain $domain,
    Severity: Minor
    Found in Health/Afflictions/Affliction.php by phpmd

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

    abstract class Affliction extends StrictObject
    {
        /**
         * @var \DrdPlus\Health\Health
         */
    Severity: Minor
    Found in Health/Afflictions/Affliction.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

    There are no issues that match your filters.

    Category
    Status