Code Duplication    Length = 15-15 lines in 3 locations

core/process/queries/QueryManagerPostgresqlMonocleAlternate.php 3 locations

@@ 17-31 (lines=15) @@
14
	// Tester
15
	///////////
16
17
	function testTotalPokemon() {
18
		$req = "SELECT COUNT(*) as total FROM sightings";
19
		$result = pg_query($this->db, $req);
20
		if ($result === false) {
21
			return 1;
22
		} else {
23
			$data = pg_fetch_object($result);
24
			$total = $data->total;
25
26
			if ($total == 0) {
27
				return 2;
28
			}
29
		}
30
		return 0;
31
	}
32
33
	function testTotalGyms() {
34
		$req = "SELECT COUNT(*) as total FROM forts";
@@ 33-47 (lines=15) @@
30
		return 0;
31
	}
32
33
	function testTotalGyms() {
34
		$req = "SELECT COUNT(*) as total FROM forts";
35
		$result = pg_query($this->db, $req);
36
		if ($result === false) {
37
			return 1;
38
		} else {
39
			$data = pg_fetch_object($result);
40
			$total = $data->total;
41
42
			if ($total == 0) {
43
				return 2;
44
			}
45
		}
46
		return 0;
47
	}
48
49
	function testTotalPokestops() {
50
		$req = "SELECT COUNT(*) as total FROM pokestops";
@@ 49-63 (lines=15) @@
46
		return 0;
47
	}
48
49
	function testTotalPokestops() {
50
		$req = "SELECT COUNT(*) as total FROM pokestops";
51
		$result = pg_query($this->db, $req);
52
		if ($result === false) {
53
			return 1;
54
		} else {
55
			$data = pg_fetch_object($result);
56
			$total = $data->total;
57
58
			if ($total == 0) {
59
				return 2;
60
			}
61
		}
62
		return 0;
63
	}
64
65
66
	/////////////