eveseat/eveapi

View on GitHub

Showing 440 of 440 total issues

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

            $model = CharacterNotification::firstOrNew([
                'character_id' => $this->getCharacterId(),
                'notification_id' => $notification->notification_id,
            ]);
Severity: Minor
Found in src/Jobs/Character/Notifications.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\Character\CharacterStats' in method 'handle'.
Open

                CharacterStats::firstOrCreate([
                    'character_id' => $this->getCharacterId(),
                    'year' => $aggregate->year,
                    'category' => $category,
                    'stats' => isset($aggregate->$category) ?
Severity: Minor
Found in src/Jobs/Character/Stats.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\Calendar\CharacterCalendarEvent' in method 'handle'.
Open

                $model = CharacterCalendarEvent::firstOrNew([
                    'character_id' => $this->getCharacterId(),
                    'event_id' => $event->event_id,
                ]);
Severity: Minor
Found in src/Jobs/Calendar/Events.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\Contracts\ContractDetail' in method 'handle'.
Open

        $contract = ContractDetail::find($this->contract_id);
Severity: Minor
Found in src/Jobs/Contracts/Character/Bids.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\Corporation\CorporationInfo' in method 'handle'.
Open

        $model = CorporationInfo::firstOrNew([
            'corporation_id' => $this->getCorporationId(),
        ]);
Severity: Minor
Found in src/Jobs/Corporation/Info.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\Corporation\CorporationContainerLog' in method 'handle'.
Open

                $model = CorporationContainerLog::firstOrNew([
                    'corporation_id' => $this->getCorporationId(),
                    'container_id' => $log->container_id,
                    'logged_at' => carbon($log->logged_at),
                ]);

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\Corporation\CorporationStructure' in method 'handle'.
Open

                $model = CorporationStructure::firstOrNew([
                    'structure_id' => $structure->structure_id,
                ]);
Severity: Minor
Found in src/Jobs/Corporation/Structures.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\Skills\CharacterAttribute' in method 'handle'.
Open

        $model = CharacterAttribute::firstOrNew([
            'character_id' => $this->getCharacterId(),
        ]);

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\Wallet\CharacterWalletJournal' in method 'handle'.
Open

                $journal_entry = CharacterWalletJournal::firstOrNew([
                    'character_id' => $this->getCharacterId(),
                    'id' => $entry->id,
                ]);
Severity: Minor
Found in src/Jobs/Wallet/Character/Journal.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\Killmails\Killmail' in method 'handle'.
Open

                Killmail::firstOrCreate([
                    'killmail_id' => $killmail->killmail_id,
                ], [
                    'killmail_hash' => $killmail->killmail_hash,
                ]);

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 'handle'.
Open

        $token = RefreshToken::find($this->argument('character_id'));

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 handlePrivateCharacterJobs uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $job::dispatch($refresh_token);
        }
Severity: Minor
Found in src/Commands/Esi/Job/Dispatch.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

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

                Killmail::firstOrCreate([
                    'killmail_id' => $killmail->killmail_id,
                ], [
                    'killmail_hash' => $killmail->killmail_hash,
                ]);

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 '\Illuminate\Support\Facades\Cache' in method 'getLastProcessedBucketID'.
Open

        return Cache::get('buckets:processed') ?: 0;
Severity: Minor
Found in src/Commands/Seat/Buckets/Update.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\Calendar\CharacterCalendarEventDetail' in method 'handle'.
Open

                $model = CharacterCalendarEventDetail::firstOrNew([
                    'event_id' => $event_id,
                ]);
Severity: Minor
Found in src/Jobs/Calendar/Detail.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

The method getSchedules() has 120 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function getSchedules(): array
    {
        $schedules = [
            [   // ESI Status | Every Minute
                'command' => 'esi:update:status',

The method handle uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                Bus::batch($this->killmail_jobs->toArray())
                    ->name(sprintf('KM: %s', $this->token->character->name ?? $this->token->character_id))
                    ->onQueue($this->job->getQueue())
                    ->dispatch();

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

Avoid using static access to class '\Seat\Tests\Eveapi\Database\Factories\AllianceFactory' in method 'newFactory'.
Open

        return AllianceFactory::new();
Severity: Minor
Found in src/Models/Alliances/Alliance.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\Industry\CorporationIndustryMiningExtraction' in method 'handle'.
Open

            $model = CorporationIndustryMiningExtraction::firstOrNew([
                'moon_id' => $extraction->moon_id,
                'extraction_start_time' => $extraction->extraction_start_time,
            ]);

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\Killmails\KillmailDetail' in method 'handle'.
Open

        $killmail = KillmailDetail::firstOrCreate([
            'killmail_id' => $this->killmail_id,
        ], [
            'killmail_time' => carbon($detail->killmail_time),
            'solar_system_id' => $detail->solar_system_id,
Severity: Minor
Found in src/Jobs/Killmails/Detail.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

Severity
Category
Status
Source
Language