XoopsModules25x/lexikon

View on GitHub

Showing 216 of 316 total issues

Method getAuthorProfile has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getAuthorProfile($uid)
    {
        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
        global $authortermstotal, $xoopsTpl, $xoopsDB, $xoopsUser;

Severity: Minor
Found in class/Utility.php - About 1 hr to fix

    Method convertHtml2text has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function convertHtml2text($document)
        {
            // PHP Manual:: function preg_replace $document should contain an HTML document.
            // This will remove HTML tags, javascript sections and white space. It will also
            // convert some common HTML entities to their text equivalent.
    Severity: Minor
    Found in class/Utility.php - About 1 hr to fix

      Method b_lxspot_edit has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function b_lxspot_edit($options)
      {
          global $xoopsDB;
          $myts      = MyTextSanitizer:: getInstance();
          $resultcat = $xoopsDB->query('SELECT categoryID, name FROM ' . $xoopsDB->prefix('lxcategories') . ' ORDER BY categoryID');
      Severity: Minor
      Found in blocks/entries_spot.php - About 1 hr to fix

        Method myblocksadmin_update_blockinstance has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function myblocksadmin_update_blockinstance(
            $id,
            $bside,
            $bweight,
            $bvisible,
        Severity: Minor
        Found in include/blocksadmin.inc.php - About 1 hr to fix

          Method makeMySelBox has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
              {
                  if ('' == $sel_name) {
                      $sel_name = $this->id;
                  }
          Severity: Minor
          Found in class/LexikonTree.php - About 1 hr to fix

            Function lx_getLinkedUnameFromId has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            function lx_getLinkedUnameFromId($userid = 0, $name = 0)
            {
                if (!is_numeric($userid)) {
                    return $userid;
                }
            Severity: Minor
            Found in include/functions.php - About 1 hr 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 entryDefault has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            function entryDefault()
            {
                global $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $entryID, $pathIcon16;
                $helper = Helper::getInstance();
                require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
            Severity: Minor
            Found in admin/entry.php - About 1 hr 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 getLinkedUnameFromId has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function getLinkedUnameFromId($userid = 0, $name = 0)
                {
                    if (!\is_numeric($userid)) {
                        return $userid;
                    }
            Severity: Minor
            Found in class/Utility.php - About 1 hr 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 xcopy has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function xcopy($source, $dest)
                {
                    // Check for symlinks
                    if (\is_link($source)) {
                        return \symlink(\readlink($source), $dest);
            Severity: Minor
            Found in class/Common/FilesManagement.php - About 1 hr 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 render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public function render()
                {
                    // load all child ids for javascript codes
                    foreach (\array_keys($this->_itemTree) as $item_id) {
                        $this->_itemTree[$item_id]['allchild'] = [];
            Severity: Minor
            Found in class/GroupPermForm.php - About 1 hr 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 render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public function render()
                {
                    $ret = '';
            
                    if (\count($this->_appendix) > 0) {
            Severity: Minor
            Found in class/GroupFormCheckBox.php - About 1 hr 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 makeMySelBox has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
                {
                    if ('' == $sel_name) {
                        $sel_name = $this->id;
                    }
            Severity: Minor
            Found in class/LexikonTree.php - About 1 hr 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 lexikon_block_getAuthors has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function lexikon_block_getAuthors($limit = 5, $sort = 'count', $name = 'uname', $compute_method = 'average')
            {
                $limit = (int)$limit;
                if ('uname' !== $name) {
                    $name = 'name';
            Severity: Minor
            Found in include/functions.php - About 1 hr to fix

              Method lexikon_notify_iteminfo has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function lexikon_notify_iteminfo($category, $item_id)
              {
                  /*global $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
              
                  if (empty($xoopsModule) || $xoopsModule->getVar('dirname') != 'lexikon') {
              Severity: Minor
              Found in include/notification.inc.php - About 1 hr to fix

                Method xoops_module_install_lexikon has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function xoops_module_install_lexikon(\XoopsModule $module)
                {
                    $moduleDirName = \basename(\dirname(__DIR__));
                
                    $helper       = Helper::getInstance();
                Severity: Minor
                Found in include/oninstall.php - About 1 hr to fix

                  Method getAlphaArray has 35 lines of code (exceeds 25 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 1 hr to fix

                    Method render has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function render()
                        {
                            $ret = '';
                    
                            if (\count($this->_appendix) > 0) {
                    Severity: Minor
                    Found in class/GroupFormCheckBox.php - About 1 hr to fix

                      Method getBlockAuthors has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function getBlockAuthors($limit = 5, $sort = 'count', $name = 'uname', $compute_method = 'average')
                          {
                              $limit = (int)$limit;
                              if ('uname' !== $name) {
                                  $name = 'name';
                      Severity: Minor
                      Found in class/Utility.php - About 1 hr to fix

                        Method myblocksadmin_update_blockinstance has 11 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            $id,
                            $bside,
                            $bweight,
                            $bvisible,
                            $btitle,
                        Severity: Major
                        Found in include/blocksadmin.inc.php - About 1 hr to fix

                          Function positiontip has 33 lines of code (exceeds 25 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 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language