XoopsModules25x/latestnews

View on GitHub

Showing 47 of 60 total issues

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

    Method xtubeEditBlock has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function xtubeEditBlock($bid)
        {
            include_once dirname(__FILE__) . '/admin_header.php';
            //include_once 'admin_header.php';
            xoops_cp_header();
    Severity: Minor
    Found in admin/blocksadmin.php - About 2 hrs to fix

      Method check has 49 lines of code (exceeds 25 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 1 hr to fix

        Function b_latestnews_edit has a Cognitive Complexity of 13 (exceeds 5 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: Minor
        Found in blocks/latestnews.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 extract_post_recursive has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            function extract_post_recursive( $key_name , $tmp_array )
            {
                $table = '' ;
                $form = '' ;
                foreach ($tmp_array as $key => $val) {
        Severity: Minor
        Found in include/gtickets.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 makeMySelBox has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function makeMySelBox($title, $order = "", $preset_id = 0, $none = 0, $sel_name = "", $onchange = "")
            {
                if ($sel_name == "") {
                    $sel_name = $this->id;
                }
        Severity: Minor
        Found in class/xoopstree.php - About 1 hr to fix

          Function makeMySelBox has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              function makeMySelBox($title, $order = "", $preset_id = 0, $none = 0, $sel_name = "", $onchange = "")
              {
                  if ($sel_name == "") {
                      $sel_name = $this->id;
                  }
          Severity: Minor
          Found in class/xoopstree.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 myblocksadmin_update_blockinstance has 11 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              function myblocksadmin_update_blockinstance($id, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array(), $bid=null)
          Severity: Major
          Found in include/blocksadmin.inc.php - About 1 hr to fix

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

                function myblocksadmin_update_blockinstance($id, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array(), $bid=null)
                {
                    global $xoopsDB ;
            
                    $instance_handler =& xoops_gethandler('blockinstance');
            Severity: Minor
            Found in include/blocksadmin.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

            Method myblocksadmin_update_block has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                function myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array())
            Severity: Major
            Found in include/blocksadmin.inc.php - About 1 hr to fix

              Method draw_repost_form has 31 lines of code (exceeds 25 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 1 hr to fix

                Method myblocksadmin_update_blockinstance has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function myblocksadmin_update_blockinstance($id, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array(), $bid=null)
                    {
                        global $xoopsDB ;
                
                        $instance_handler =& xoops_gethandler('blockinstance');
                Severity: Minor
                Found in include/blocksadmin.inc.php - About 1 hr to fix

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

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

                    Method getAllPublished has 9 arguments (exceeds 4 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)
                    Severity: Major
                    Found in class/class.latestnews.php - About 1 hr to fix

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

                          function latest_news_is_admin_group()
                          {
                              global $xoopsUser;
                              $module_handler =& xoops_gethandler('module');
                              $xoopsModule =& $module_handler->getByDirname('news');
                      Severity: Minor
                      Found in class/class.latestnews.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 isBlockCloned has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

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

                        Avoid deeply nested control flow statements.
                        Open

                                        if ($counter > 4) {
                                            $counter = 0;
                                            echo "</tr>";
                                            echo "<tr>";
                                        }
                        Severity: Major
                        Found in admin/admin.php - About 45 mins to fix

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

                              function XoopsGTicket()
                              {
                                  global $xoopsConfig ;
                          
                                  // language file
                          Severity: Minor
                          Found in include/gtickets.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

                          Avoid deeply nested control flow statements.
                          Open

                                              for ($j=0; $j < count($old_vals); $j++) {
                                                  $def_vals[$j] = $old_vals[$j];
                                              }
                          Severity: Major
                          Found in include/updateblock.inc.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                            if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) {
                                                echo "<td class='$class' align='center' valign='bottom' width='19%'>";
                                                echo "<a href='".XOOPS_URL."/modules/system/admin.php?fct=".$file."'><b>" .trim($modversion['name'])."</b></a>\n";
                                                echo "</td>";
                                                $counter++;
                            Severity: Major
                            Found in admin/admin.php - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language