Code Duplication    Length = 6-8 lines in 2 locations

install/cli-install.php 1 location

@@ 1141-1146 (lines=6) @@
1138
                $rs = mysqli_query($sqlParser->conn,
1139
                    "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'");
1140
                $count_original_name = mysqli_num_rows($rs);
1141
                if ($overwrite == 'false') {
1142
                    $newname = $name . '-' . str_replace('.', '_', $modx_version);
1143
                    $rs = mysqli_query($sqlParser->conn,
1144
                        "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'");
1145
                    $count_new_name = mysqli_num_rows($rs);
1146
                }
1147
                $update = $count_original_name > 0 && $overwrite == 'true';
1148
                if ($update) {
1149
                    if (!mysqli_query($sqlParser->conn,

install/src/controllers/install.php 1 location

@@ 487-494 (lines=8) @@
484
                        "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'"
485
                    );
486
                    $count_original_name = mysqli_num_rows($rs);
487
                    if ($overwrite == 'false') {
488
                        $newname = $name . '-' . str_replace('.', '_', $modx_version);
489
                        $rs = mysqli_query(
490
                            $sqlParser->conn,
491
                            "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'"
492
                        );
493
                        $count_new_name = mysqli_num_rows($rs);
494
                    }
495
                    $update = $count_original_name > 0 && $overwrite === 'true';
496
                    if ($update) {
497
                        $installDataLevel['chunks'][$moduleChunk[0]]['type'] = 'update';