XoopsModules25x/xoopshp

View on GitHub

Showing 24 of 586 total issues

File main.php has 598 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
//  ------------------------------------------------------------------------ //
//             --  XoopsHP Module --       Xoops e-Learning System           //
//                     Copyright (c) 2005 SUDOW-SOKEN                        //
//                      <http://www.mailpark.co.jp/>                         //
Severity: Major
Found in admin/main.php - About 1 day to fix

    File index.php has 526 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    //  ------------------------------------------------------------------------ //
    //             --  XoopsHP Module --       Xoops e-Learning System           //
    //                     Copyright (c) 2005 SUDOW-SOKEN                        //
    //                      <http://www.mailpark.co.jp/>                         //
    Severity: Major
    Found in index.php - About 1 day to fix

      Function listarticles has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
      Open

      function listarticles($secid)
      {
          global $xoopsConfig, $xoopsModuleConfig, $xoopsUser, $xoopsDB, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $isModAdmin, $xoopsUserIsAdmin;
          include dirname(dirname(__DIR__)) . '/header.php';
          $myts  = MyTextSanitizer::getInstance();
      Severity: Minor
      Found in index.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 sections has 180 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function sections($secid2show = 0)
      {
          global $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig;
          xoops_cp_header();
          // JS for checkbox manipulation
      Severity: Major
      Found in admin/main.php - About 7 hrs to fix

        Function sections has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
        Open

        function sections($secid2show = 0)
        {
            global $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig;
            xoops_cp_header();
            // JS for checkbox manipulation
        Severity: Minor
        Found in admin/main.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

        Method listarticles has 121 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function listarticles($secid)
        {
            global $xoopsConfig, $xoopsModuleConfig, $xoopsUser, $xoopsDB, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $isModAdmin, $xoopsUserIsAdmin;
            include dirname(dirname(__DIR__)) . '/header.php';
            $myts  = MyTextSanitizer::getInstance();
        Severity: Major
        Found in index.php - About 4 hrs to fix

          Function listsections has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

          function listsections()
          {
              global $xoopsConfig, $xoopsModuleConfig, $xoopsDB, $xoopsUser, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $isModAdmin, $xoopsUserIsAdmin, $xoopsModuleConfig;
              include XOOPS_ROOT_PATH . '/header.php';
              $myts = MyTextSanitizer::getInstance();
          Severity: Minor
          Found in index.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

          Method portfolio has 91 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function portfolio($sort_key, $secid)
          {
              global $xoopsConfig, $xoopsModuleConfig, $xoopsUser, $xoopsDB, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $isModAdmin, $xoopsUserIsAdmin;
              include dirname(dirname(__DIR__)) . '/header.php';
              $myts     = MyTextSanitizer::getInstance();
          Severity: Major
          Found in index.php - About 3 hrs to fix

            Method listsections has 82 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function listsections()
            {
                global $xoopsConfig, $xoopsModuleConfig, $xoopsDB, $xoopsUser, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $isModAdmin, $xoopsUserIsAdmin, $xoopsModuleConfig;
                include XOOPS_ROOT_PATH . '/header.php';
                $myts = MyTextSanitizer::getInstance();
            Severity: Major
            Found in index.php - About 3 hrs to fix

              Method secartedit has 80 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function secartedit($artid)
              {
                  global $xoopsDB, $xoopsConfig, $xoopsModule, $xoopsModuleConfig;
                  $myts = MyTextSanitizer::getInstance();
                  xoops_cp_header();
              Severity: Major
              Found in admin/main.php - About 3 hrs to fix

                Method viewdetails has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function viewdetails($artid, $sort_key)
                {
                    global $xoopsConfig, $xoopsModuleConfig, $xoopsUser, $xoopsDB, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $isModAdmin, $xoopsUserIsAdmin;
                    include dirname(dirname(__DIR__)) . '/header.php';
                    $myts     = MyTextSanitizer::getInstance();
                Severity: Major
                Found in index.php - About 2 hrs to fix

                  Function portfolio has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function portfolio($sort_key, $secid)
                  {
                      global $xoopsConfig, $xoopsModuleConfig, $xoopsUser, $xoopsDB, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $isModAdmin, $xoopsUserIsAdmin;
                      include dirname(dirname(__DIR__)) . '/header.php';
                      $myts     = MyTextSanitizer::getInstance();
                  Severity: Minor
                  Found in index.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 viewresults has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function viewresults($artid, $sort_key)
                  {
                      global $xoopsConfig, $xoopsModuleConfig, $xoopsUser, $xoopsDB, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $isModAdmin, $xoopsUserIsAdmin;
                      include dirname(dirname(__DIR__)) . '/header.php';
                      $myts = MyTextSanitizer::getInstance();
                  Severity: Major
                  Found in index.php - About 2 hrs to fix

                    Method sectionedit has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function sectionedit($secid)
                    {
                        global $xoopsDB, $xoopsConfig, $xoopsModule, $xoopsModuleConfig;
                        xoops_cp_header();
                        echo '<h4>' . _AM_SECCONF . '</h4><br>';
                    Severity: Major
                    Found in admin/main.php - About 2 hrs to fix

                      Function viewarticle has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function viewarticle($artid)
                      {
                          global $xoopsConfig, $xoopsModuleConfig, $xoopsUser, $xoopsDB, $xoopsTpl, $isModAdmin, $xoopsUserIsAdmin;
                          $myts  = MyTextSanitizer::getInstance();
                          $artid = (int)$artid;
                      Severity: Minor
                      Found in index.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 my_wrapper has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function my_wrapper($msg)
                      {
                          global $xoopsConfig, $xoopsTheme, $xoopsConfigMetaFooter;
                      
                          $myts = MyTextSanitizer::getInstance();
                      Severity: Minor
                      Found in process_form.php - About 1 hr to fix

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

                        function viewdetails($artid, $sort_key)
                        {
                            global $xoopsConfig, $xoopsModuleConfig, $xoopsUser, $xoopsDB, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $isModAdmin, $xoopsUserIsAdmin;
                            include dirname(dirname(__DIR__)) . '/header.php';
                            $myts     = MyTextSanitizer::getInstance();
                        Severity: Minor
                        Found in index.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 viewarticle has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function viewarticle($artid)
                        {
                            global $xoopsConfig, $xoopsModuleConfig, $xoopsUser, $xoopsDB, $xoopsTpl, $isModAdmin, $xoopsUserIsAdmin;
                            $myts  = MyTextSanitizer::getInstance();
                            $artid = (int)$artid;
                        Severity: Minor
                        Found in index.php - About 1 hr to fix

                          Method b_XHP_courseranking_edit has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function b_XHP_courseranking_edit($options)
                          {
                              global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModule;
                              $myts = MyTextSanitizer::getInstance();
                              $form = _MB_XHP_ITEMS_ORDER . "&nbsp;<select name='options[]'>";
                          Severity: Minor
                          Found in blocks/xhp_block_courseranking.php - About 1 hr to fix

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

                            function secartedit($artid)
                            {
                                global $xoopsDB, $xoopsConfig, $xoopsModule, $xoopsModuleConfig;
                                $myts = MyTextSanitizer::getInstance();
                                xoops_cp_header();
                            Severity: Minor
                            Found in admin/main.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

                            Severity
                            Category
                            Status
                            Source
                            Language