Code Duplication    Length = 17-18 lines in 4 locations

core/process/queries/QueryManagerMysqlMAD.php 1 location

@@ 231-248 (lines=18) @@
228
        return $points;
229
    }
230
231
    public function getPokemonGraph($pokemon_id)
232
    {
233
        $req = "SELECT COUNT(*) AS total,
234
				HOUR(CONVERT_TZ(disappear_time, '+00:00', '".self::$time_offset."')) AS disappear_hour
235
				FROM (SELECT disappear_time FROM pokemon WHERE pokemon_id = '".$pokemon_id."' LIMIT 100000) AS pokemonFiltered
236
				GROUP BY disappear_hour
237
				ORDER BY disappear_hour";
238
        $result = $this->mysqli->query($req);
239
        $array = array_fill(0, 24, 0);
240
        while ($result && $data = $result->fetch_object()) {
241
            $array[$data->disappear_hour] = $data->total;
242
        }
243
        // shift array because AM/PM starts at 1AM not 0:00
244
        $array[] = $array[0];
245
        array_shift($array);
246
247
        return $array;
248
    }
249
250
    public function getPokemonLive($pokemon_id, $ivMin, $ivMax, $inmap_pokemons)
251
    {

core/process/queries/QueryManagerMysqlMonocleAlternate.php 1 location

@@ 247-263 (lines=17) @@
244
        return $points;
245
    }
246
247
    public function getPokemonGraph($pokemon_id)
248
    {
249
        $req = "SELECT COUNT(*) AS total, HOUR(disappear_time) AS disappear_hour
250
					FROM (SELECT FROM_UNIXTIME(expire_timestamp) as disappear_time FROM sightings WHERE pokemon_id = '".$pokemon_id."' LIMIT 100000) AS pokemonFiltered
251
				GROUP BY disappear_hour
252
				ORDER BY disappear_hour";
253
        $result = $this->mysqli->query($req);
254
        $array = array_fill(0, 24, 0);
255
        while ($result && $data = $result->fetch_object()) {
256
            $array[$data->disappear_hour] = $data->total;
257
        }
258
        // shift array because AM/PM starts at 1AM not 0:00
259
        $array[] = $array[0];
260
        array_shift($array);
261
262
        return $array;
263
    }
264
265
    public function getPokemonLive($pokemon_id, $ivMin, $ivMax, $inmap_pokemons)
266
    {

core/process/queries/QueryManagerMysqlRealDeviceMap.php 1 location

@@ 221-237 (lines=17) @@
218
        return $points;
219
    }
220
221
    public function getPokemonGraph($pokemon_id)
222
    {
223
        $req = "SELECT COUNT(*) AS total, HOUR(disappear_time) AS disappear_hour
224
					FROM (SELECT FROM_UNIXTIME(expire_timestamp) as disappear_time FROM pokemon WHERE pokemon_id = '".$pokemon_id."' LIMIT 100000) AS pokemonFiltered
225
				GROUP BY disappear_hour
226
				ORDER BY disappear_hour";
227
        $result = $this->mysqli->query($req);
228
        $array = array_fill(0, 24, 0);
229
        while ($result && $data = $result->fetch_object()) {
230
            $array[$data->disappear_hour] = $data->total;
231
        }
232
        // shift array because AM/PM starts at 1AM not 0:00
233
        $array[] = $array[0];
234
        array_shift($array);
235
236
        return $array;
237
    }
238
239
    public function getPokemonLive($pokemon_id, $ivMin, $ivMax, $inmap_pokemons)
240
    {

core/process/queries/QueryManagerMysqlRocketmap.php 1 location

@@ 249-266 (lines=18) @@
246
        return $points;
247
    }
248
249
    public function getPokemonGraph($pokemon_id)
250
    {
251
        $req = "SELECT COUNT(*) AS total,
252
				HOUR(CONVERT_TZ(disappear_time, '+00:00', '".self::$time_offset."')) AS disappear_hour
253
				FROM (SELECT disappear_time FROM pokemon WHERE pokemon_id = '".$pokemon_id."' LIMIT 100000) AS pokemonFiltered
254
				GROUP BY disappear_hour
255
				ORDER BY disappear_hour";
256
        $result = $this->mysqli->query($req);
257
        $array = array_fill(0, 24, 0);
258
        while ($result && $data = $result->fetch_object()) {
259
            $array[$data->disappear_hour] = $data->total;
260
        }
261
        // shift array because AM/PM starts at 1AM not 0:00
262
        $array[] = $array[0];
263
        array_shift($array);
264
265
        return $array;
266
    }
267
268
    public function getPokemonLive($pokemon_id, $ivMin, $ivMax, $inmap_pokemons)
269
    {