Code Duplication    Length = 4-4 lines in 7 locations

src/AppBundle/Controller/AdminScoreController.php 1 location

@@ 60-63 (lines=4) @@
57
58
        $projectData = ProjectRepository::getProject($project, $this->container);
59
60
        if (!$projectData->exists()) {
61
            $this->addFlash("notice", ["invalid-project", $project]);
62
            return $this->redirectToRoute("adminscore");
63
        }
64
65
        $dbName = $projectData->getDatabaseName();
66
        $wikiName = $projectData->getDatabaseName();

src/AppBundle/Controller/AdminStatsController.php 1 location

@@ 155-158 (lines=4) @@
152
        // Load the database information for the tool
153
        $projectData = ProjectRepository::getProject($project, $this->container);
154
155
        if (!$projectData->exists()) {
156
            $this->addFlash("notice", ["invalid-project", $project]);
157
            return $this->redirectToRoute("adminstats");
158
        }
159
160
        $dbName = $projectData->getDatabaseName();
161
        $wikiName = $projectData->getDatabaseName();

src/AppBundle/Controller/ArticleInfoController.php 1 location

@@ 82-85 (lines=4) @@
79
80
        $projectData = ProjectRepository::getProject($project, $this->container);
81
82
        if (!$projectData->exists()) {
83
            $this->addFlash("notice", ["invalid-project", $project]);
84
            return $this->redirectToRoute("articleInfo");
85
        }
86
87
        $projectUrl = $projectData->getUrl();
88

src/AppBundle/Controller/AutomatedEditsController.php 1 location

@@ 110-113 (lines=4) @@
107
        // Pull information about the project
108
        $projectData = ProjectRepository::getProject($project, $this->container);
109
110
        if (!$projectData->exists()) {
111
            $this->addFlash("notice", ["invalid-project", $project]);
112
            return $this->redirectToRoute("autoedits");
113
        }
114
115
        $dbName = $projectData->getDatabaseName();
116
        $projectUrl = $projectData->getUrl();

src/AppBundle/Controller/PagesController.php 1 location

@@ 101-104 (lines=4) @@
98
        $projectData = ProjectRepository::getProject($project, $this->container);
99
100
        // If the project exists, actually populate the values
101
        if (!$projectData->exists()) {
102
            $this->addFlash("notice", ["invalid-project", $project]);
103
            return $this->redirectToRoute("pages");
104
        }
105
106
        $dbName = $projectData->getDatabaseName();
107
        $projectUrl = $projectData->getUrl();

src/AppBundle/Controller/SimpleEditCounterController.php 1 location

@@ 63-66 (lines=4) @@
60
61
        $projectData = ProjectRepository::getProject($project, $this->container);
62
63
        if (!$projectData->exists()) {
64
            $this->addFlash("notice", ["invalid-project", $project]);
65
            return $this->redirectToRoute("SimpleEditCounter");
66
        }
67
68
        $dbName = $projectData->getDatabaseName();
69
        $url = $projectData->getUrl();

src/AppBundle/Controller/TopEditsController.php 1 location

@@ 99-102 (lines=4) @@
96
97
        $projectData = ProjectRepository::getProject($project, $this->container);
98
99
        if (!$projectData->exists()) {
100
            $this->addFlash("notice", ["invalid-project", $project]);
101
            return $this->redirectToRoute("topedits");
102
        }
103
104
        $user = new User($username);
105