XoopsModules25x/latestnews

View on GitHub

Showing 47 of 60 total issues

Function block_latestnews_show has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
Open

function block_latestnews_show($options)
{
    global $xoopsTpl, $xoopsUser, $xoopsConfig, $pathIcon16, $xoopsModule;
    include_once XOOPS_ROOT_PATH . '/modules/latestnews/include/functions.php';

Severity: Minor
Found in blocks/latestnews.php - About 1 day 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

File blocksadmin.php has 522 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Module: XoopsTube
 *
 * You may not change or alter any portion of this comment or credits
Severity: Major
Found in admin/blocksadmin.php - About 1 day to fix

    Method block_latestnews_show has 206 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function block_latestnews_show($options)
    {
        global $xoopsTpl, $xoopsUser, $xoopsConfig, $pathIcon16, $xoopsModule;
        include_once XOOPS_ROOT_PATH . '/modules/latestnews/include/functions.php';
    
    
    Severity: Major
    Found in blocks/latestnews.php - About 1 day to fix

      Function check has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

          function check( $post = true , $area = '' , $allow_repost = true )
          {
              global $xoopsModule ;
      
              $this->_errors = array() ;
      Severity: Minor
      Found in include/gtickets.php - About 7 hrs 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 listBlocks has 174 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function listBlocks()
          {
              global $xoopsUser, $xoopsConfig, $xoopsModule, $pathIcon16;
              include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
              $db =& XoopsDatabaseFactory::getDatabaseConnection();
      Severity: Major
      Found in admin/blocksadmin.php - About 6 hrs to fix

        Function listBlocks has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
        Open

            function listBlocks()
            {
                global $xoopsUser, $xoopsConfig, $xoopsModule, $pathIcon16;
                include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                $db =& XoopsDatabaseFactory::getDatabaseConnection();
        Severity: Minor
        Found in admin/blocksadmin.php - About 6 hrs 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 prepare2show has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
        Open

            function prepare2show($filescount)
            {
                include_once XOOPS_ROOT_PATH.'/modules/news/include/functions.php';
                global $xoopsUser, $xoopsConfig, $xoopsModuleConfig;
                $myts =& MyTextSanitizer::getInstance();
        Severity: Minor
        Found in class/class.latestnews.php - About 5 hrs 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 myblocksadmin_update_block has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
        Open

            function myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array())
            {
                global $xoopsConfig;
        
                $myblock = new XoopsBlock($bid);
        Severity: Minor
        Found in include/blocksadmin.inc.php - About 5 hrs 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 getAllPublished has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

            static function getAllPublished($limit=0, $selected_stories=true, $start=0, $checkRight=false, $topic=0, $ihome=0, $asobject=true, $order = 'published', $topic_frontpage=false)
            {
                $db =& XoopsDatabaseFactory::getDatabaseConnection();
                $myts =& MyTextSanitizer::getInstance();
        
        
        Severity: Minor
        Found in class/class.latestnews.php - About 5 hrs 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

        File blocksadmin.inc.php has 366 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        // $Id: blocksadmin.inc.php 12106 2013-09-29 10:23:10Z beckmi $
        //  ------------------------------------------------------------------------ //
        //                XOOPS - PHP Content Management System                      //
        //                    Copyright (c) 2000 XOOPS.org                           //
        Severity: Minor
        Found in include/blocksadmin.inc.php - About 4 hrs to fix

          Method prepare2show has 104 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function prepare2show($filescount)
              {
                  include_once XOOPS_ROOT_PATH.'/modules/news/include/functions.php';
                  global $xoopsUser, $xoopsConfig, $xoopsModuleConfig;
                  $myts =& MyTextSanitizer::getInstance();
          Severity: Major
          Found in class/class.latestnews.php - About 4 hrs to fix

            Method b_latestnews_edit has 99 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function b_latestnews_edit($options)
            {
                global $xoopsDB;
                include_once XOOPS_ROOT_PATH . '/modules/latestnews/include/functions.php';
                include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newstopic.php';
            Severity: Major
            Found in blocks/latestnews.php - About 3 hrs to fix

              File latestnews.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              // ######################################################################
              // #                                                                    #
              // # Latest News block by Mowaffak ( www.arabxoops.com )                #
              // # based on Last Articles Block by Pete Glanz (www.glanz.ru)          #
              Severity: Minor
              Found in blocks/latestnews.php - About 3 hrs to fix

                Function isBlockCloned has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                Open

                    function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
                    {
                        global $xoopsUser, $xoopsConfig;
                        if (file_exists(
                            XOOPS_ROOT_PATH . "/modules/system/language/" . $xoopsConfig['language'] . "/admin/blocksadmin.php"
                Severity: Minor
                Found in admin/blocksadmin.php - About 3 hrs 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 draw_repost_form has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    function draw_repost_form( $area = '' )
                    {
                        // Notify which file is broken
                        if ( headers_sent() ) {
                            restore_error_handler() ;
                Severity: Minor
                Found in include/gtickets.php - About 2 hrs 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 isBlockCloned has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
                    {
                        global $xoopsUser, $xoopsConfig;
                        if (file_exists(
                            XOOPS_ROOT_PATH . "/modules/system/language/" . $xoopsConfig['language'] . "/admin/blocksadmin.php"
                Severity: Major
                Found in admin/blocksadmin.php - About 2 hrs to fix

                  Method myblocksadmin_update_block has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array())
                      {
                          global $xoopsConfig;
                  
                          $myblock = new XoopsBlock($bid);
                  Severity: Major
                  Found in include/blocksadmin.inc.php - About 2 hrs to fix

                    Function xtubeUpdateBlock has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function xtubeUpdateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $boptions, $groups)
                        {
                            $myblock = new XoopsBlock($bid);
                            $myblock->setVar('title', $btitle);
                            $myblock->setVar('weight', $bweight);
                    Severity: Minor
                    Found in admin/blocksadmin.php - About 2 hrs 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 getAllPublished has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        static function getAllPublished($limit=0, $selected_stories=true, $start=0, $checkRight=false, $topic=0, $ihome=0, $asobject=true, $order = 'published', $topic_frontpage=false)
                        {
                            $db =& XoopsDatabaseFactory::getDatabaseConnection();
                            $myts =& MyTextSanitizer::getInstance();
                    
                    
                    Severity: Major
                    Found in class/class.latestnews.php - About 2 hrs to fix

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

                          function cloneBlock($bid)
                          {
                              include_once dirname(__FILE__) . '/admin_header.php';
                              //include_once 'admin_header.php';
                              xoops_cp_header();
                      Severity: Major
                      Found in admin/blocksadmin.php - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language