XoopsModules25x/latestnews

View on GitHub

Showing 60 of 60 total issues

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

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

                          function xtubeSetOrder($bid, $title, $weight, $visible, $side, $bcachetime)
                      Severity: Minor
                      Found in admin/blocksadmin.php - About 45 mins to fix

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

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

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

                              function issue( $salt = '' , $timeout = 1800 , $area = '' )
                              {
                                  global $xoopsModule ;
                          
                                  // create a token
                          Severity: Minor
                          Found in include/gtickets.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 admin_refcheck has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function admin_refcheck($chkref = "")
                          {
                              if ( empty( $_SERVER['HTTP_REFERER'] ) ) {
                                  return true ;
                              } else {
                          Severity: Minor
                          Found in include/gtickets.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 getErrors has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              function getErrors( $ashtml = true )
                              {
                                  if ($ashtml) {
                                      $ret = '' ;
                                      foreach ($this->_errors as $msg) {
                          Severity: Minor
                          Found in include/gtickets.php - About 25 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 cloneBlock has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              function cloneBlock($bid)
                              {
                                  include_once dirname(__FILE__) . '/admin_header.php';
                                  //include_once 'admin_header.php';
                                  xoops_cp_header();
                          Severity: Minor
                          Found in admin/blocksadmin.php - About 25 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 xtubeEditBlock has a Cognitive Complexity of 6 (exceeds 5 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 25 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

                          Severity
                          Category
                          Status
                          Source
                          Language