XoopsModules25x/lexikon

View on GitHub

Showing 216 of 316 total issues

File Utility.php has 1187 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace XoopsModules\Lexikon;

/*
Severity: Major
Found in class/Utility.php - About 3 days to fix

    File functions.php has 984 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * $Id: functions.php v 1.0 8 May 2004 hsalazar Exp $
     * Module: Lexikon
     * Author: hsalazar
    Severity: Major
    Found in include/functions.php - About 2 days to fix

      File xoops_version.php has 659 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       * Lexikon XOOPS glossary Module
       *
      Severity: Major
      Found in xoops_version.php - About 1 day to fix

        Method listBlocks has 212 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function listBlocks()
            {
                global $xoopsModule, $pathIcon16;
                //        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                xoops_load('xoopslist');
        Severity: Major
        Found in admin/blocksadmin.php - About 1 day to fix

          Function xoops_module_update_lexikon has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
          Open

          function xoops_module_update_lexikon(\XoopsModule $module, $previousVersion = null)
          {
              $moduleDirName      = \basename(\dirname(__DIR__));
              $moduleDirNameUpper = mb_strtoupper($moduleDirName);
          
          
          Severity: Minor
          Found in include/onupdate.php - About 1 day 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 truncateHtml has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
              {
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
                      if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
          Severity: Minor
          Found in class/Utility.php - About 1 day 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 truncateHtml has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
              {
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
                      if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
          Severity: Minor
          Found in class/Common/SysUtility.php - About 1 day 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

          File blocksadmin.php has 502 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          declare(strict_types=1);
          
          /**
          Severity: Major
          Found in admin/blocksadmin.php - About 1 day to fix

            File entry.php has 476 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * Module: Lexikon - glossary module
             * Author: hsalazar
             * Modifs: Yerres
            Severity: Minor
            Found in admin/entry.php - About 7 hrs to fix

              File blocksadmin.inc.php has 455 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /*
               * You may not change or alter any portion of this comment or credits
               * of supporting developers from this source code or any supporting source code
               * which is considered copyrighted (c) material of the original comment or credit authors.
              Severity: Minor
              Found in include/blocksadmin.inc.php - About 6 hrs to fix

                Function DefinitionImport has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                function DefinitionImport($delete)
                {
                    global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $entryID, $myts;
                    $sqlQuery = $xoopsDB->query('SELECT count(entryID) AS count FROM ' . $xoopsDB->prefix('wbentries'));
                    [$count] = $xoopsDB->fetchRow($sqlQuery);
                Severity: Minor
                Found in admin/importwordbook.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

                Function entrySave has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                function entrySave($entryID = '')
                {
                    global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB;
                    $helper  = Helper::getInstance();
                    $utility = new Utility();
                Severity: Minor
                Found in admin/entry.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

                Function DefinitionImport has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                Open

                function DefinitionImport($delete)
                {
                    global $xoopsConfig, $xoopsDB, $xoopsModule, $myts;
                    $sqlQuery = $xoopsDB->query('SELECT count(id) AS count FROM ' . $xoopsDB->prefix('dictionary'));
                    [$count] = $xoopsDB->fetchRow($sqlQuery);
                Severity: Minor
                Found in admin/importdictionary.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

                Function DefinitionImport has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                Open

                function DefinitionImport($delete)
                {
                    global $xoopsConfig, $xoopsDB, $xoopsModule;
                    $myts     = \MyTextSanitizer::getInstance();
                    $sqlQuery = $xoopsDB->query('SELECT count(entryID) AS count FROM ' . $xoopsDB->prefix('xwords_ent'));
                Severity: Minor
                Found in admin/importxwords.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 DefinitionImport has 160 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function DefinitionImport($delete)
                {
                    global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $entryID, $myts;
                    $sqlQuery = $xoopsDB->query('SELECT count(entryID) AS count FROM ' . $xoopsDB->prefix('wbentries'));
                    [$count] = $xoopsDB->fetchRow($sqlQuery);
                Severity: Major
                Found in admin/importwordbook.php - About 6 hrs to fix

                  Method entryEdit has 157 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function entryEdit($entryID = '')
                  {
                      global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $init;
                      $helper = Helper::getInstance();
                  
                  
                  Severity: Major
                  Found in admin/entry.php - About 6 hrs to fix

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

                        function listBlocks()
                        {
                            global $xoopsModule, $pathIcon16;
                            //        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                            xoops_load('xoopslist');
                    Severity: Minor
                    Found in admin/blocksadmin.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

                    Utility has 43 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Utility extends Common\SysUtility
                    {
                        //--------------- Custom module methods -----------------------------
                        /**
                         * static::getLinkedUnameFromId()
                    Severity: Minor
                    Found in class/Utility.php - About 5 hrs to fix

                      Method DefinitionImport has 145 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function DefinitionImport($delete)
                      {
                          global $xoopsConfig, $xoopsDB, $xoopsModule;
                          $myts     = \MyTextSanitizer::getInstance();
                          $sqlQuery = $xoopsDB->query('SELECT count(entryID) AS count FROM ' . $xoopsDB->prefix('xwords_ent'));
                      Severity: Major
                      Found in admin/importxwords.php - About 5 hrs to fix

                        Function lx_search has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function lx_search($queryarray, $andor, $limit, $offset, $userid)
                        {
                            global $xoopsDB, $xoopsUser;
                            // -- search comments + highlighter
                            $highlight        = false;
                        Severity: Minor
                        Found in include/search.inc.php - About 5 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

                        Severity
                        Category
                        Status
                        Source
                        Language