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

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

          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

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

            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

            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

              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

                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