Health/Afflictions/Affliction.php
Method __construct
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Health $health,
AfflictionProperty $property,
AfflictionDangerousness $dangerousness,
AfflictionDomain $domain,
AfflictionVirulence $virulence,
The method __construct has 11 parameters. Consider reducing the number of parameters to less than 10. Open
Open
protected function __construct(
Health $health,
AfflictionProperty $property,
AfflictionDangerousness $dangerousness,
AfflictionDomain $domain,
- Exclude checks
The class Affliction has a coupling between objects value of 20. Consider to reduce the number of dependencies under 13. Open
Open
abstract class Affliction extends StrictObject
{
/**
* @var \DrdPlus\Health\Health
*/
- Read upRead up
- Exclude checks
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) {}
// ...
}