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 = 22-23 lines in 3 locations

app/Http/Controllers/Admin/ServersController.php 1 location

@@ 388-409 (lines=22) @@
385
     * @param  int     $id
386
     * @return \Illuminate\Response\RedirectResponse
387
     */
388
    public function updateBuild(Request $request, $id)
389
    {
390
        $repo = new ServerRepository;
391
392
        try {
393
            $repo->changeBuild($id, $request->intersect([
394
                'allocation_id', 'add_allocations', 'remove_allocations',
395
                'memory', 'swap', 'io', 'cpu',
396
            ]));
397
398
            Alert::success('Server details were successfully updated.')->flash();
399
        } catch (DisplayValidationException $ex) {
400
            return redirect()->route('admin.servers.view.build', $id)->withErrors(json_decode($ex->getMessage()))->withInput();
401
        } catch (DisplayException $ex) {
402
            Alert::danger($ex->getMessage())->flash();
403
        } catch (\Exception $ex) {
404
            Log::error($ex);
405
            Alert::danger('An unhandled exception occured while attemping to add this server. This error has been logged.')->flash();
406
        }
407
408
        return redirect()->route('admin.servers.view.build', $id);
409
    }
410
411
    /**
412
     * Start the server deletion process.

app/Http/Controllers/Admin/OptionController.php 1 location

@@ 93-114 (lines=22) @@
90
     * @param  int     $id       The ID of the service option to assign this variable to.
91
     * @return \Illuminate\Response\RedirectResponse
92
     */
93
    public function createVariable(Request $request, $id)
94
    {
95
        $repo = new VariableRepository;
96
97
        try {
98
            $variable = $repo->create($id, $request->only([
99
                'name', 'description', 'env_variable',
100
                'default_value', 'options', 'rules',
101
            ]));
102
103
            Alert::success('New variable successfully assigned to this service option.')->flash();
104
        } catch (DisplayValidationException $ex) {
105
            return redirect()->route('admin.services.option.variables', $id)->withErrors(json_decode($ex->getMessage()));
106
        } catch (DisplayException $ex) {
107
            Alert::danger($ex->getMessage())->flash();
108
        } catch (\Exception $ex) {
109
            Log::error($ex);
110
            Alert::danger('An unhandled exception was encountered while attempting to process that request. This error has been logged.')->flash();
111
        }
112
113
        return redirect()->route('admin.services.option.variables', $id);
114
    }
115
116
    /**
117
     * Display option overview page.

app/Http/Controllers/Admin/DatabaseController.php 1 location

@@ 75-97 (lines=23) @@
72
     * @param  Request $request
73
     * @return \Illuminate\Response\RedirectResponse
74
     */
75
    public function create(Request $request)
76
    {
77
        $repo = new DatabaseRepository;
78
79
        try {
80
            $host = $repo->add($request->intersect([
81
                'name', 'username', 'password',
82
                'host', 'port', 'node_id',
83
            ]));
84
            Alert::success('Successfully created new database host on the system.')->flash();
85
86
            return redirect()->route('admin.databases.view', $host->id);
87
        } catch (\PDOException $ex) {
88
            Alert::danger($ex->getMessage())->flash();
89
        } catch (DisplayValidationException $ex) {
90
            return redirect()->route('admin.databases')->withErrors(json_decode($ex->getMessage()));
91
        } catch (\Exception $ex) {
92
            Log::error($ex);
93
            Alert::danger('An error was encountered while trying to process this request. This error has been logged.')->flash();
94
        }
95
96
        return redirect()->route('admin.databases');
97
    }
98
99
    /**
100
     * Handle post request to update a database host.