Code Duplication    Length = 7-8 lines in 2 locations

htdocs/class/libraries/vendor/xoops/xmf/src/Xmf/Database/Tables.php 2 locations

@@ 628-635 (lines=8) @@
625
            $tableDef = $this->tables[$table];
626
            $colSql = '';
627
            $valSql = '';
628
            foreach ($tableDef['columns'] as $col) {
629
                $comma = empty($colSql) ? '' : ', ';
630
                if (isset($columns[$col['name']])) {
631
                    $colSql .= "{$comma}`{$col['name']}`";
632
                    $valSql .= $comma
633
                        . ($quoteValue ? $this->db->quote($columns[$col['name']]) : $columns[$col['name']]);
634
                }
635
            }
636
            $sql = "INSERT INTO `{$tableDef['name']}` ({$colSql}) VALUES({$valSql})";
637
            $this->queue[] = $sql;
638
@@ 666-672 (lines=7) @@
663
                $where = $criteria->renderWhere();
664
            }
665
            $colSql = '';
666
            foreach ($tableDef['columns'] as $col) {
667
                $comma = empty($colSql) ? '' : ', ';
668
                if (isset($columns[$col['name']])) {
669
                    $colSql .= "{$comma}`{$col['name']}` = "
670
                        . ($quoteValue ? $this->db->quote($columns[$col['name']]) : $columns[$col['name']]);
671
                }
672
            }
673
            $sql = "UPDATE `{$tableDef['name']}` SET {$colSql} {$where}";
674
            $this->queue[] = $sql;
675