Code Duplication    Length = 20-20 lines in 2 locations

core/process/queries/QueryManagerMysqlMonocleAlternate.php 1 location

@@ 464-483 (lines=20) @@
461
		return $data;
462
	}
463
464
	public function getNestData() {
465
		$pokemon_exclude_sql = "";
466
		if (!empty(self::$config->system->nest_exclude_pokemon)) {
467
			$pokemon_exclude_sql = "AND p.pokemon_id NOT IN (" . implode(",", self::$config->system->nest_exclude_pokemon) . ")";
468
		}
469
		$req = "SELECT p.pokemon_id, p.lat AS latitude, p.lon AS longitude, count(p.pokemon_id) AS total_pokemon, FROM_UNIXTIME(s.updated) as latest_seen, coalesce(duration,30)*60 as duration
470
			          FROM sightings p
471
			          INNER JOIN spawnpoints s ON (p.spawn_id = s.spawn_id)
472
			          WHERE p.expire_timestamp > UNIX_TIMESTAMP() - 86400
473
			          " . $pokemon_exclude_sql . "
474
			          GROUP BY p.spawn_id, p.pokemon_id
475
			          HAVING COUNT(p.pokemon_id) >= 6
476
			          ORDER BY p.pokemon_id";
477
		$result = $this->mysqli->query($req);
478
		$nests = array();
479
		while ($data = $result->fetch_object()) {
480
			$nests[] = $data;
481
		}
482
		return $nests;
483
	}
484
485
}

core/process/queries/QueryManagerMysqlRocketmap.php 1 location

@@ 571-590 (lines=20) @@
568
		return $data;
569
	}
570
571
	public function getNestData() {
572
		$pokemon_exclude_sql = "";
573
		if (!empty(self::$config->system->nest_exclude_pokemon)) {
574
			$pokemon_exclude_sql = "AND p.pokemon_id NOT IN (".implode(",", self::$config->system->nest_exclude_pokemon).")";
575
		}
576
		$req = "SELECT p.pokemon_id, max(p.latitude) AS latitude, max(p.longitude) AS longitude, count(p.pokemon_id) AS total_pokemon, s.latest_seen, (LENGTH(s.kind) - LENGTH( REPLACE ( kind, \"s\", \"\") )) * 900 AS duration
577
			          FROM pokemon p 
578
			          INNER JOIN spawnpoint s ON (p.spawnpoint_id = s.id) 
579
			          WHERE p.disappear_time > UTC_TIMESTAMP() - INTERVAL 24 HOUR 
580
			          " . $pokemon_exclude_sql . " 
581
			          GROUP BY p.spawnpoint_id, p.pokemon_id 
582
			          HAVING COUNT(p.pokemon_id) >= 6 
583
			          ORDER BY p.pokemon_id";
584
		$result = $this->mysqli->query($req);
585
		$nests = array();
586
		while ($data = $result->fetch_object()) {
587
			$nests[] = $data;
588
		}
589
		return $nests;
590
	}
591
592
}