XoopsModules25x/xoopstube

View on GitHub

Showing 188 of 2,792 total issues

Method getThumbsTopVideoBlock has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function getThumbsTopVideoBlock($bvidid, $btitle, $bsource, $bpicurl, array $size = [])
Severity: Minor
Found in blocks/xoopstube_top.php - About 35 mins to fix

    Method truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
    Severity: Minor
    Found in class/Common/SysUtility.php - About 35 mins to fix

      Method makeTreeCheckTable has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function makeTreeCheckTable(Xoopstube\Tree $xt, $itemid, $title, $checks, $order = '')
      Severity: Minor
      Found in admin/altcat.php - About 35 mins to fix

        Method createThumbnail has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $img_width = null,
                $img_height = null,
                $img_quality = null,
                $img_update = null,
                $img_aspect = null
        Severity: Minor
        Found in class/Thumbnails.php - About 35 mins to fix

          Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function __construct($uploadDir, $allowedMimeTypes, $maxFileSize, $maxWidth = 0, $maxHeight = 0)
          Severity: Minor
          Found in class/MediaUploader.php - About 35 mins to fix

            Function xtubeShowBannerB has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            function xtubeShowBannerB($options)
            {
                $moduleDirName = \basename(\dirname(__DIR__));
            
                $block = [];
            Severity: Minor
            Found in blocks/xoopstube_banner.php - About 35 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 xtubeSearch has a Cognitive Complexity of 7 (exceeds 5 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 35 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 getDirectoryStatus has a Cognitive Complexity of 7 (exceeds 5 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 35 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 createUploadName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function createUploadName($folder, $fileName, $trimName = false)
                {
                    $workingfolder = $folder;
                    if ('/' !== \xoops_substr($workingfolder, mb_strlen($workingfolder) - 1, 1)) {
                        $workingfolder .= '/';
            Severity: Minor
            Found in class/Utility.php - About 35 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 getHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function getHandler($name, $optional = false)
                {
                    global $handlers, $xoopsModule;
            
                    $name = mb_strtolower(\trim($name));
            Severity: Minor
            Found in class/Utility.php - About 35 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 getEditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function getEditor($helper = null, $options = null)
                {
                    /** @var Helper $helper */
                    if (null === $options) {
                        $options           = [];
            Severity: Minor
            Found in class/Common/SysUtility.php - About 35 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 _copyFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _copyFile($chmod)
                {
                    $matched = [];
                    if (!\preg_match('/\.([a-zA-Z0-9]+)$/', $this->mediaName, $matched)) {
                        return false;
            Severity: Minor
            Found in class/MediaUploader.php - About 35 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

            Avoid too many return statements within this method.
            Open

                return null;
            Severity: Major
            Found in include/notification.inc.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return $item;
              Severity: Major
              Found in include/notification.inc.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                    return $this->_source_url . "/{$this->_img_savepath}/{$savefile}";
                Severity: Major
                Found in class/Thumbnails.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return false;
                  Severity: Major
                  Found in class/Utility.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return true;
                    Severity: Major
                    Found in class/MediaUploader.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return "{$this->_img_savepath}/{$savefile}";
                      Severity: Major
                      Found in class/Thumbnails.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return false;
                        Severity: Major
                        Found in class/MediaUploader.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return false === $image ? DEFAULT_PATH : $image;
                          Severity: Major
                          Found in class/Thumbnails.php - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language