File CheckJobsCommand.php
has 277 lines of code (exceeds 250 allowed). Consider refactoring.
<?php
/*
* MIT License
*
Function handleException
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
private function handleException(RequestFailedException $exception): void
{
if (($exception->getOriginalException()->getCode() >= 400) && ($exception->getOriginalException()->getCode() <= 599)) {
$this->incrementEsiRateLimit();
Method persist
has 32 lines of code (exceeds 25 allowed). Consider refactoring.
private function persist(Collection $contracts): void
{
Contract::upsert(
$contracts->toArray(),
['contract_id'],
Function handle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
public function handle(int $location_id): void
{
$location = Location::with('locatable')->firstOrNew([
'location_id' => $location_id,
]);
Function failed
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
public function failed(Throwable $exception): void
{
if ($exception instanceof MaxAttemptsExceededException) {
$this->delete();
logger()->info('deleted job because MaxAttemptsException');