eveseat/eveapi

View on GitHub
src/Jobs/Universe/Structures/StructureBatch.php

Summary

Maintainability
A
1 hr
Test Coverage

Method submitJobs has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function submitJobs(?RefreshToken $token = null)
    {
        // sort by whether it is a citadel or station
        [$stations, $citadels] = collect($this->structures)
            ->keys()
Severity: Minor
Found in src/Jobs/Universe/Structures/StructureBatch.php - About 1 hr to fix

    Avoid using static access to class '\Seat\Eveapi\Models\Universe\UniverseStation' in method 'submitJobs'.
    Open

                return UniverseStation::find($station_id) === null && ! $this->isCurrentlyProcessing($station_id); // stations don't need a character

    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 '\Seat\Eveapi\Models\Universe\UniverseStructure' in method 'submitJobs'.
    Open

                        UniverseStructure::find($citadel_id) === null                               // we don't already know it

    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 'Seat\Eveapi\Jobs\Universe\Structures\CacheCitadelAccessCache' in method 'submitJobs'.
    Open

                        && CacheCitadelAccessCache::canAccess($token->character_id, $citadel_id)    // the character isn't banned

    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