Code Duplication    Length = 5-5 lines in 2 locations

install/cli-install.php 1 location

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

install/src/controllers/install.php 1 location

@@ 487-491 (lines=5) @@
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
                    }