Code Duplication    Length = 21-21 lines in 2 locations

core/process/queries/QueryManagerMysqlMonocleAlternate.php 1 location

@@ 695-715 (lines=21) @@
692
		return $data;
693
	}
694
695
	public function getNestData($time, $minLatitude, $maxLatitude, $minLongitude, $maxLongitude) {
696
		$pokemon_exclude_sql = "";
697
		if (!empty(self::$config->system->nest_exclude_pokemon)) {
698
			$pokemon_exclude_sql = "AND p.pokemon_id NOT IN (" . implode(",", self::$config->system->nest_exclude_pokemon) . ")";
699
		}
700
		$req = "SELECT p.pokemon_id, MAX(p.lat) AS latitude, MAX(p.lon) AS longitude, count(p.pokemon_id) AS total_pokemon, MAX(s.updated) as latest_seen, coalesce(CASE WHEN MAX(duration) = 0 THEN NULL ELSE MAX(duration) END ,30)*60 as duration
701
			          FROM sightings p
702
			          INNER JOIN spawnpoints s ON (p.spawn_id = s.spawn_id)
703
			          WHERE p.expire_timestamp > UNIX_TIMESTAMP() - ".($time * 3600)."
704
			            AND p.lat >= ".$minLatitude." AND p.lat < ".$maxLatitude." AND p.lon >= ".$minLongitude." AND p.lon < ".$maxLongitude."
705
			          " . $pokemon_exclude_sql . "
706
			          GROUP BY p.spawn_id, p.pokemon_id
707
			          HAVING COUNT(p.pokemon_id) >= ".($time / 4)."
708
			          ORDER BY p.pokemon_id";
709
		$result = $this->mysqli->query($req);
710
		$nests = array();
711
		while ($data = $result->fetch_object()) {
712
			$nests[] = $data;
713
		}
714
		return $nests;
715
	}
716
717
	public function getSpawnpointCount($minLatitude, $maxLatitude, $minLongitude, $maxLongitude) {
718
		$req = "SELECT COUNT(*) as total 

core/process/queries/QueryManagerMysqlRocketmap.php 1 location

@@ 682-702 (lines=21) @@
679
		return $data;
680
	}
681
682
	public function getNestData($time, $minLatitude, $maxLatitude, $minLongitude, $maxLongitude) {
683
		$pokemon_exclude_sql = "";
684
		if (!empty(self::$config->system->nest_exclude_pokemon)) {
685
			$pokemon_exclude_sql = "AND p.pokemon_id NOT IN (".implode(",", self::$config->system->nest_exclude_pokemon).")";
686
		}
687
		$req = "SELECT p.pokemon_id, MAX(p.latitude) AS latitude, MAX(p.longitude) AS longitude, count(p.pokemon_id) AS total_pokemon, MAX(UNIX_TIMESTAMP(s.latest_seen)) as latest_seen, (LENGTH(s.kind) - LENGTH( REPLACE ( MAX(kind), \"s\", \"\") )) * 900 AS duration
688
			          FROM pokemon p
689
			          INNER JOIN spawnpoint s ON (p.spawnpoint_id = s.id)
690
			          WHERE p.disappear_time > UTC_TIMESTAMP() - INTERVAL ".($time)." HOUR
691
			            AND p.latitude >= ".$minLatitude." AND p.latitude < ".$maxLatitude." AND p.longitude >= ".$minLongitude." AND p.longitude < ".$maxLongitude."
692
			          " . $pokemon_exclude_sql . "
693
			          GROUP BY p.spawnpoint_id, p.pokemon_id
694
			          HAVING COUNT(p.pokemon_id) >= ".($time / 4)."
695
			          ORDER BY p.pokemon_id";
696
		$result = $this->mysqli->query($req);
697
		$nests = array();
698
		while ($data = $result->fetch_object()) {
699
			$nests[] = $data;
700
		}
701
		return $nests;
702
	}
703
704
	public function getSpawnpointCount($minLatitude, $maxLatitude, $minLongitude, $maxLongitude) {
705
		$req = "SELECT COUNT(*) as total