XoopsModules25x/lexikon

View on GitHub

Showing 316 of 316 total issues

Method loadSampleData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function loadSampleData()
{
    global $xoopsConfig;
    $moduleDirName      = \basename(\dirname(__DIR__));
    $moduleDirNameUpper = mb_strtoupper($moduleDirName);
Severity: Minor
Found in testdata/index.php - About 1 hr to fix

    Method b_lxentries_top_edit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function b_lxentries_top_edit($options)
    {
        $form = "<table width='100%' border='0'  class='bg2'>";
        $form .= "<tr><th width='50%'>" . _OPTIONS . "</th><th width='50%'>" . _MB_LEXIKON_SETTINGS . '</th></tr>';
        $form .= "<tr><td class='even'>" . _MB_LEXIKON_ORDER . "</td><td class='odd'>";
    Severity: Minor
    Found in blocks/entries_top.php - About 1 hr to fix

      Method getCategoryArray has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getCategoryArray()
          {
              global $xoopsDB, $xoopsUser, $xoopsModule;
      
              $helper           = Helper::getInstance();
      Severity: Minor
      Found in class/Utility.php - About 1 hr to fix

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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                      if (is_object($xoopsUser) && empty($entryID)) {
                          /** @var \XoopsMemberHandler $memberHandler */
                          $memberHandler = xoops_getHandler('member');
                          $submitter     = $memberHandler->getUser($uid);
                          if (is_object($submitter)) {
          Severity: Major
          Found in admin/entry.php and 1 other location - About 1 hr to fix
          admin/category.php on lines 356..365

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 101.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                      if (is_object($xoopsUser) && empty($categoryID)) {
                          /** @var \XoopsMemberHandler $memberHandler */
                          $memberHandler = xoops_getHandler('member');
                          $submitter     = $memberHandler->getUser($uid);
                          if (is_object($submitter)) {
          Severity: Major
          Found in admin/category.php and 1 other location - About 1 hr to fix
          admin/entry.php on lines 441..450

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 101.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $objHandler,
                  $criteria = null,
                  $field_name = null,
                  array $alphabet = [],
                  $arg_name = 'letter',
          Severity: Major
          Found in class/Common/LetterChoice.php - About 1 hr to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    while (list($entryID, $categoryID, $term, $counter) = $xoopsDB->fetchRow($result)) {
                        $popentries             = [];
                        $linktext               = htmlspecialchars($term, ENT_QUOTES | ENT_HTML5);
                        $popentries['dir']      = $lexikon->dirname();
                        $popentries['linktext'] = $linktext;
            Severity: Minor
            Found in blocks/entries_top.php and 1 other location - About 1 hr to fix
            blocks/categories_block.php on lines 43..52

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 100.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    while (list($categoryID, $name, $total) = $xoopsDB->fetchRow($result)) {
                        $catlist             = [];
                        $linktext            = htmlspecialchars($name, ENT_QUOTES | ENT_HTML5);
                        $catlist['dir']      = $lexikon->dirname();
                        $catlist['linktext'] = $linktext;
            Severity: Minor
            Found in blocks/categories_block.php and 1 other location - About 1 hr to fix
            blocks/entries_top.php on lines 50..59

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 100.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    if ($entriesTempRows > $entriesPaginationLimit) {
                        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
            
                        $pagenav = new \XoopsPageNav($entriesTempRows, $entriesPaginationLimit, $start, 'start', 'op=list' . '&sort=' . $sort . '&order=' . $order . '');
                        $GLOBALS['xoopsTpl']->assign('pagenav', null === $pagenav ? $pagenav->renderNav() : '');
            Severity: Minor
            Found in admin/entries.php and 1 other location - About 55 mins to fix
            admin/categories.php on lines 70..75

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 99.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    if ($categoriesTempRows > $categoriesPaginationLimit) {
                        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
            
                        $pagenav = new \XoopsPageNav($categoriesTempRows, $categoriesPaginationLimit, $start, 'start', 'op=list' . '&sort=' . $sort . '&order=' . $order . '');
                        $GLOBALS['xoopsTpl']->assign('pagenav', null === $pagenav ? $pagenav->renderNav() : '');
            Severity: Minor
            Found in admin/categories.php and 1 other location - About 55 mins to fix
            admin/entries.php on lines 78..83

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 99.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Function xoops_module_install_lexikon has a Cognitive Complexity of 9 (exceeds 5 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 55 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 lexikon_notify_iteminfo has a Cognitive Complexity of 9 (exceeds 5 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 55 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 showTooltip has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            function showTooltip(e, tooltipTxt) {
            
                var bodyWidth = Math.max(document.body.clientWidth, document.documentElement.clientWidth) - 20;
            
                if (!dhtmlgoodies_tooltip) {
            Severity: Minor
            Found in assets/js/shadowtooltip.js - About 55 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 fadetransition has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            domticker.prototype.fadetransition = function (fadetype, timerid) {
                var contentdiv = this.contentdiv;
                if (fadetype == "reset")
                    this.opacitysetting = 0.2;
                if (contentdiv.filters && contentdiv.filters[0]) {
            Severity: Minor
            Found in assets/js/domticker.js - About 55 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 rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function rcopy($src, $dest)
                {
                    // Only continue if user is a 'global' Admin
                    if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                        return false;
            Severity: Minor
            Found in class/Common/FilesManagement.php - About 55 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 recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function recurseCopy($src, $dst)
                {
                    $dir = \opendir($src);
                    //        @mkdir($dst);
                    if (!@\mkdir($dst) && !\is_dir($dst)) {
            Severity: Minor
            Found in class/Common/FilesManagement.php - About 55 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 rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function rmove($src, $dest)
                {
                    // Only continue if user is a 'global' Admin
                    if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                        return false;
            Severity: Minor
            Found in class/Common/FilesManagement.php - About 55 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 setOrder has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                function setOrder($bid, $title, $weight, $visible, $side, $bcachetime, $bmodule = null)
            Severity: Major
            Found in admin/blocksadmin.php - About 50 mins to fix

              Method isBlockCloned has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options = null)
              Severity: Major
              Found in admin/blocksadmin.php - About 50 mins to fix
                Severity
                Category
                Status
                Source
                Language