XoopsModules25x/lexikon

View on GitHub

Showing 316 of 316 total issues

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_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

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

    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

    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 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

      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 (is_file($templateFolder . $v)) {
                                        unlink($templateFolder . $v);
                                    }
        Severity: Major
        Found in include/onupdate.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_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

            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 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

            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

            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

            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

              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

                                    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

                  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 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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language