Code Duplication    Length = 9-9 lines in 3 locations

src/AppBundle/Controller/RfXAnalysisController.php 2 locations

@@ 152-160 (lines=9) @@
149
150
        $text = $page->getWikitext();
151
152
        if (!isset($text)) {
153
            $this->addFlash('notice', ['no-result', $pagename]);
154
            return $this->redirectToRoute(
155
                'rfxAnalysisProject',
156
                [
157
                    'project' => $projectData->getDatabaseName()
158
                ]
159
            );
160
        }
161
162
        $rfx = new RFX(
163
            $text,
@@ 174-182 (lines=9) @@
171
172
        $total = count($support) + count($oppose) + count($neutral);
173
174
        if ($total === 0) {
175
            $this->addFlash('notice', ['no-result', $pagename]);
176
            return $this->redirectToRoute(
177
                'rfxAnalysisProject',
178
                [
179
                    'project' => $projectData->getDatabaseName(),
180
                ]
181
            );
182
        }
183
184
        $end = $rfx->getEndDate();
185

src/AppBundle/Controller/EditSummaryController.php 1 location

@@ 157-165 (lines=9) @@
154
        }
155
        $resultQuery->execute();
156
157
        if ($resultQuery->errorCode() > 0) {
158
            $this->addFlash('notice', ['no-result', $username]);
159
            return $this->redirectToRoute(
160
                'EditSummaryProject',
161
                [
162
                    'project' => $project->getDomain()
163
                ]
164
            );
165
        }
166
167
        // Set defaults, so we don't get variable undefined errors
168
        $totalSummariesMajor = 0;