eveseat/eveapi

View on GitHub

Showing 440 of 440 total issues

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

            $model = SovereigntyStructure::firstOrNew([
                'structure_id' => $structure->structure_id,
            ]);
Severity: Minor
Found in src/Jobs/Sovereignty/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 '\Illuminate\Support\Facades\Cache' in method 'getRateLimitKeyTtl'.
Open

        return $redis->ttl(Cache::getPrefix() . self::RATE_LIMIT_KEY);
Severity: Minor
Found in src/Jobs/EsiBase.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\Wallet\CorporationWalletJournal' in method 'handle'.
Open

                            $model = CorporationWalletJournal::firstOrNew([
                                'corporation_id' => $this->getCorporationId(),
                                'division' => $balance->division,
                                'id' => $entry->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 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\Eveapi\Models\Character\CharacterInfo' in method 'handle'.
Open

        CharacterInfo::firstOrCreate(['character_id' => $this->getCharacterId()]);
Severity: Minor
Found in src/Jobs/Skills/Character/Skills.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

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

        } else {
            $job::dispatch();
        }
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\Market\CharacterOrder' in method 'handle'.
Open

            $model = CharacterOrder::firstOrNew([
                'character_id' => $this->getCharacterId(),
                'order_id' => $order->order_id,
            ]);
Severity: Minor
Found in src/Jobs/Market/Character/Orders.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\Universe\UniverseStructure' in method 'handle'.
Open

        if(UniverseStructure::find($this->structure_id) !== null) return;

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 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($jobs)
                ->name('Market History')
                ->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\Eveapi\Models\Contracts\CharacterContract' in method 'handle'.
Open

                CharacterContract::firstOrCreate([
                    'character_id' => $this->getCharacterId(),
                    'contract_id' => $contract->contract_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

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

                Price::upsert($types->toArray(),
                    [
                        'type_id',
                        'buy_price',
                        'updated_at',
Severity: Minor
Found in src/Jobs/Market/OrderAggregates.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\Universe\Structures\CacheCitadelAccessCache' in method 'handle'.
Open

                CacheCitadelAccessCache::blockAccess($this->getCharacterId(), $this->structure_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

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

                    ContractItem::updateOrCreate([
                        'record_id' => $item->record_id,
                    ], [
                        'contract_id' => $this->contract_id,
                        'type_id' => $item->type_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

Avoid unused parameters such as '$key'.
Open

            $records = $chunk->map(function ($item, $key) {
Severity: Minor
Found in src/Jobs/Market/Prices.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

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\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\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

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\Eseye\Configuration' in method '__construct'.
Open

        $config = Configuration::getInstance();
Severity: Minor
Found in src/Services/EseyeClient.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