Code Duplication    Length = 15-15 lines in 6 locations

core/process/queries/QueryManagerMysqlMonocleAlternate.php 3 locations

@@ 17-31 (lines=15) @@
14
	// Tester
15
	///////////
16
17
	function testTotalPokemon() {
18
		$req = "SELECT COUNT(*) as total FROM sightings";
19
		$result = $this->mysqli->query($req);
20
		if (!is_object($result)) {
21
			return 1;
22
		} else {
23
			$data = $result->fetch_object();
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 = $this->mysqli->query($req);
36
		if (!is_object($result)) {
37
			return 1;
38
		} else {
39
			$data = $result->fetch_object();
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 = $this->mysqli->query($req);
52
		if (!is_object($result)) {
53
			return 1;
54
		} else {
55
			$data = $result->fetch_object();
56
			$total = $data->total;
57
58
			if ($total == 0) {
59
				return 2;
60
			}
61
		}
62
		return 0;
63
	}
64
	
65
	
66
	/////////////

core/process/queries/QueryManagerMysqlRocketmap.php 3 locations

@@ 17-31 (lines=15) @@
14
	// Tester
15
	///////////
16
	
17
	function testTotalPokemon() {
18
		$req = "SELECT COUNT(*) as total FROM pokemon";
19
		$result = $this->mysqli->query($req);
20
		if (!is_object($result)) {
21
			return 1;
22
		} else {
23
			$data = $result->fetch_object();
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 gym";
@@ 33-47 (lines=15) @@
30
		return 0;
31
	}
32
	
33
	function testTotalGyms() {
34
		$req = "SELECT COUNT(*) as total FROM gym";
35
		$result = $this->mysqli->query($req);
36
		if (!is_object($result)) {
37
			return 1;
38
		} else {
39
			$data = $result->fetch_object();
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 pokestop";
@@ 49-63 (lines=15) @@
46
		return 0;
47
	}
48
	
49
	function testTotalPokestops() {
50
		$req = "SELECT COUNT(*) as total FROM pokestop";
51
		$result = $this->mysqli->query($req);
52
		if (!is_object($result)) {
53
			return 1;
54
		} else {
55
			$data = $result->fetch_object();
56
			$total = $data->total;
57
	
58
			if ($total == 0) {
59
				return 2;
60
			}
61
		}
62
		return 0;
63
	}
64
	
65
	
66
	/////////////