XoopsModules25x/xoopstube

View on GitHub

Showing 188 of 2,792 total issues

File Utility.php has 2304 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace XoopsModules\Xoopstube;

/*
Severity: Major
Found in class/Utility.php - About 6 days to fix

    Method getSocialBookmarks has 672 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function getSocialBookmarks($lid)
    {
        global $xoopsModule;
    
    //    $myts           = new Xoopstube\TextSanitizer();
    Severity: Major
    Found in sbookmarks.php - About 3 days to fix

      Utility has 95 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Utility extends Common\SysUtility
      {
          //--------------- Custom module methods -----------------------------
      
          public const MODULE_NAME = 'xoopstube';
      Severity: Major
      Found in class/Utility.php - About 1 day to fix

        File xoops_version.php has 761 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         * Module: XoopsTube
         *
        Severity: Major
        Found in xoops_version.php - About 1 day to fix

          File sbookmarks.php has 677 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           * Module: XoopsTube
           *
          Severity: Major
          Found in sbookmarks.php - About 1 day to fix

            Method unhtml has 258 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function unhtml($chaine)
                {
                    $search = $replace = [];
                    $chaine = \html_entity_decode($chaine);
            
            
            Severity: Major
            Found in class/Utility.php - About 1 day to fix

              Method listBlocks has 212 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function listBlocks()
                  {
                      global $xoopsModule, $pathIcon16;
                      require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                      $moduleDirName = basename(dirname(__DIR__));
              Severity: Major
              Found in admin/blocksadmin.php - About 1 day to fix

                Function truncateHtml has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
                    {
                        if ($considerHtml) {
                            // if the plain text is shorter than the maximum length, return the whole text
                            if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
                Severity: Minor
                Found in class/Common/SysUtility.php - About 1 day 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

                File blocksadmin.php has 500 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * You may not change or alter any portion of this comment or credits
                 * of supporting developers from this source code or any supporting source code
                 * which is considered copyrighted (c) material of the original comment or credit authors.
                Severity: Minor
                Found in admin/blocksadmin.php - About 1 day to fix

                  File admin.php has 488 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * Module: XoopsTube
                   *
                  Severity: Minor
                  Found in language/english/admin.php - About 7 hrs to fix

                    Method edit has 192 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function edit($lid = 0)
                    {
                        global $myts, $mytree, $xtubeImageArray;
                    
                        $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE lid=' . $lid;
                    Severity: Major
                    Found in admin/main.php - About 7 hrs to fix

                      File main.php has 474 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * Module: XoopsTube
                       *
                       * You may not change or alter any portion of this comment or credits
                      Severity: Minor
                      Found in admin/main.php - About 7 hrs to fix

                        Method renderAdminMenu has 175 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function renderAdminMenu($header = '', $menu = '', $extra = '', $scount = 4)
                            {
                                global $xoopsModule;
                        
                                $_named_vidid = \xoops_getenv('SCRIPT_NAME');
                        Severity: Major
                        Found in class/Utility.php - About 7 hrs to fix

                          Function renderAdminMenu has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function renderAdminMenu($header = '', $menu = '', $extra = '', $scount = 4)
                              {
                                  global $xoopsModule;
                          
                                  $_named_vidid = \xoops_getenv('SCRIPT_NAME');
                          Severity: Minor
                          Found in class/Utility.php - About 6 hrs 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 listBlocks has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                          Open

                              function listBlocks()
                              {
                                  global $xoopsModule, $pathIcon16;
                                  require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                                  $moduleDirName = basename(dirname(__DIR__));
                          Severity: Minor
                          Found in admin/blocksadmin.php - About 6 hrs 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 createCategory has 154 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function createCategory($cid = 0)
                          {
                              // require_once  dirname(__DIR__) . '/class/xoopstube_lists.php';
                              //    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
                          
                          
                          Severity: Major
                          Found in admin/category.php - About 6 hrs to fix

                            Function displayIcons has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static function displayIcons($time, $status = 0, $counter = 0)
                                {
                                    global $xoopsModule;
                            
                                    $new = '';
                            Severity: Minor
                            Found in class/Utility.php - About 5 hrs 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

                            File category.php has 380 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            /**
                             * Module: XoopsTube
                             *
                             * You may not change or alter any portion of this comment or credits
                            Severity: Minor
                            Found in admin/category.php - About 5 hrs to fix

                              File xoopstube_top.php has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              /**
                               * Module: XoopsTube
                               *
                               * You may not change or alter any portion of this comment or credits
                              Severity: Minor
                              Found in blocks/xoopstube_top.php - About 4 hrs to fix

                                Method xtubeShowVideo has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function xtubeShowVideo($vidid, $source, $screenshot, $picurl)
                                {
                                    global $xoopsModule;
                                    $showvideo = '';
                                    $autoplay  = $GLOBALS['xoopsModuleConfig']['autoplay'];
                                Severity: Major
                                Found in include/video.php - About 4 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language