XoopsModules25x/xoopstube

View on GitHub

Showing 188 of 2,792 total issues

Method convertOrderByIn has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function convertOrderByIn($orderby)
    {
        switch (\trim($orderby)) {
            case 'titleA':
                $orderby = 'title ASC';
Severity: Minor
Found in class/Utility.php - About 1 hr to fix

    Method convertOrderByTrans has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function convertOrderByTrans($orderby)
        {
            switch ($orderby) {
                case 'hits ASC':
                    $orderByTrans = \_MD_XOOPSTUBE_POPULARITYLTOM;
    Severity: Minor
    Found in class/Utility.php - About 1 hr to fix

      Method cleanRequestVars has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function cleanRequestVars(
              &$array,
              $name = null,
              $def = null,
              $strict = false,
      Severity: Minor
      Found in class/Utility.php - About 1 hr to fix

        Method convertOrderByOut has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function convertOrderByOut($orderby)
            {
                switch ($orderby) {
                    case 'title ASC':
                        $orderby = 'titleA';
        Severity: Minor
        Found in class/Utility.php - About 1 hr to fix

          Method createThumbnail has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function createThumbnail(
                  $img_width = null,
                  $img_height = null,
                  $img_quality = null,
                  $img_update = null,
          Severity: Minor
          Found in class/Thumbnails.php - About 1 hr to fix

            Method xtubeSearch has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function xtubeSearch($queryarray, $andor, $limit, $offset, $userid)
            {
                $sql    = 'SELECT cid, pid FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_cat');
                $result = $GLOBALS['xoopsDB']->query($sql);
                while (false !== ($_search_group_check = $GLOBALS['xoopsDB']->fetchArray($result))) {
            Severity: Minor
            Found in include/search.inc.php - About 1 hr to fix

              Method getFileStatus has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function getFileStatus($file_path, $original_file_path = null, $redirectFile = null)
                  {
                      global $pathIcon16;
              
                      if (empty($file_path)) {
              Severity: Minor
              Found in class/Common/FileChecker.php - About 1 hr to fix

                Method editTopVideoBlock has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function editTopVideoBlock($options)
                {
                    $form = '' . _MB_XOOPSTUBE_DISP . ' ';
                    $form .= "<input type='hidden' name='options[]' value='";
                    if ('published' === $options[0]) {
                Severity: Minor
                Found in blocks/xoopstube_top.php - About 1 hr to fix

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

                      public static function convertOrderByTrans($orderby)
                      {
                          switch ($orderby) {
                              case 'hits ASC':
                                  $orderByTrans = \_MD_XOOPSTUBE_POPULARITYLTOM;
                  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 convertOrderByOut has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function convertOrderByOut($orderby)
                      {
                          switch ($orderby) {
                              case 'title ASC':
                                  $orderby = 'titleA';
                  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 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 convertOrderByIn has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function convertOrderByIn($orderby)
                      {
                          switch (\trim($orderby)) {
                              case 'titleA':
                                  $orderby = 'title ASC';
                  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 setMetas has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function setMetas($pageTitle = '', $metaDescription = '', $metaKeywords = '')
                      {
                          global $xoTheme, $xoTheme, $xoopsTpl;
                          $xoopsTpl->assign('xoops_pagetitle', $pageTitle);
                          if (isset($xoTheme) && \is_object($xoTheme)) {
                  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 upload has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function upload($chmod = 0644)
                      {
                          if ('' === $this->uploadDir) {
                              $this->setErrors(\_AM_XOOPSTUBE_NOUPLOADDIR);
                  
                  
                  Severity: Minor
                  Found in class/MediaUploader.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 makeSeoUrl has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function makeSeoUrl($content, $urw = 1)
                          {
                              $s       = "ÀÁÂÃÄÅÒÓÔÕÖØÈÉÊËÇÌÍÎÏÙÚÛܟÑàáâãäåòóôõöøèéêëçìíîïùúûüÿñ '()";
                              $r       = 'AAAAAAOOOOOOEEEECIIIIUUUUYNaaaaaaooooooeeeeciiiiuuuuyn----';
                              $content = self::unhtml($content); // First, remove html entities
                      Severity: Minor
                      Found in class/Utility.php - About 1 hr to fix

                        Method uploadFile has 29 lines of code (exceeds 25 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

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

                              public static function uploadFiles(
                                  $FILES,
                                  $uploaddir = 'uploads',
                                  $allowed_mimetypes = '',
                                  $redirecturl = 'index.php', //    $num = 0,
                          Severity: Minor
                          Found in class/Utility.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

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

                                  public static function getLetters()
                                  {
                                      global $xoopsModule;
                              
                                      $letterchoice          = '<div>' . \_MD_XOOPSTUBE_BROWSETOTOPIC . '</div>';
                              Severity: Minor
                              Found in class/Utility.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language