XoopsModules25x/lexikon

View on GitHub

Showing 216 of 316 total issues

File submissions.php has 271 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

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

                  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

                    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

                      Method b_lxentries_alpha_show has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function b_lxentries_alpha_show($options)
                      {
                          global $xoopsDB, $xoopsUser, $xoopsModule;
                          $myts = \MyTextSanitizer::getInstance();
                      
                      
                      Severity: Major
                      Found in blocks/entries_initial.php - About 2 hrs to fix

                        Method b_scrolling_term_edit has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function b_scrolling_term_edit($options)
                        {
                            global $xoopsDB;
                            $myts = MyTextSanitizer:: getInstance();
                            $form = "<table style='width:100%' class='bg2'>";
                        Severity: Minor
                        Found in blocks/entries_scrolling.php - About 1 hr to fix

                          Method render has 48 lines of code (exceeds 25 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
                            Severity
                            Category
                            Status
                            Source
                            Language