XoopsModules25x/xoopsinfo

View on GitHub
modules/xoopsinfo/admin/rescue.php

Summary

Maintainability
A
1 hr
Test Coverage

Avoid deeply nested control flow statements.
Open

                if (is_dir($dir)) {
                    if ($dh = opendir($dir)) {
                        while (false !== ($file = readdir($dh))) {
                            if ('dir' !== filetype($dir . '/' . $file) && 'index.html' !== $file && 'adminmenu.php' !== $file) {
                                @unlink($dir . '/' . $file);
Severity: Major
Found in modules/xoopsinfo/admin/rescue.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                    if (is_dir($dir)) {
                        if ($dh = opendir($dir)) {
                            while (false !== ($file = readdir($dh))) {
                                if ('dir' !== filetype($dir . '/' . $file) && 'index.html' !== $file) {
                                    @unlink($dir . '/' . $file);
    Severity: Major
    Found in modules/xoopsinfo/admin/rescue.php - About 45 mins to fix

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 34 and the first side effect is on line 15.
      Open

      <?php declare(strict_types=1);

      Line exceeds 120 characters; contains 137 characters
      Open

                      $sql = 'UPDATE ' . $xoopsDB->prefix('config') . ' SET conf_value="default" WHERE conf_name="theme_set" and conf_modid=0';

      Line exceeds 120 characters; contains 183 characters
      Open

                      $sql = 'UPDATE ' . $xoopsDB->prefix('config') . ' SET conf_value="' . $protector . '" WHERE conf_name="global_disabled" AND conf_modid=' . $isProtector->getVar('mid');

      Line exceeds 120 characters; contains 141 characters
      Open

              $sql = 'SELECT count(*) FROM ' . $xoopsDB->prefix('config') . ' WHERE conf_title="_MI_XI_PASSWORD" AND conf_value="' . $passwd . '"';

      Line exceeds 120 characters; contains 121 characters
      Open

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      Line exceeds 120 characters; contains 132 characters
      Open

          <link rel="stylesheet" type="text/css" media="screen" href="<?php echo XOOPS_URL . '/themes/' . $theme_set . '/style.css'; ?>"/>

      Line exceeds 120 characters; contains 121 characters
      Open

                                  <input type='radio' name='protector_ip' value='0' checked='checked'/><?php echo _MI_XI_NO; ?>

      Line exceeds 120 characters; contains 150 characters
      Open

                      $sql = 'UPDATE ' . $xoopsDB->prefix('config') . ' SET conf_value="' . $debug_mode . '" WHERE conf_name="debug_mode" and conf_modid=0';

      Line exceeds 120 characters; contains 125 characters
      Open

          <link rel="stylesheet" type="text/css" media="screen" href="<?php echo XOOPS_URL . '/modules/xoopsinfo/module.css'; ?>"/>

      Line exceeds 120 characters; contains 128 characters
      Open

                                  if ('dir' !== filetype($dir . '/' . $file) && 'index.html' !== $file && 'adminmenu.php' !== $file) {

      Closing brace indented incorrectly; expected 46 spaces, found 28
      Open

                                  } ?>><?php echo _MD_AM_DEBUGMODE0; ?></option>

      Closing brace indented incorrectly; expected 75 spaces, found 28
      Open

                                  } ?> /><?php echo _MI_XI_NO; ?>

      Line indented incorrectly; expected 0 spaces, found 28
      Open

                                  } ?>><?php echo _MD_AM_DEBUGMODE0; ?></option>

      Closing brace indented incorrectly; expected 46 spaces, found 28
      Open

                                  } ?>><?php echo _MD_AM_DEBUGMODE3; ?></option>

      Line indented incorrectly; expected 0 spaces, found 28
      Open

                                  } ?>><?php echo _MD_AM_DEBUGMODE1; ?></option>

      Closing brace indented incorrectly; expected 75 spaces, found 28
      Open

                                  } ?> /><?php echo _MI_XI_YES; ?>

      Line indented incorrectly; expected 0 spaces, found 28
      Open

                                  } ?>><?php echo _MD_AM_DEBUGMODE2; ?></option>

      Closing brace indented incorrectly; expected 46 spaces, found 28
      Open

                                  } ?>><?php echo _MD_AM_DEBUGMODE1; ?></option>

      Closing brace indented incorrectly; expected 46 spaces, found 28
      Open

                                  } ?>><?php echo _MD_AM_DEBUGMODE2; ?></option>

      Line indented incorrectly; expected 0 spaces, found 28
      Open

                                  } ?>><?php echo _MD_AM_DEBUGMODE3; ?></option>

      Line indented incorrectly; expected 0 spaces, found 28
      Open

                                  } ?> /><?php echo _MI_XI_YES; ?>

      Line indented incorrectly; expected 0 spaces, found 28
      Open

                                  } ?> /><?php echo _MI_XI_NO; ?>

      There are no issues that match your filters.

      Category
      Status