Code Duplication    Length = 11-12 lines in 4 locations

app/Http/Controllers/ProjectController.php 4 locations

@@ 61-71 (lines=11) @@
58
     *
59
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
60
     */
61
    public function getIndex(ProjectRepository $project)
62
    {
63
        $activities = $project->getRecentActivities($this->getLoggedUser());
64
65
        return $this->indexView([
66
            'activities'          => $activities,
67
            'notes_count'         => $project->countNotes(),
68
            'open_issues_count'   => $project->countOpenIssues($this->getLoggedUser()),
69
            'closed_issues_count' => $project->countClosedIssues($this->getLoggedUser()),
70
        ], 'activity', $project);
71
    }
72
73
    /**
74
     * Display issues for a project.
@@ 128-139 (lines=12) @@
125
     *
126
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
127
     */
128
    public function getAssigned(ProjectRepository $project)
129
    {
130
        $issues = $project->getAssignedOrCreatedIssues($this->getLoggedUser());
131
132
        return $this->indexView([
133
            'notes_count'           => $project->countNotes(),
134
            'open_issues_count'     => $project->countOpenIssues($this->getLoggedUser()),
135
            'closed_issues_count'   => $project->countClosedIssues($this->getLoggedUser()),
136
            'assigned_issues_count' => $issues->count(),
137
            'issues'                => $issues,
138
        ], 'activity', $project);
139
    }
140
141
    /**
142
     * Display issues created to current user for a project.
@@ 148-159 (lines=12) @@
145
     *
146
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
147
     */
148
    public function getCreated(ProjectRepository $project)
149
    {
150
        $issues = $project->getAssignedOrCreatedIssues($this->getLoggedUser());
151
152
        return $this->indexView([
153
            'notes_count'           => $project->countNotes(),
154
            'open_issues_count'     => $project->countOpenIssues($this->getLoggedUser()),
155
            'closed_issues_count'   => $project->countClosedIssues($this->getLoggedUser()),
156
            'assigned_issues_count' => $issues->count(),
157
            'issues'                => $issues,
158
        ], 'issue_created_by_you', $project);
159
    }
160
161
    /**
162
     * Display notes for a project.
@@ 169-180 (lines=12) @@
166
     *
167
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
168
     */
169
    public function getNotes(ProjectRepository $project, NoteForm $form)
170
    {
171
        $notes = $project->getNotes();
172
173
        return $this->indexView([
174
            'notes_count'         => $project->countNotes(),
175
            'open_issues_count'   => $project->countOpenIssues($this->getLoggedUser()),
176
            'closed_issues_count' => $project->countClosedIssues($this->getLoggedUser()),
177
            'notes'               => $notes,
178
            'notes_count'         => $notes->count(),
179
        ], 'notes', $project);
180
    }
181
182
    /**
183
     * @param Project $project