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

@@ 485-489 (lines=5) @@
482
                        "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'"
483
                    );
484
                    $count_original_name = mysqli_num_rows($rs);
485
                    if ($overwrite == 'false') {
486
                        $newname = $name . '-' . str_replace('.', '_', $modx_version);
487
                        $rs = mysqli_query(
488
                            $sqlParser->conn,
489
                            "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'"
490
                        );
491
                        $count_new_name = mysqli_num_rows($rs);
492
                    }