eveseat/eveapi

View on GitHub
src/Commands/Esi/Update/Contracts.php

Summary

Maintainability
A
1 hr
Test Coverage

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

    private function enqueueDetailedCorporationContractsJobs(array $contract_ids)
    {
        CorporationContract::whereIn('contract_id', $contract_ids)
            ->whereHas('detail', function ($query) {
                $query->where('status', '<>', 'deleted');
Severity: Minor
Found in src/Commands/Esi/Update/Contracts.php - About 1 hr to fix

    Avoid using static access to class '\Seat\Eveapi\Jobs\Contracts\Character\Contracts' in method 'enqueueContractsListJobs'.
    Open

                    CharacterContracts::dispatch($token);
    Severity: Minor
    Found in src/Commands/Esi/Update/Contracts.php by phpmd

    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\Contracts\Character\Bids' in method 'enqueueDetailedCharacterContractsJobs'.
    Open

                            CharacterBids::dispatch($token, $contract->contract_id);
    Severity: Minor
    Found in src/Commands/Esi/Update/Contracts.php by phpmd

    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\Contracts\Character\Items' in method 'enqueueDetailedCharacterContractsJobs'.
    Open

                            CharacterItems::dispatch($token, $contract->contract_id);
    Severity: Minor
    Found in src/Commands/Esi/Update/Contracts.php by phpmd

    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\RefreshToken' in method 'enqueueContractsListJobs'.
    Open

            RefreshToken::chunk(100, function ($tokens) {
                foreach ($tokens as $token) {
                    CharacterContracts::dispatch($token);
                }
            });
    Severity: Minor
    Found in src/Commands/Esi/Update/Contracts.php by phpmd

    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\RefreshToken' in method 'enqueueDetailedCharacterContractsJobs'.
    Open

                            $token = RefreshToken::find($contract->character_id);
    Severity: Minor
    Found in src/Commands/Esi/Update/Contracts.php by phpmd

    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\Contracts\Corporation\Bids' in method 'enqueueDetailedCorporationContractsJobs'.
    Open

                            CorporationBids::dispatch($contract->corporation_id, $token, $contract->contract_id);
    Severity: Minor
    Found in src/Commands/Esi/Update/Contracts.php by phpmd

    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\Contracts\Corporation\Contracts' in method 'enqueueContractsListJobs'.
    Open

                CorporationContracts::dispatch($token->character->affiliation->corporation_id, $token);
    Severity: Minor
    Found in src/Commands/Esi/Update/Contracts.php by phpmd

    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\Contracts\Corporation\Items' in method 'enqueueDetailedCorporationContractsJobs'.
    Open

                            CorporationItems::dispatch($contract->corporation_id, $token, $contract->contract_id);
    Severity: Minor
    Found in src/Commands/Esi/Update/Contracts.php by phpmd

    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