XoopsModules25x/xoopstube

View on GitHub

Showing 188 of 2,792 total issues

Method fileChecks has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function fileChecks()
    {
        echo '<fieldset>';
        echo '<legend style="color: #990000; font-weight: bold;">' . \_AM_XOOPSTUBE_FILECHECKS . '</legend>';

Severity: Minor
Found in class/Utility.php - About 1 hr to fix

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

    function xtubeShowBannerB($options)
    {
        $moduleDirName = \basename(\dirname(__DIR__));
    
        $block = [];
    Severity: Minor
    Found in blocks/xoopstube_banner.php - About 1 hr to fix

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

          function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
          {
              $myblock = new \XoopsBlock($bid);
              $myblock->setVar('title', $btitle);
              $myblock->setVar('weight', $bweight);
      Severity: Minor
      Found in admin/blocksadmin.php - About 1 hr to fix

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

            public static function getDirectoryStatus($path, $mode = 0777, $redirectFile = null)
            {
                global $pathIcon16;
        
                if (empty($path)) {
        Severity: Minor
        Found in class/Common/DirectoryChecker.php - About 1 hr to fix

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

              public function &getListTypeAsArray()
              {
                  $filelist = [];
                  switch (\trim($this->type)) {
                      case 'images':
          Severity: Minor
          Found in class/FileList.php - About 1 hr to fix

            Method getListTypeAsArray has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function getListTypeAsArray($dirname, $type = '', $prefix = '', $noselection = 1)
                {
                    $filelist = [];
                    switch (\trim($type)) {
                        case 'images':
            Severity: Minor
            Found in class/Lists.php - About 1 hr to fix

              Method makeTreeCheckTable has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function makeTreeCheckTable(Xoopstube\Tree $xt, $itemid, $title, $checks, $order = '')
              {
                  global $myts;
              
                  echo '<div style="text-align: left;">';
              Severity: Minor
              Found in admin/altcat.php - About 1 hr to fix

                Function close_tags has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function close_tags($string)
                    {
                        // match opened tags
                        if (\preg_match_all('/<([a-z\:\-]+)[^\/]>/', $string, $start_tags)) {
                            $start_tags = $start_tags[1];
                Severity: Minor
                Found in class/Utility.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 createCategory has a Cognitive Complexity of 14 (exceeds 5 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: Minor
                Found in admin/category.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 createMetaKeywords has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function createMetaKeywords($content)
                    {
                        $keywordscount = self::getModuleOption('metagen_maxwords');
                        $keywordsorder = self::getModuleOption('metagen_order');
                
                
                Severity: Minor
                Found in class/Utility.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 uploadFile has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function uploadFile(
                        $indice,
                        $dstpath = XOOPS_UPLOAD_PATH,
                        $mimeTypes = null,
                        $uploadMaxSize = null,
                Severity: Minor
                Found in class/Utility.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 getTimestamp has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getTimestamp($time)
                    {
                        $moduleDirName = \basename(\dirname(__DIR__));
                        \xoops_loadLanguage('local', $moduleDirName);
                
                
                Severity: Minor
                Found in class/Utility.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

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

                    function xtubeGetVideoPublisher($vidid, $publisher, $source = 0)
                    {
                        switch ($source) {
                            // Determine if video source YouTube for publisher
                            case 0:
                    Severity: Minor
                    Found in include/video.php - About 1 hr to fix

                      Method cloneBlock has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function cloneBlock($bid)
                          {
                              require_once __DIR__ . '/admin_header.php';
                      
                              xoops_cp_header();
                      Severity: Minor
                      Found in admin/blocksadmin.php - About 1 hr to fix

                        Method getDirectoryStatus has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function getDirectoryStatus($path, $mode, array $languageConstants, $redirectFile)
                            {
                                global $pathIcon16;
                        
                                $languageConstants1 = [$languageConstants[5], $languageConstants[6]];
                        Severity: Minor
                        Found in class/DirectoryChecker.php - About 1 hr to fix

                          Method xtubeGetVideoThumb has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function xtubeGetVideoThumb($vidid, $title, $source, $picurl, $screenshot, $width = '', $height = '')
                          {
                              if ('' === $width || '' === $height) {
                                  $width  = $GLOBALS['xoopsModuleConfig']['shotwidth'];
                                  $height = $GLOBALS['xoopsModuleConfig']['shotheight'];
                          Severity: Minor
                          Found in include/video.php - About 1 hr to fix

                            Method renderVideoListBody has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function renderVideoListBody($published)
                                {
                                    global $xtubeImageArray, $pathIcon16;
                            
                                    $xtubemyts = new TextSanitizer();
                            Severity: Minor
                            Found in class/Utility.php - About 1 hr to fix

                              Method renderCategoryListBody has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static function renderCategoryListBody($published)
                                  {
                                      global  $xtubeImageArray;
                              
                                      $xtubemyts = new TextSanitizer();
                              Severity: Minor
                              Found in class/Utility.php - About 1 hr to fix

                                Method editBlock has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function editBlock($bid)
                                    {
                                        require_once __DIR__ . '/admin_header.php';
                                        xoops_cp_header();
                                        $adminObject = Admin::getInstance();
                                Severity: Minor
                                Found in admin/blocksadmin.php - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language