XoopsModules25x/lexikon

View on GitHub

Showing 216 of 316 total issues

Method lx_CatsArray has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function lx_CatsArray()
{
    global $xoopsDB, $xoopsModuleConfig, $xoopsUser, $xoopsModule;
    $myts   = \MyTextSanitizer::getInstance();
    $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
Severity: Minor
Found in include/functions.php - About 1 hr to fix

    Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $objHandler,
            $criteria = null,
            $field_name = null,
            array $alphabet = [],
            $arg_name = 'letter',
    Severity: Major
    Found in class/Common/LetterChoice.php - About 1 hr to fix

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

      function showTooltip(e, tooltipTxt) {
      
          var bodyWidth = Math.max(document.body.clientWidth, document.documentElement.clientWidth) - 20;
      
          if (!dhtmlgoodies_tooltip) {
      Severity: Minor
      Found in assets/js/shadowtooltip.js - 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

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

      function lexikon_notify_iteminfo($category, $item_id)
      {
          /*global $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
      
          if (empty($xoopsModule) || $xoopsModule->getVar('dirname') != 'lexikon') {
      Severity: Minor
      Found in include/notification.inc.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

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

      domticker.prototype.fadetransition = function (fadetype, timerid) {
          var contentdiv = this.contentdiv;
          if (fadetype == "reset")
              this.opacitysetting = 0.2;
          if (contentdiv.filters && contentdiv.filters[0]) {
      Severity: Minor
      Found in assets/js/domticker.js - 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

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

      function xoops_module_install_lexikon(\XoopsModule $module)
      {
          $moduleDirName = \basename(\dirname(__DIR__));
      
          $helper       = Helper::getInstance();
      Severity: Minor
      Found in include/oninstall.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

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

          public static function rcopy($src, $dest)
          {
              // Only continue if user is a 'global' Admin
              if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                  return false;
      Severity: Minor
      Found in class/Common/FilesManagement.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

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

          public static function rmove($src, $dest)
          {
              // Only continue if user is a 'global' Admin
              if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                  return false;
      Severity: Minor
      Found in class/Common/FilesManagement.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

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

          public static function recurseCopy($src, $dst)
          {
              $dir = \opendir($src);
              //        @mkdir($dst);
              if (!@\mkdir($dst) && !\is_dir($dst)) {
      Severity: Minor
      Found in class/Common/FilesManagement.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 = null)
      Severity: Major
      Found in admin/blocksadmin.php - About 50 mins to fix

        Method setOrder has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            function setOrder($bid, $title, $weight, $visible, $side, $bcachetime, $bmodule = null)
        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

            Avoid deeply nested control flow statements.
            Open

                                if (is_object($submitter)) {
                                    $submitter->setVar('posts', $submitter->getVar('posts') + 1);
                                    $res = $memberHandler->insertUser($submitter, true);
                                    unset($submitter);
                                }
            Severity: Major
            Found in admin/importwordbook.php - About 45 mins to fix

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

              function lx_getinit($init)
              {
                  global $init;
                  echo "<div><select name='init'>";
                  echo "<option value='#'>&nbsp; # &nbsp;</option>";
              Severity: Minor
              Found in admin/functions.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 categoryDefault has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              function categoryDefault()
              {
                  $helper = Helper::getInstance();
                  $op = 'default';
                  require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
              Severity: Minor
              Found in admin/category.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 lexikon_tag_iteminfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              function lexikon_tag_iteminfo(&$items)
              {
                  if (empty($items) || !is_array($items)) {
                      return false;
                  }
              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

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

              function &lx_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
              Severity: Minor
              Found in include/functions.php - About 45 mins to fix

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

                function lx_serviceLinks($variable)
                {
                    global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsConfig, $entrytype;
                
                    /** @var \XoopsModuleHandler $moduleHandler */
                Severity: Minor
                Found in include/functions.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 lexikon_tag_iteminfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                function lexikon_tag_iteminfo(&$items)
                {
                    if (empty($items) || !is_array($items)) {
                        return false;
                    }
                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

                Avoid deeply nested control flow statements.
                Open

                                            if (is_file($templateFolder . $v)) {
                                                unlink($templateFolder . $v);
                                            }
                Severity: Major
                Found in include/onupdate.php - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language