Code Duplication    Length = 21-21 lines in 2 locations

core/process/queries/QueryManagerMysqlMonocleAlternate.php 1 location

@@ 177-197 (lines=21) @@
174
		return $top;
175
	}
176
177
	function getTop50Trainers($pokemon_id, $best_order_by, $best_direction) {
178
		$trainer_blacklist = "";
179
		if (!empty(self::$config->system->trainer_blacklist)) {
180
			$trainer_blacklist = " AND owner_name NOT IN ('" . implode("','", self::$config->system->trainer_blacklist) . "')";
181
		}
182
183
		$req = "SELECT owner_name as trainer_name, ROUND((100*((atk_iv)+(def_iv)+(sta_iv))/45),1) AS IV, move_1, move_2, cp as cp,
184
                FROM_UNIXTIME(last_modified) AS lasttime, last_modified as last_seen
185
                FROM gym_defenders
186
				WHERE pokemon_id = '" . $pokemon_id . "'" . $trainer_blacklist . "
187
				GROUP BY external_id 
188
				ORDER BY $best_order_by $best_direction, owner_name ASC
189
				LIMIT 0,50";
190
191
		$result = $this->mysqli->query($req);
192
		$toptrainer = array();
193
		while ($data = $result->fetch_object()) {
194
			$toptrainer[] = $data;
195
		}
196
		return $toptrainer;
197
	}
198
199
	public function getPokemonHeatmap($pokemon_id, $start, $end) {
200
		$where = " WHERE pokemon_id = ".$pokemon_id." "

core/process/queries/QueryManagerMysqlRocketmap.php 1 location

@@ 178-198 (lines=21) @@
175
		return $top;
176
	}
177
178
	function getTop50Trainers($pokemon_id, $best_order_by, $best_direction) {
179
		$trainer_blacklist = "";
180
		if (!empty(self::$config->system->trainer_blacklist)) {
181
			$trainer_blacklist = " AND trainer_name NOT IN ('".implode("','", self::$config->system->trainer_blacklist)."')";
182
		}
183
184
		$req = "SELECT trainer_name, ROUND(SUM(100*(iv_attack+iv_defense+iv_stamina)/45),1) AS IV, move_1, move_2, cp,
185
						DATE_FORMAT(last_seen, '%Y-%m-%d') AS lasttime, last_seen
186
						FROM gympokemon
187
						WHERE pokemon_id = '".$pokemon_id."'".$trainer_blacklist."
188
						GROUP BY pokemon_uid
189
						ORDER BY $best_order_by $best_direction, trainer_name ASC
190
						LIMIT 0,50";
191
192
		$result = $this->mysqli->query($req);
193
		$toptrainer = array();
194
		while ($data = $result->fetch_object()) {
195
			$toptrainer[] = $data;
196
		}
197
		return $toptrainer;
198
	}
199
200
	public function getPokemonHeatmap($pokemon_id, $start, $end) {
201
		$where = " WHERE pokemon_id = ".$pokemon_id." "