Code Duplication    Length = 5-8 lines in 4 locations

upgrade/class/dbmanager.php 4 locations

@@ 111-115 (lines=5) @@
108
                    }
109
                } elseif ($prefixed_query[1] === 'INSERT INTO') {
110
                    if ($this->db->query($prefixed_query[0]) !== false) {
111
                        if (!isset($this->s_tables['insert'][$table])) {
112
                            $this->s_tables['insert'][$table] = 1;
113
                        } else {
114
                            $this->s_tables['insert'][$table]++;
115
                        }
116
                    } else {
117
                        if (!isset($this->f_tables['insert'][$table])) {
118
                            $this->f_tables['insert'][$table] = 1;
@@ 116-122 (lines=7) @@
113
                        } else {
114
                            $this->s_tables['insert'][$table]++;
115
                        }
116
                    } else {
117
                        if (!isset($this->f_tables['insert'][$table])) {
118
                            $this->f_tables['insert'][$table] = 1;
119
                        } else {
120
                            $this->f_tables['insert'][$table]++;
121
                        }
122
                    }
123
                } elseif ($prefixed_query[1] === 'ALTER TABLE') {
124
                    if ($this->db->query($prefixed_query[0]) !== false) {
125
                        if (!isset($this->s_tables['alter'][$table])) {
@@ 246-250 (lines=5) @@
243
        $table = $this->db->prefix($table);
244
        $query = 'INSERT INTO ' . $table . ' ' . $query;
245
        if (!$this->db->queryF($query)) {
246
            if (!isset($this->f_tables['insert'][$table])) {
247
                $this->f_tables['insert'][$table] = 1;
248
            } else {
249
                $this->f_tables['insert'][$table]++;
250
            }
251
252
            return false;
253
        } else {
@@ 253-260 (lines=8) @@
250
            }
251
252
            return false;
253
        } else {
254
            if (!isset($this->s_tables['insert'][$table])) {
255
                $this->s_tables['insert'][$table] = 1;
256
            } else {
257
                $this->s_tables['insert'][$table]++;
258
            }
259
260
            return $this->db->getInsertId();
261
        }
262
    }
263