GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 15-15 lines in 2 locations

app/Repositories/ServerRepository.php 2 locations

@@ 521-535 (lines=15) @@
518
519
            $newPorts = false;
520
            // Remove Assignments
521
            if (isset($data['remove_allocations'])) {
522
                foreach ($data['remove_allocations'] as $allocation) {
523
                    // Can't remove the assigned IP/Port combo
524
                    if ((int) $allocation === $server->allocation_id) {
525
                        continue;
526
                    }
527
528
                    $newPorts = true;
529
                    Models\Allocation::where('id', $allocation)->where('server_id', $server->id)->update([
530
                        'server_id' => null,
531
                    ]);
532
                }
533
534
                $server->load('allocations');
535
            }
536
537
            // Add Assignments
538
            if (isset($data['add_allocations'])) {
@@ 538-552 (lines=15) @@
535
            }
536
537
            // Add Assignments
538
            if (isset($data['add_allocations'])) {
539
                foreach ($data['add_allocations'] as $allocation) {
540
                    $model = Models\Allocation::where('id', $allocation)->whereNull('server_id')->first();
541
                    if (! $model) {
542
                        continue;
543
                    }
544
545
                    $newPorts = true;
546
                    $model->update([
547
                        'server_id' => $server->id,
548
                    ]);
549
                }
550
551
                $server->load('allocations');
552
            }
553
554
            if ($newPorts) {
555
                $newBuild['ports|overwrite'] = $server->allocations->groupBy('ip')->map(function ($item) {