jaroslavtyc/drd-plus-health

View on GitHub
tests/Health/Afflictions/SpecificAfflictions/SeveredArmTest.php

Summary

Maintainability
A
0 mins
Test Coverage

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

Avoid using static access to class '\DrdPlus\Health\Afflictions\SpecificAfflictions\SeveredArm' in method 'I_can_create_partially_severed_arm'.
Open

        $severedArm = SeveredArm::createIt($this->createWound(), $sizeValue = 1);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\DrdPlus\Health\Afflictions\SpecificAfflictions\SeveredArm' in method 'I_can_not_create_severed_arm_with_negative_value'.
Open

            SeveredArm::createIt($this->createWound(), 0);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\DrdPlus\Health\Afflictions\SpecificAfflictions\SeveredArm' in method 'getSut'.
Open

        return SeveredArm::createIt($this->createWound());

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\DrdPlus\Health\Afflictions\SpecificAfflictions\SeveredArm' in method 'I_can_get_heal_malus'.
Open

        $severedArm = SeveredArm::createIt($wound);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\DrdPlus\Health\Afflictions\SpecificAfflictions\SeveredArm' in method 'I_can_not_create_severed_arm_with_negative_value'.
Open

        SeveredArm::createIt($this->createWound(), -1);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\DrdPlus\Health\Afflictions\SpecificAfflictions\SeveredArm' in method 'I_can_get_malus_to_activities'.
Open

        $severedArm = SeveredArm::createIt($wound);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\DrdPlus\Health\Afflictions\SpecificAfflictions\SeveredArm' in method 'I_can_get_agility_malus'.
Open

        $severedArm = SeveredArm::createIt($wound);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\DrdPlus\Health\Afflictions\SpecificAfflictions\SeveredArm' in method 'I_can_get_knack_malus'.
Open

        $severedArm = SeveredArm::createIt($wound, 4);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\DrdPlus\Health\Afflictions\SpecificAfflictions\SeveredArm' in method 'I_can_not_create_more_than_completely_severed_arm'.
Open

        SeveredArm::createIt($this->createWound(), 7);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\DrdPlus\Health\Afflictions\SpecificAfflictions\SeveredArm' in method 'I_can_get_strength_malus'.
Open

        $severedArm = SeveredArm::createIt($wound, 5);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\DrdPlus\Health\Afflictions\SpecificAfflictions\SeveredArm' in method 'I_can_use_it'.
Open

        $severedArm = SeveredArm::createIt($wound = $this->createWound());

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method I_can_not_create_more_than_completely_severed_arm is not named in camelCase.
Open

    public function I_can_not_create_more_than_completely_severed_arm()
    {
        $this->expectException(\DrdPlus\Health\Afflictions\SpecificAfflictions\Exceptions\SeveredArmAfflictionSizeExceeded::class);
        SeveredArm::createIt($this->createWound(), 7);
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method I_can_get_strength_malus is not named in camelCase.
Open

    public function I_can_get_strength_malus()
    {
        $wound = $this->createWound();
        $woundBoundary = $this->createWoundBoundary(20);
        $this->addSizeCalculation($wound, $woundBoundary, 123);

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method I_can_get_agility_malus is not named in camelCase.
Open

    public function I_can_get_agility_malus()
    {
        $wound = $this->createWound();
        $woundBoundary = $this->createWoundBoundary(20);
        $this->addSizeCalculation($wound, $woundBoundary, 123);

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method I_can_get_knack_malus is not named in camelCase.
Open

    public function I_can_get_knack_malus()
    {
        $wound = $this->createWound();
        $woundBoundary = $this->createWoundBoundary(20);
        $this->addSizeCalculation($wound, $woundBoundary, 123);

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method I_can_not_create_severed_arm_with_negative_value is not named in camelCase.
Open

    public function I_can_not_create_severed_arm_with_negative_value()
    {
        $this->expectException(\DrdPlus\Health\Afflictions\Exceptions\AfflictionSizeCanNotBeNegative::class);
        try {
            SeveredArm::createIt($this->createWound(), 0);

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method I_can_get_heal_malus is not named in camelCase.
Open

    public function I_can_get_heal_malus()
    {
        $wound = $this->createWound();
        $woundBoundary = $this->createWoundBoundary(20);
        $this->addSizeCalculation($wound, $woundBoundary, 123);

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method I_can_use_it is not named in camelCase.
Open

    public function I_can_use_it()
    {
        $severedArm = SeveredArm::createIt($wound = $this->createWound());

        self::assertSame($wound, $severedArm->getSeriousWound());

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method I_can_get_malus_to_activities is not named in camelCase.
Open

    public function I_can_get_malus_to_activities()
    {
        $wound = $this->createWound();
        $woundBoundary = $this->createWoundBoundary(20);
        $this->addSizeCalculation($wound, $woundBoundary, 123);

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method I_can_create_partially_severed_arm is not named in camelCase.
Open

    public function I_can_create_partially_severed_arm()
    {
        $severedArm = SeveredArm::createIt($this->createWound(), $sizeValue = 1);

        self::assertInstanceOf(AfflictionDomain::class, $severedArm->getDomain());

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status