Code Duplication    Length = 15-15 lines in 6 locations

core/process/queries/QueryManagerMysqlMonocleAlternate.php 3 locations

@@ 21-35 (lines=15) @@
18
    // Tester
19
    ///////////
20
21
    public function testTotalPokemon()
22
    {
23
        $req = 'SELECT COUNT(*) as total FROM sightings';
24
        $result = $this->mysqli->query($req);
25
        if (!is_object($result)) {
26
            return 1;
27
        } else {
28
            $data = $result->fetch_object();
29
            $total = $data->total;
30
31
            if (0 == $total) {
32
                return 2;
33
            }
34
        }
35
36
        return 0;
37
    }
38
@@ 39-53 (lines=15) @@
36
        return 0;
37
    }
38
39
    public function testTotalGyms()
40
    {
41
        $req = 'SELECT COUNT(*) as total FROM forts';
42
        $result = $this->mysqli->query($req);
43
        if (!is_object($result)) {
44
            return 1;
45
        } else {
46
            $data = $result->fetch_object();
47
            $total = $data->total;
48
49
            if (0 == $total) {
50
                return 2;
51
            }
52
        }
53
54
        return 0;
55
    }
56
@@ 57-71 (lines=15) @@
54
        return 0;
55
    }
56
57
    public function testTotalPokestops()
58
    {
59
        $req = 'SELECT COUNT(*) as total FROM pokestops';
60
        $result = $this->mysqli->query($req);
61
        if (!is_object($result)) {
62
            return 1;
63
        } else {
64
            $data = $result->fetch_object();
65
            $total = $data->total;
66
67
            if (0 == $total) {
68
                return 2;
69
            }
70
        }
71
72
        return 0;
73
    }
74

core/process/queries/QueryManagerMysqlRocketmap.php 3 locations

@@ 21-35 (lines=15) @@
18
    // Tester
19
    ///////////
20
21
    public function testTotalPokemon()
22
    {
23
        $req = 'SELECT COUNT(*) as total FROM pokemon';
24
        $result = $this->mysqli->query($req);
25
        if (!is_object($result)) {
26
            return 1;
27
        } else {
28
            $data = $result->fetch_object();
29
            $total = $data->total;
30
31
            if (0 == $total) {
32
                return 2;
33
            }
34
        }
35
36
        return 0;
37
    }
38
@@ 39-53 (lines=15) @@
36
        return 0;
37
    }
38
39
    public function testTotalGyms()
40
    {
41
        $req = 'SELECT COUNT(*) as total FROM gym';
42
        $result = $this->mysqli->query($req);
43
        if (!is_object($result)) {
44
            return 1;
45
        } else {
46
            $data = $result->fetch_object();
47
            $total = $data->total;
48
49
            if (0 == $total) {
50
                return 2;
51
            }
52
        }
53
54
        return 0;
55
    }
56
@@ 57-71 (lines=15) @@
54
        return 0;
55
    }
56
57
    public function testTotalPokestops()
58
    {
59
        $req = 'SELECT COUNT(*) as total FROM pokestop';
60
        $result = $this->mysqli->query($req);
61
        if (!is_object($result)) {
62
            return 1;
63
        } else {
64
            $data = $result->fetch_object();
65
            $total = $data->total;
66
67
            if (0 == $total) {
68
                return 2;
69
            }
70
        }
71
72
        return 0;
73
    }
74