eidng8/sttbot

View on GitHub
tests/Wiki/Templates/Missions/MissionTest.php

Summary

Maintainability
C
1 day
Test Coverage

File MissionTest.php has 309 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Created by PhpStorm.
 * User: JC
 * Date: 2016-11-28
Severity: Minor
Found in tests/Wiki/Templates/Missions/MissionTest.php - About 3 hrs to fix

Method checkCadetAdvMissionSteps has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function checkCadetAdvMissionSteps(MissionModel $model)
    {
        $this->checkMissionStep(
            $model->steps[0],
            [
Severity: Major
Found in tests/Wiki/Templates/Missions/MissionTest.php - About 2 hrs to fix

Method checkCadetMissionSteps has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function checkCadetMissionSteps(MissionModel $model)
    {
        $this->checkMissionStep(
            $model->steps[0],
            [
Severity: Major
Found in tests/Wiki/Templates/Missions/MissionTest.php - About 2 hrs to fix

Avoid using static access to class '\eidng8\Wiki\Templates\Mission' in method 'testCadetAdvLoad'.
Open

        $actual = Mission::load($text, null, ['advanced' => true]);

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 '\eidng8\Wiki\Templates\Mission' in method 'testToArray'.
Open

        $actual = Mission::load($text);

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 '\eidng8\Wiki\Templates\Mission' in method 'testLoad'.
Open

        $actual = Mission::load($text);

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 '\eidng8\Log\Log' in method 'setUp'.
Open

        Log::forTest();

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 '\eidng8\Wiki\Templates\Mission' in method 'testCadetLoad'.
Open

        $actual = Mission::load($text);

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

There are no issues that match your filters.

Category
Status