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

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

@@ 94-115 (lines=22) @@
91
     * @param  \Illuminate\Http\Request  $request
92
     * @return \Illuminate\Http\RedirectResponse
93
     */
94
    public function store(Request $request)
95
    {
96
        $repo = new ServiceRepository;
97
98
        try {
99
            $service = $repo->create($request->intersect([
100
                'name', 'description', 'folder', 'startup',
101
            ]));
102
            Alert::success('Successfully created new service!')->flash();
103
104
            return redirect()->route('admin.services.view', $service->id);
105
        } catch (DisplayValidationException $ex) {
106
            return redirect()->route('admin.services.new')->withErrors(json_decode($ex->getMessage()))->withInput();
107
        } catch (DisplayException $ex) {
108
            Alert::danger($ex->getMessage())->flash();
109
        } catch (\Exception $ex) {
110
            Log::error($ex);
111
            Alert::danger('An error occured while attempting to add a new service. This error has been logged.')->flash();
112
        }
113
114
        return redirect()->route('admin.services.new')->withInput();
115
    }
116
117
    /**
118
     * Edits configuration for a specific service.

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

@@ 252-271 (lines=20) @@
249
     * @param  int                       $id
250
     * @return \Illuminate\Http\RedirectResponse
251
     */
252
    public function setDetails(Request $request, $id)
253
    {
254
        $repo = new ServerRepository;
255
        try {
256
            $repo->updateDetails($id, $request->intersect([
257
                'owner_id', 'name', 'description', 'reset_token',
258
            ]));
259
260
            Alert::success('Server details were successfully updated.')->flash();
261
        } catch (DisplayValidationException $ex) {
262
            return redirect()->route('admin.servers.view.details', $id)->withErrors(json_decode($ex->getMessage()))->withInput();
263
        } catch (DisplayException $ex) {
264
            Alert::danger($ex->getMessage())->flash();
265
        } catch (\Exception $ex) {
266
            Log::error($ex);
267
            Alert::danger('An unhandled exception occured while attemping to update this server. This error has been logged.')->flash();
268
        }
269
270
        return redirect()->route('admin.servers.view.details', $id)->withInput();
271
    }
272
273
    /**
274
     * Set the new docker container for a server.

app/Http/Controllers/Base/APIController.php 1 location

@@ 75-96 (lines=22) @@
72
     * @param  \Illuminate\Http\Request  $request
73
     * @return \Illuminate\Http\RedirectResponse
74
     */
75
    public function store(Request $request)
76
    {
77
        try {
78
            $repo = new APIRepository($request->user());
79
            $secret = $repo->create($request->intersect([
80
                'memo', 'allowed_ips',
81
                'admin_permissions', 'permissions',
82
            ]));
83
            Alert::success('An API Key-Pair has successfully been generated. The API secret for this public key is shown below and will not be shown again.<br /><br /><code>' . $secret . '</code>')->flash();
84
85
            return redirect()->route('account.api');
86
        } catch (DisplayValidationException $ex) {
87
            return redirect()->route('account.api.new')->withErrors(json_decode($ex->getMessage()))->withInput();
88
        } catch (DisplayException $ex) {
89
            Alert::danger($ex->getMessage())->flash();
90
        } catch (\Exception $ex) {
91
            Log::error($ex);
92
            Alert::danger('An unhandled exception occured while attempting to add this API key.')->flash();
93
        }
94
95
        return redirect()->route('account.api.new')->withInput();
96
    }
97
98
    /**
99
     * Handle revoking API key.