XoopsModules25x/xoopstube

View on GitHub

Showing 188 of 2,792 total issues

Function renderVideoListBody has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function renderVideoListBody($published)
    {
        global $xtubeImageArray, $pathIcon16;

        $xtubemyts = new TextSanitizer();
Severity: Minor
Found in class/Utility.php - About 45 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 xoopstube_tag_iteminfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function xoopstube_tag_iteminfo(&$items)
{
    $moduleDirName = \basename(\dirname(__DIR__));

    if (empty($items) || !is_array($items)) {
Severity: Minor
Found in class/plugins/plugin.tag.php - About 45 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 xoopstube_tag_iteminfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function xoopstube_tag_iteminfo(&$items)
{
    $moduleDirName = \basename(\dirname(__DIR__));

    if (empty($items) || !is_array($items)) {
Severity: Minor
Found in include/plugin.tag.php - About 45 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 getCategoryArray has a Cognitive Complexity of 8 (exceeds 5 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 45 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 getFileStatus has a Cognitive Complexity of 8 (exceeds 5 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 45 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 uploadFile has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $indice,
        $dstpath = XOOPS_UPLOAD_PATH,
        $mimeTypes = null,
        $uploadMaxSize = null,
        $maxWidth = null,
Severity: Minor
Found in class/Utility.php - About 45 mins to fix

    Function renderCategoryListBody has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function renderCategoryListBody($published)
        {
            global  $xtubeImageArray;
    
            $xtubemyts = new TextSanitizer();
    Severity: Minor
    Found in class/Utility.php - About 45 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 resizePicture has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $src_path,
            $dst_path,
            $param_width,
            $param_height,
            $keep_original = false,
    Severity: Minor
    Found in class/Utility.php - About 45 mins to fix

      Method uploadFiles has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $FILES,
              $uploaddir = 'uploads',
              $allowed_mimetypes = '',
              $redirecturl = 'index.php', //    $num = 0,
              $redirect = 0,
      Severity: Minor
      Found in class/Utility.php - About 45 mins to fix

        Function getAlphaArray has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getAlphaArray()
            {
                global $xoopsUser, $xoopsDB, $xoopsModule;
                $grouppermHandler = \xoops_getHandler('groupperm');
                $groups           = \is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
        Severity: Minor
        Found in class/Utility.php - About 45 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 editTopVideoBlock has a Cognitive Complexity of 8 (exceeds 5 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 45 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 breadcrumb has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function breadcrumb($path, $raquo = ' &raquo; ')
            {
                $breadcrumb        = '';
                $workingBreadcrumb = [];
                if (\is_array($path)) {
        Severity: Minor
        Found in class/Utility.php - About 45 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 __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function __construct($img_name = null, $img_path = null, $img_savepath = null)
            {
                if (!\preg_match('/\.(jpg|gif|png|jpeg)$/i', $img_name)) {
                    return false;
                }
        Severity: Minor
        Found in class/Thumbnails.php - About 45 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 makeMySelBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
        Severity: Minor
        Found in class/Tree.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if ($chcount > 5) {
                                  $subcategories .= '...';
                                  break;
                              }
          Severity: Major
          Found in index.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if ($space > 0) {
                                    $subcategories .= '<br>';
                                }
            Severity: Major
            Found in index.php - About 45 mins to fix

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

                      &$array,
                      $name = null,
                      $def = null,
                      $strict = false,
                      $lengthcheck = 15
              Severity: Minor
              Found in class/Utility.php - About 35 mins to fix

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

                    public static function setPageNavigationVideoList($pubrowamount, $start, $art, $_this, $align)
                Severity: Minor
                Found in class/Utility.php - About 35 mins to fix

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

                          $pubrowamount,
                          $start,
                          $art,
                          $_this,
                          $align
                  Severity: Minor
                  Found in class/Utility.php - About 35 mins to fix

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

                    function xtubeSearch($queryarray, $andor, $limit, $offset, $userid)
                    Severity: Minor
                    Found in include/search.inc.php - About 35 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language