Code Duplication    Length = 20-20 lines in 2 locations

core/process/queries/QueryManagerMonocleHydro.php 1 location

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

core/process/queries/QueryManagerRocketmap.php 1 location

@@ 572-591 (lines=20) @@
569
		return $data;
570
	}
571
572
	public function getNestData() {
573
		$pokemon_exclude_sql = "";
574
		if (!empty(self::$config->system->nest_exclude_pokemon)) {
575
			$pokemon_exclude_sql = "AND p.pokemon_id NOT IN (".implode(",", self::$config->system->nest_exclude_pokemon).")";
576
		}
577
		$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
578
			          FROM pokemon p 
579
			          INNER JOIN spawnpoint s ON (p.spawnpoint_id = s.id) 
580
			          WHERE p.disappear_time > UTC_TIMESTAMP() - INTERVAL 24 HOUR 
581
			          " . $pokemon_exclude_sql . " 
582
			          GROUP BY p.spawnpoint_id, p.pokemon_id 
583
			          HAVING COUNT(p.pokemon_id) >= 6 
584
			          ORDER BY p.pokemon_id";
585
		$result = $this->mysqli->query($req);
586
		$nests = array();
587
		while ($data = $result->fetch_object()) {
588
			$nests[] = $data;
589
		}
590
		return $nests;
591
	}
592
593
}