eveseat/eveapi

View on GitHub
src/Jobs/Mail/Mails.php

Summary

Maintainability
A
1 hr
Test Coverage

Method handle has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function handle()
    {
        parent::handle();

        // get last known mail ID to detect when parity has been reached
Severity: Minor
Found in src/Jobs/Mail/Mails.php - About 1 hr to fix

    Avoid using static access to class '\Seat\Eveapi\Models\Mail\MailRecipient' in method 'handle'.
    Open

                    MailRecipient::firstOrCreate([
                        'mail_id' => $header->mail_id,
                        'recipient_id' => $recipient->recipient_id,
                        'recipient_type' => $recipient->recipient_type,
                    ]);
    Severity: Minor
    Found in src/Jobs/Mail/Mails.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\Mail\MailBody' in method 'handle'.
    Open

                    MailBody::firstOrCreate([
                        'mail_id' => $header->mail_id,
                    ], [
                        'body' => $body->getBody()->body,
                    ]);
    Severity: Minor
    Found in src/Jobs/Mail/Mails.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\Mail\MailRecipient' in method 'handle'.
    Open

                MailRecipient::updateOrCreate([
                    'mail_id' => $header->mail_id,
                    'recipient_id' => $this->getCharacterId(),
                    'recipient_type' => 'character',
                ], [
    Severity: Minor
    Found in src/Jobs/Mail/Mails.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\Mail\MailHeader' in method 'handle'.
    Open

                $mail_header = MailHeader::firstOrCreate([
                    'mail_id' => $header->mail_id,
                ], [
                    'subject' => $header->subject,
                    'from' => $header->from,
    Severity: Minor
    Found in src/Jobs/Mail/Mails.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