XoopsModules25x/lexikon

View on GitHub

Showing 216 of 316 total issues

Method removeAccents has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function removeAccents($string)
    {
        $chars['in']  = \chr(128)
                        . \chr(131)
                        . \chr(138)
Severity: Major
Found in class/Utility.php - About 3 hrs to fix

    Method categoryEdit has 91 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function categoryEdit($categoryID = '')
    {
        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
        require_once XOOPS_ROOT_PATH . '/class/uploader.php';
        require_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
    Severity: Major
    Found in admin/category.php - About 3 hrs to fix

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

      function DefinitionImport($delete)
      {
          global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $myts;
          $myts = \MyTextSanitizer::getInstance();
      
      
      Severity: Major
      Found in admin/importwiwimod.php - About 3 hrs to fix

        Function updateBlock has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

            function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
            {
                $myblock = new \XoopsBlock($bid);
                $myblock->setVar('title', $btitle);
                $myblock->setVar('weight', $bweight);
        Severity: Minor
        Found in admin/blocksadmin.php - About 3 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 25 (exceeds 5 allowed). Consider refactoring.
        Open

        function DefinitionImport($delete)
        {
            global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $myts;
            $myts = \MyTextSanitizer::getInstance();
        
        
        Severity: Minor
        Found in admin/importwiwimod.php - About 3 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 positiontip has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

        function positiontip(e) {
            if (enabletip) {
                var nondefaultpos = false;
                var curX = (ns6) ? e.pageX : event.clientX + ietruebody().scrollLeft;
                var curY = (ns6) ? e.pageY : event.clientY + ietruebody().scrollTop;
        Severity: Minor
        Found in assets/js/tooltipscript2.js - About 3 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 categorySave has 81 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function categorySave($categoryID = '')
        {
            require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
            require_once XOOPS_ROOT_PATH . '/class/uploader.php';
            global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB, $myts, $categoryID;
        Severity: Major
        Found in admin/category.php - About 3 hrs to fix

          Method __construct has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function __construct($target)
              {
                  $db      = \XoopsDatabaseFactory::getDatabaseConnection();
                  $helper  = Helper::getInstance();
                  $utility = new Utility();
          Severity: Major
          Found in class/Form/EntriesForm.php - About 3 hrs to fix

            Function lx_extract_keywords has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

            function lx_extract_keywords($content)
            {
                global $xoopsTpl, $xoTheme, $xoopsModule, $xoopsModuleConfig;
                require_once XOOPS_ROOT_PATH . '/modules/lexikon/include/common.inc.php';
                $keywords_count = $helper->getConfig('metakeywordsnum');
            Severity: Minor
            Found in include/functions.php - About 3 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 extractKeywords has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function extractKeywords($content)
                {
                    global $xoopsTpl, $xoTheme, $xoopsModule;
            
                    $helper = Helper::getInstance();
            Severity: Minor
            Found in class/Utility.php - About 3 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 checkVerModule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function checkVerModule($helper, $source = 'github', $default = 'master')
                {
                    $moduleDirName      = \basename(\dirname(__DIR__, 2));
                    $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                    $update             = '';
            Severity: Minor
            Found in class/Common/VersionChecks.php - About 2 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

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

            <?php
            /**
             * Module: lexikon
             * Author: Yerres
             * Licence: GNU
            Severity: Minor
            Found in admin/functions.php - About 2 hrs to fix

              Method lx_GetStatistics has 69 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function lx_GetStatistics($limit)
              {
                  $ret  = [];
                  $db   = \XoopsDatabaseFactory::getDatabaseConnection();
                  $tbls = $db->prefix('lxentries');
              Severity: Major
              Found in admin/functions.php - About 2 hrs to fix

                Method categoryDefault has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function categoryDefault()
                {
                    $helper = Helper::getInstance();
                    $op = 'default';
                    require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                Severity: Major
                Found in admin/category.php - About 2 hrs to fix

                  Method myblocksadmin_update_block has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function myblocksadmin_update_block(
                      $bid,
                      $bside,
                      $bweight,
                      $bvisible,
                  Severity: Major
                  Found in include/blocksadmin.inc.php - About 2 hrs to fix

                    Function lx_module_header has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function lx_module_header()
                    {
                        global $xoopsTpl, $xoTheme, $xoopsModule, $xoopsModuleConfig, $lexikon_module_header;
                        if (isset($xoTheme) && is_object($xoTheme)) {
                            $xoTheme->addStylesheet('modules/lexikon/assets/css/style.css');
                    Severity: Minor
                    Found in include/functions.php - About 2 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 isBlockCloned has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options = null)
                        {
                            xoops_loadLanguage('admin', 'system');
                            xoops_loadLanguage('admin/blocksadmin', 'system');
                            xoops_loadLanguage('admin/groups', 'system');
                    Severity: Minor
                    Found in admin/blocksadmin.php - About 2 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 getModuleHeader has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function getModuleHeader()
                        {
                            global $xoopsTpl, $xoTheme, $xoopsModule, $lexikon_module_header;
                    
                            $helper = Helper::getInstance();
                    Severity: Minor
                    Found in class/Utility.php - About 2 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 truncateHtml has 63 lines of code (exceeds 25 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: Major
                    Found in class/Utility.php - About 2 hrs to fix

                      Method truncateHtml has 63 lines of code (exceeds 25 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: Major
                      Found in class/Common/SysUtility.php - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language