Code Duplication    Length = 4-4 lines in 6 locations

src/AppBundle/Controller/AdminScoreController.php 1 location

@@ 84-87 (lines=4) @@
81
        $projectData = ProjectRepository::getProject($project, $this->container);
82
        $projectRepo = $projectData->getRepository();
83
84
        if (!$projectData->exists()) {
85
            $this->addFlash("notice", ["invalid-project", $project]);
86
            return $this->redirectToRoute("adminscore");
87
        }
88
89
        $dbName = $projectData->getDatabaseName();
90

src/AppBundle/Controller/AdminStatsController.php 1 location

@@ 148-151 (lines=4) @@
145
        $projectData = ProjectRepository::getProject($project, $this->container);
146
        $projectRepo = $projectData->getRepository();
147
148
        if (!$projectData->exists()) {
149
            $this->addFlash('notice', ['invalid-project', $project]);
150
            return $this->redirectToRoute('adminstats');
151
        }
152
153
        $dbName = $projectData->getDatabaseName();
154

src/AppBundle/Controller/TopEditsController.php 1 location

@@ 103-106 (lines=4) @@
100
    {
101
        $projectData = ProjectRepository::getProject($project, $this->container);
102
103
        if (!$projectData->exists()) {
104
            $this->addFlash("notice", ["invalid-project", $project]);
105
            return $this->redirectToRoute("topedits");
106
        }
107
108
        $user = UserRepository::getUser($username, $this->container);
109

src/AppBundle/Controller/AutomatedEditsController.php 1 location

@@ 128-131 (lines=4) @@
125
        // Pull information about the project
126
        $projectData = ProjectRepository::getProject($project, $this->container);
127
128
        if (!$projectData->exists()) {
129
            $this->addFlash('notice', ['invalid-project', $project]);
130
            return $this->redirectToRoute('autoedits');
131
        }
132
133
        $dbName = $projectData->getDatabaseName();
134

src/AppBundle/Controller/ArticleInfoController.php 1 location

@@ 116-119 (lines=4) @@
113
        $projectQuery = $request->attributes->get('project');
114
        $project = ProjectRepository::getProject($projectQuery, $this->container);
115
        $this->projectRepo = $project->getRepository();
116
        if (!$project->exists()) {
117
            $this->addFlash('notice', ['invalid-project', $projectQuery]);
118
            return $this->redirectToRoute('articleInfo');
119
        }
120
        $this->dbName = $project->getDatabaseName();
121
122
        $pageQuery = $request->attributes->get('article');

src/AppBundle/Controller/PagesController.php 1 location

@@ 125-128 (lines=4) @@
122
        $projectRepo = $projectData->getRepository();
123
124
        // If the project exists, actually populate the values
125
        if (!$projectData->exists()) {
126
            $this->addFlash('notice', ['invalid-project', $project]);
127
            return $this->redirectToRoute('pages');
128
        }
129
        if (!$user->existsOnProject($projectData)) {
130
            $this->addFlash('notice', ['user-not-found']);
131
            return $this->redirectToRoute('pages');