XoopsModules25x/lexikon

View on GitHub

Showing 216 of 316 total issues

Function lx_CatsArray has a Cognitive Complexity of 8 (exceeds 5 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 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_object($submitter)) {
                        $submitter->setVar('posts', $submitter->getVar('posts') + 1);
                        $res = $memberHandler->insertUser($submitter, true);
                        unset($submitter);
                    }
Severity: Major
Found in admin/importxwords.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

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

      function lx_GetStatistics($limit)
      {
          $ret  = [];
          $db   = \XoopsDatabaseFactory::getDatabaseConnection();
          $tbls = $db->prefix('lxentries');
      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

      Avoid deeply nested control flow statements.
      Open

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

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

            public function replace($replace_matches)
            {
                $patterns = [];
                if ($this->singlewords) {
                    $keywords = \explode(' ', $this->preg_keywords);
        Severity: Minor
        Found in class/Keyhighlighter.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 setPermissions has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                function setPermissions($myArray, $permissionGroup, $categoryID, $grouppermHandler, $permissionName, $mid)
        Severity: Minor
        Found in admin/categories.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/importdictionary.php - About 45 mins to fix

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

                    function setPermissions($myArray, $permissionGroup, $categoryID, $grouppermHandler, $permissionName, $mid)
                    {
                        $permissionArray = $myArray;
                        if ($categoryID > 0) {
                            $sql = 'DELETE FROM `' . $GLOBALS['xoopsDB']->prefix('group_permission') . "` WHERE `gperm_name` = '" . $permissionName . "' AND `gperm_itemid`= $categoryID;";
            Severity: Minor
            Found in admin/categories.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 lx_getWysiwygForm has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            function &lx_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
            {
                $editor_option            = mb_strtolower(lx_getmoduleoption('form_options'));
                $editor                   = false;
                $editor_configs           = [];
            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 getCategoryArray has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function getCategoryArray()
                {
                    global $xoopsDB, $xoopsUser, $xoopsModule;
            
                    $helper           = Helper::getInstance();
            Severity: Minor
            Found in class/Utility.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 getWysiwygForm has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
                {
                    $editor_option            = mb_strtolower(static::getModuleOption('form_options'));
                    $editor                   = false;
                    $editor_configs           = [];
            Severity: Minor
            Found in class/Utility.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 getServiceLinks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function getServiceLinks($variable)
                {
                    global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsConfig, $entrytype;
            
                    $helper = Helper::getInstance();
            Severity: Minor
            Found in class/Utility.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 getWysiwygForm has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public static function getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
            Severity: Minor
            Found in class/Utility.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  switch ($helper->getConfig('linkterms')) {
                                      default:
                                          $replace_term = '<span><b><a style="cursor:help;border-bottom: 1px dotted #000;color: #2F5376;" href="' . $staticURL . '" >' . $term . '</a></b></span>';
                                          break;
                                      case 3: //tooltip
              Severity: Major
              Found in entry.php - About 45 mins to fix

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

                    public static function getAlphaArray()
                    {
                        global $xoopsUser, $xoopsDB, $xoopsModule;
                        $grouppermHandler = \xoops_getHandler('groupperm');
                        $groups           = \is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
                Severity: Minor
                Found in class/Utility.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 makeMySelBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

                  Function domticker has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function domticker(content, divId, divClass, delay, fadeornot) {
                  Severity: Minor
                  Found in assets/js/domticker.js - About 35 mins to fix

                    Method lx_search has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function lx_search($queryarray, $andor, $limit, $offset, $userid)
                    Severity: Minor
                    Found in include/search.inc.php - About 35 mins to fix

                      Method truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
                      Severity: Minor
                      Found in class/Common/SysUtility.php - About 35 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language