XoopsModules25x/xoopstube

View on GitHub

Showing 188 of 2,792 total issues

Method updateBlock has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
Severity: Major
Found in admin/blocksadmin.php - About 1 hr to fix

    Function xtubeGetVideoThumb has a Cognitive Complexity of 10 (exceeds 5 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

    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 IP has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function IP()
        {
            $proxy_ip = '';
            if (Request::hasVar('HTTP_X_FORWARDED_FOR', 'SERVER')) {
                $proxy_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    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 xtubeNotifyIteminfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    function xtubeNotifyIteminfo($category, $item_id)
    {
        global $xoopsModule;
    
        $moduleDirName = \basename(\dirname(__DIR__));
    Severity: Minor
    Found in include/notification.inc.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 resizePicture has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function resizePicture(
            $src_path,
            $dst_path,
            $param_width,
            $param_height,
    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 uploadFiles has a Cognitive Complexity of 10 (exceeds 5 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

    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 getLetters has a Cognitive Complexity of 10 (exceeds 5 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

    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 createThumbnail has a Cognitive Complexity of 10 (exceeds 5 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

    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 getCategoryArray has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getCategoryArray()
          {
              global $xoopsDB, $xoopsUser, $xoopsModule;
              $helper           = Helper::getInstance();
              $myts             = \MyTextSanitizer::getInstance();
      Severity: Minor
      Found in class/Utility.php - About 1 hr to fix

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

                $objHandler,
                $criteria = null,
                $field_name = null,
                array $alphabet = [],
                $arg_name = 'letter',
        Severity: Major
        Found in class/Common/LetterChoice.php - About 1 hr to fix

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

                  $path = 'uploads',
                  $value = null,
                  $selected = '',
                  $size = 1,
                  $emptyselect = 0,
          Severity: Major
          Found in class/Lists.php - About 1 hr to fix

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

            function getThumbsTopVideoBlock($bvidid, $btitle, $bsource, $bpicurl, array $size = [])
            {
                $thumbb = '';
                /** @var \XoopsModuleHandler $moduleHandler */
                $moduleHandler = xoops_getHandler('module');
            Severity: Minor
            Found in blocks/xoopstube_top.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 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 formMarkRequiredFields has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function &formMarkRequiredFields(\XoopsForm $sform)
                {
                    if (self::needsAsterisk()) {
                        $required = [];
                        $elements = [];
            Severity: Minor
            Found in class/Utility.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 rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function rmove($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

            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

            Method setOrder has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                function setOrder($bid, $title, $weight, $visible, $side, $bcachetime, $bmodule)
            Severity: Major
            Found in admin/blocksadmin.php - About 50 mins to fix

              Method xtubeGetVideoThumb has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function xtubeGetVideoThumb($vidid, $title, $source, $picurl, $screenshot, $width = '', $height = '')
              Severity: Major
              Found in include/video.php - About 50 mins to fix

                Method isBlockCloned has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options = null)
                Severity: Major
                Found in admin/blocksadmin.php - About 50 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language