XoopsModules25x/lexikon

View on GitHub

Showing 316 of 316 total issues

Method b_scrolling_term_show has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function b_scrolling_term_show($options)
{
    global $xoopsDB, $xoopsUser;
    $myts = MyTextSanitizer:: getInstance();
    $utility = new Utility();
Severity: Major
Found in blocks/entries_scrolling.php - About 2 hrs to fix

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

        public function render($alphaCount = null, $howmanyother = null)
        {
            $moduleDirName      = \basename(\dirname(__DIR__, 2));
            $moduleDirNameUpper = mb_strtoupper($moduleDirName);
            \xoops_loadLanguage('common', $moduleDirName);
    Severity: Major
    Found in class/Common/LetterChoice.php - About 2 hrs to fix

      Function __construct has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __construct($target)
          {
              global $helper;
              $this->targetObject = $target;
      
      
      Severity: Minor
      Found in class/Form/CategoriesForm.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 deleteDirectory has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function deleteDirectory($src)
          {
              // 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 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 getServiceLinks has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getServiceLinks($variable)
          {
              global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsConfig, $entrytype;
      
              $helper = Helper::getInstance();
      Severity: Major
      Found in class/Utility.php - About 2 hrs to fix

        Method lx_serviceLinks has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function lx_serviceLinks($variable)
        {
            global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsConfig, $entrytype;
        
            /** @var \XoopsModuleHandler $moduleHandler */
        Severity: Major
        Found in include/functions.php - About 2 hrs to fix

          Method xoops_module_update_lexikon has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function xoops_module_update_lexikon(\XoopsModule $module, $previousVersion = null)
          {
              $moduleDirName      = \basename(\dirname(__DIR__));
              $moduleDirNameUpper = mb_strtoupper($moduleDirName);
          
          
          Severity: Major
          Found in include/onupdate.php - About 2 hrs to fix

            Function xoops_module_update_lexikon_v152 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            function xoops_module_update_lexikon_v152($xoopsModule)
            {
                /**
                 * Create default upload directories
                 */
            Severity: Minor
            Found in include/update_function.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 xoops_module_install_lexikon has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            function xoops_module_install_lexikon(\XoopsObject $xoopsModule)
            {
                $module_id = $xoopsModule->getVar('mid');
                /** @var \XoopsGroupPermHandler $grouppermHandler */
                $grouppermHandler = xoops_getHandler('groupperm');
            Severity: Minor
            Found in include/install_function.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 lx_seemsUtf8 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            function lx_seemsUtf8($Str)
            { # by bmorel at ssi dot fr
                for ($i = 0, $iMax = mb_strlen($Str); $i < $iMax; ++$i) {
                    if (ord($Str[$i]) < 0x80) {
                        continue;
            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 isUtf8 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function isUtf8($Str)
                { # by bmorel at ssi dot fr
                    for ($i = 0, $iMax = mb_strlen($Str); $i < $iMax; ++$i) {
                        if (\ord($Str[$i]) < 0x80) {
                            continue;
            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 isBlockCloned has 56 lines of code (exceeds 25 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: Major
            Found in admin/blocksadmin.php - About 2 hrs to fix

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

              function xoops_module_install_lexikon(\XoopsObject $xoopsModule)
              {
                  $module_id = $xoopsModule->getVar('mid');
                  /** @var \XoopsGroupPermHandler $grouppermHandler */
                  $grouppermHandler = xoops_getHandler('groupperm');
              Severity: Major
              Found in include/install_function.php - About 2 hrs to fix

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

                if (1 == $helper->getConfig('multicats')) {
                    $xoopsTpl->assign('block0', $utility::getCategoryArray());
                    $xoopsTpl->assign('layout', CONFIG_CATEGORY_LAYOUT_PLAIN);
                    if (1 == $helper->getConfig('useshots')) {
                        $xoopsTpl->assign('show_screenshot', true);
                Severity: Major
                Found in entry.php and 1 other location - About 2 hrs to fix
                index.php on lines 112..122

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

                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

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

                if (1 == $helper->getConfig('multicats')) {
                    $xoopsTpl->assign('block0', $utility::getCategoryArray());
                    $xoopsTpl->assign('layout', CONFIG_CATEGORY_LAYOUT_PLAIN);
                    if (1 == $helper->getConfig('useshots')) {
                        $xoopsTpl->assign('show_screenshot', true);
                Severity: Major
                Found in index.php and 1 other location - About 2 hrs to fix
                entry.php on lines 61..71

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

                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

                File submit.php has 259 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Module: Lexikon - glossary module
                 * Author: hsalazar
                 * Licence: GNU
                Severity: Minor
                Found in submit.php - About 2 hrs to fix

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

                                  $categoriesArray['edit_delete'] = "<a href='categories.php?op=edit&categoryID=" . $i . "'><img src=" . $pathIcon16 . "/edit.png alt='" . _EDIT . "' title='" . _EDIT . "'></a>
                                 <a href='categories.php?op=delete&categoryID=" . $i . "'><img src=" . $pathIcon16 . "/delete.png alt='" . _DELETE . "' title='" . _DELETE . "'></a>
                                 <a href='categories.php?op=clone&categoryID=" . $i . "'><img src=" . $pathIcon16 . "/editcopy.png alt='" . _CLONE . "' title='" . _CLONE . "'></a>";
                  Severity: Major
                  Found in admin/categories.php and 1 other location - About 2 hrs to fix
                  admin/entries.php on lines 193..195

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

                  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

                                  $entriesArray['edit_delete'] = "<a href='entries.php?op=edit&entryID=" . $i . "'><img src=" . $pathIcon16 . "/edit.png alt='" . _EDIT . "' title='" . _EDIT . "'></a>
                                 <a href='entries.php?op=delete&entryID=" . $i . "'><img src=" . $pathIcon16 . "/delete.png alt='" . _DELETE . "' title='" . _DELETE . "'></a>
                                 <a href='entries.php?op=clone&entryID=" . $i . "'><img src=" . $pathIcon16 . "/editcopy.png alt='" . _CLONE . "' title='" . _CLONE . "'></a>";
                  Severity: Major
                  Found in admin/entries.php and 1 other location - About 2 hrs to fix
                  admin/categories.php on lines 128..130

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

                  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 lx_importMenu has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function lx_importMenu($currentoption = 0, $breadcrumb = '')
                  {
                      global $cf;
                      echo "<table style='border:0; width:99%;'>
                                <tr><td style='vertical-align:top;'>
                  Severity: Major
                  Found in admin/functions.php - About 2 hrs to fix

                    Function render has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function render($alphaCount = null, $howmanyother = null)
                        {
                            $moduleDirName      = \basename(\dirname(__DIR__, 2));
                            $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                            \xoops_loadLanguage('common', $moduleDirName);
                    Severity: Minor
                    Found in class/Common/LetterChoice.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

                    Severity
                    Category
                    Status
                    Source
                    Language