XoopsModules25x/xfguestbook

View on GitHub

Showing 56 of 1,027 total issues

Method b_xfguestbook_show has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function b_xfguestbook_show($options)
{
    global $xoopsModule, $xoopsModuleConfig, $xoopsDB;
    /** @var Helper $helper */
    $helper = Helper::getInstance();
Severity: Minor
Found in blocks/xfguestbook_new.php - About 1 hr to fix

    Method xfguestbook_admin_menu has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function xfguestbook_admin_menu($currentoption = 0, $breadcrumb = '')
    {
        /* Nice buttons styles */
        echo "
            <style type='text/css'>
    Severity: Minor
    Found in include/cp_functions.php - About 1 hr to fix

      Method checkVerModule has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function checkVerModule($helper, $source = 'github', $default = 'master')
          {
              $moduleDirName      = \basename(dirname(__DIR__, 2));
              $moduleDirNameUpper = mb_strtoupper($moduleDirName);
              $update             = '';
      Severity: Minor
      Found in class/Common/VersionChecks.php - About 1 hr to fix

        Function banish has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        function banish()
        {
            global $msgHandler, $xoopsDB;
            $msg_count = (!empty($_POST['msg_id']) && is_array($_POST['msg_id'])) ? count($_POST['msg_id']) : 0;
            if ($msg_count > 0) {
        Severity: Minor
        Found in admin/main.php - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function loadTableFromArrayWithReplace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        function loadTableFromArrayWithReplace($table, $data, $search, $replace)
        {
            /** @var \XoopsMySQLDatabase $db */
            $db = \XoopsDatabaseFactory::getDatabaseConnection();
        
        
        Severity: Minor
        Found in testdata/index.php - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method badIpShow has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function badIpShow()
        {
            global $action, $start, $xoopsModule, $xoopsModuleConfig;
            $myts      = \MyTextSanitizer::getInstance();
            $limit     = 15;
        Severity: Minor
        Found in admin/ip_manager.php - About 1 hr to fix

          Method executeSQL has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function executeSQL($sql_file_path)
          {
              global $xoopsModule;
              $error = false;
              // $reservedTables = array('avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups','groups_users_link','group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish');
          Severity: Minor
          Found in include/cp_functions.php - About 1 hr to fix

            Method xoops_module_install_xfguestbook has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function xoops_module_install_xfguestbook(\XoopsModule $module)
            {
                require_once dirname(__DIR__) . '/preloads/autoloader.php';
            
                $moduleDirName = basename(dirname(__DIR__));
            Severity: Minor
            Found in include/oninstall.php - About 1 hr to fix

              Function rrmdir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function rrmdir($src)
                  {
                      // Only continue if user is a 'global' Admin
                      if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                          return false;
              Severity: Minor
              Found in class/Common/FilesManagement.php - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function delete has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              function delete()
              {
                  global $msgHandler, $xoopsModule;
                  $msg_count = (!empty($_POST['msg_id']) && is_array($_POST['msg_id'])) ? count($_POST['msg_id']) : 0;
                  if ($msg_count > 0) {
              Severity: Minor
              Found in admin/main.php - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method flagUpload has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function flagUpload($country_code)
              {
                  global $xoopsModule, $maxsize, $maxwidth, $maxheight, $format;
                  /** @var Helper $helper */
                  $helper = Helper::getInstance();
              Severity: Minor
              Found in admin/country_manager.php - About 1 hr to fix

                Method loadTableFromArrayWithReplace has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function loadTableFromArrayWithReplace($table, $data, $search, $replace)
                {
                    /** @var \XoopsMySQLDatabase $db */
                    $db = \XoopsDatabaseFactory::getDatabaseConnection();
                
                
                Severity: Minor
                Found in testdata/index.php - About 1 hr to fix

                  Method getServerStats has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function getServerStats()
                      {
                          //mb    $wfdownloads = WfdownloadsWfdownloads::getInstance();
                          $moduleDirName      = \basename(dirname(__DIR__, 2));
                          $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                  Severity: Minor
                  Found in class/Common/ServerStats.php - About 1 hr to fix

                    Function rmdirr has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function rmdirr($dirname)
                    {
                        // Simple delete for a file
                        if (is_file($dirname)) {
                            return unlink($dirname);
                    Severity: Minor
                    Found in include/onuninstall.php - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function xoops_module_install_xfguestbook has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function xoops_module_install_xfguestbook(\XoopsModule $module)
                    {
                        require_once dirname(__DIR__) . '/preloads/autoloader.php';
                    
                        $moduleDirName = basename(dirname(__DIR__));
                    Severity: Minor
                    Found in include/oninstall.php - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Method loadSampleData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function loadSampleData()
                    {
                        global $xoopsConfig;
                        $moduleDirName      = basename(dirname(__DIR__));
                        $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                    Severity: Minor
                    Found in testdata/index.php - About 1 hr to fix

                      Method xfguestbook_search has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function xfguestbook_search($queryarray, $andor, $limit, $offset, $user_id)
                      {
                          global $xoopsDB;
                          $sql = 'SELECT msg_id,user_id,title,post_time FROM ' . $xoopsDB->prefix('xfguestbook_msg') . ' WHERE moderate=0 ';
                          if (0 != $user_id) {
                      Severity: Minor
                      Found in include/search.inc.php - About 1 hr to fix

                        Method upload has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function upload()
                            {
                                global $xoopsModule, $preview_name, $msgstop;
                                /** @var Helper $helper */
                                $helper = Helper::getInstance();
                        Severity: Minor
                        Found in class/Utility.php - About 1 hr to fix

                          Function recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function recurseCopy($src, $dst)
                              {
                                  $dir = \opendir($src);
                                  //        @mkdir($dst);
                                  if (!@\mkdir($dst) && !\is_dir($dst)) {
                          Severity: Minor
                          Found in class/Common/FilesManagement.php - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function rcopy($src, $dest)
                              {
                                  // Only continue if user is a 'global' Admin
                                  if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                                      return false;
                          Severity: Minor
                          Found in class/Common/FilesManagement.php - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Severity
                          Category
                          Status
                          Source
                          Language