Code Duplication    Length = 20-20 lines in 2 locations

core/process/queries/QueryManagerMysqlRocketmap.php 1 location

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

core/process/queries/QueryManagerMysqlMonocleAlternate.php 1 location

@@ 469-488 (lines=20) @@
466
		return $data;
467
	}
468
469
	public function getNestData() {
470
		$pokemon_exclude_sql = "";
471
		if (!empty(self::$config->system->nest_exclude_pokemon)) {
472
			$pokemon_exclude_sql = "AND p.pokemon_id NOT IN (" . implode(",", self::$config->system->nest_exclude_pokemon) . ")";
473
		}
474
		$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
475
			          FROM sightings p
476
			          INNER JOIN spawnpoints s ON (p.spawn_id = s.spawn_id)
477
			          WHERE p.expire_timestamp > UNIX_TIMESTAMP() - 86400
478
			          " . $pokemon_exclude_sql . "
479
			          GROUP BY p.spawn_id, p.pokemon_id
480
			          HAVING COUNT(p.pokemon_id) >= 6
481
			          ORDER BY p.pokemon_id";
482
		$result = $this->mysqli->query($req);
483
		$nests = array();
484
		while ($data = $result->fetch_object()) {
485
			$nests[] = $data;
486
		}
487
		return $nests;
488
	}
489
490
}