XoopsModules25x/tag

View on GitHub

Showing 105 of 1,477 total issues

File Blocksadmin.php has 593 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php declare(strict_types=1);

namespace XoopsModules\Tag\Common;

/**
Severity: Major
Found in class/Common/Blocksadmin.php - About 1 day to fix

    Method listBlocks has 219 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function listBlocks(): void
        {
            global $xoopsModule, $pathIcon16;
            require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
            //        xoops_loadLanguage('admin', 'system');
    Severity: Major
    Found in class/Common/Blocksadmin.php - About 1 day to fix

      Function xoops_module_update_tag has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
      Open

      function xoops_module_update_tag(\XoopsModule $module, $previousVersion = null): bool
      {
          global $xoopsDB;
          $moduleDirName = \basename(\dirname(__DIR__));
      
      
      Severity: Minor
      Found in include/onupdate.php - About 1 day 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 truncateHtml has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function truncateHtml(
              string $text,
              ?int $length = 100,
              string $ending = '...',
              bool $exact = false,
      Severity: Minor
      Found in class/Common/SysUtility.php - About 1 day 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 updateByItem has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

          public function updateByItem($tags, int $itemid, $modid = '', int $catid = 0): bool
          {
              if (!empty($modid) && !\is_numeric($modid)) {
                  if (($GLOBALS['xoopsModule'] instanceof \XoopsModule)
                      && ($modid == $GLOBALS['xoopsModule']->getVar('dirname'))) {
      Severity: Minor
      Found in class/TagHandler.php - About 5 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 TagHandler.php has 374 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php declare(strict_types=1);
      
      namespace XoopsModules\Tag;
      
      /*
      Severity: Minor
      Found in class/TagHandler.php - About 5 hrs to fix

        Function listBlocks has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
        Open

            public function listBlocks(): void
            {
                global $xoopsModule, $pathIcon16;
                require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                //        xoops_loadLanguage('admin', 'system');
        Severity: Minor
        Found in class/Common/Blocksadmin.php - About 4 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 update_stats has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

            public function update_stats(int $tag_id, int $modid = 0, int $catid = 0): bool
            {
                if (0 === $tag_id) {
                    return true;
                }
        Severity: Minor
        Found in class/TagHandler.php - About 4 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 render has 95 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function render(?array $block = null)
            {
                \xoops_load('XoopsFormLoader');
                \xoops_loadLanguage('common', $this->moduleDirNameUpper);
        
        
        Severity: Major
        Found in class/Common/Blocksadmin.php - About 3 hrs to fix

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

          function tag_block_top_show(array $options, string $dirname = '', int $catid = 0)
          {
              if (!xoops_isActiveModule('tag')) {
                  return false;
              }
          Severity: Minor
          Found in blocks/block.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

          Method updateByItem has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function updateByItem($tags, int $itemid, $modid = '', int $catid = 0): bool
              {
                  if (!empty($modid) && !\is_numeric($modid)) {
                      if (($GLOBALS['xoopsModule'] instanceof \XoopsModule)
                          && ($modid == $GLOBALS['xoopsModule']->getVar('dirname'))) {
          Severity: Major
          Found in class/TagHandler.php - About 3 hrs to fix

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

                public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
                {
                    $myblock = new \XoopsBlock($bid);
                    $myblock->setVar('title', $btitle);
                    $myblock->setVar('weight', $bweight);
            Severity: Minor
            Found in class/Common/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 checkVerModule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function checkVerModule(Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
                {
                    $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

            Function orderBlock has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

                public function orderBlock(
                    array $bid,
                    array $oldtitle,
                    array $oldside,
                    array $oldweight,
            Severity: Minor
            Found in class/Common/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

            Method tag_block_top_show has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function tag_block_top_show(array $options, string $dirname = '', int $catid = 0)
            {
                if (!xoops_isActiveModule('tag')) {
                    return false;
                }
            Severity: Major
            Found in blocks/block.php - About 2 hrs to fix

              Method update_stats has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function update_stats(int $tag_id, int $modid = 0, int $catid = 0): bool
                  {
                      if (0 === $tag_id) {
                          return true;
                      }
              Severity: Major
              Found in class/TagHandler.php - About 2 hrs to fix

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

                    function tag_synchronization(): bool
                    {
                        /** @var \XoopsModuleHandler $moduleHandler */
                        $moduleHandler = xoops_getHandler('module');
                        $criteria      = new \CriteriaCompo(new \Criteria('isactive', '1'));
                Severity: Minor
                Found in include/functions.recon.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(
                        string $text,
                        ?int $length = 100,
                        string $ending = '...',
                        bool $exact = false,
                Severity: Major
                Found in class/Common/SysUtility.php - About 2 hrs to fix

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

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

                  function xoops_module_update_tag(\XoopsModule $module, $previousVersion = null): bool
                  {
                      global $xoopsDB;
                      $moduleDirName = \basename(\dirname(__DIR__));
                  
                  
                  Severity: Major
                  Found in include/onupdate.php - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language