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 = 24-28 lines in 2 locations

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

@@ 61-84 (lines=24) @@
58
     * @param  \Illuminate\Http\Request  $request
59
     * @return \Illuminate\Response\RedirectResponse
60
     */
61
    public function store(Request $request)
62
    {
63
        $repo = new OptionRepository;
64
65
        try {
66
            $option = $repo->create($request->intersect([
67
                'service_id', 'name', 'description', 'tag',
68
                'docker_image', 'startup', 'config_from', 'config_startup',
69
                'config_logs', 'config_files', 'config_stop',
70
            ]));
71
            Alert::success('Successfully created new service option.')->flash();
72
73
            return redirect()->route('admin.services.option.view', $option->id);
74
        } catch (DisplayValidationException $ex) {
75
            return redirect()->route('admin.services.option.new')->withErrors(json_decode($ex->getMessage()))->withInput();
76
        } catch (DisplayException $ex) {
77
            Alert::danger($ex->getMessage())->flash();
78
        } catch (\Exception $ex) {
79
            Log::error($ex);
80
            Alert::danger('An unhandled exception occurred while attempting to create this service. This error has been logged.')->flash();
81
        }
82
83
        return redirect()->route('admin.services.option.new')->withInput();
84
    }
85
86
    /**
87
     * Handles POST request to create a new option variable.

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

@@ 81-108 (lines=28) @@
78
     * @param  \Illuminate\Http\Request  $request
79
     * @return \Illuminate\Http\RedirectResponse
80
     */
81
    public function store(Request $request)
82
    {
83
        try {
84
            $repo = new NodeRepository;
85
            $node = $repo->create(array_merge(
86
                $request->only([
87
                    'public', 'disk_overallocate', 'memory_overallocate',
88
                ]),
89
                $request->intersect([
90
                    'name', 'location_id', 'fqdn',
91
                    'scheme', 'memory', 'disk',
92
                    'daemonBase', 'daemonSFTP', 'daemonListen',
93
                ])
94
            ));
95
            Alert::success('Successfully created new node that can be configured automatically on your remote machine by visiting the configuration tab. <strong>Before you can add any servers you need to first assign some IP addresses and ports.</strong>')->flash();
96
97
            return redirect()->route('admin.nodes.view', $node->id);
98
        } catch (DisplayValidationException $e) {
99
            return redirect()->route('admin.nodes.new')->withErrors(json_decode($e->getMessage()))->withInput();
100
        } catch (DisplayException $e) {
101
            Alert::danger($e->getMessage())->flash();
102
        } catch (\Exception $e) {
103
            Log::error($e);
104
            Alert::danger('An unhandled exception occured while attempting to add this node. Please try again.')->flash();
105
        }
106
107
        return redirect()->route('admin.nodes.new')->withInput();
108
    }
109
110
    /**
111
     * Shows the index overview page for a specific node.