XoopsModules25x/rss

View on GitHub

Showing 80 of 101 total issues

Method outputRssFeed has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function outputRssFeed(string $feed_url, int $maxItemCount = 10, bool $show_date = true, bool $show_description = true, int $max_words = 0): void
Severity: Minor
Found in class/Utility.php - About 35 mins to fix

    Method truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            string $text,
            ?int $length = 100,
            string $ending = '...',
            bool $exact = false,
            bool $considerHtml = true
    Severity: Minor
    Found in class/Common/SysUtility.php - About 35 mins to fix

      Function renameColumns has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          private function renameColumns(): void
          {
              foreach ($this->renameColumns as $tableName) {
                  if ($this->tableHandler->useTable($tableName)) {
                      $oldName    = $tableName['from'];
      Severity: Minor
      Found in class/Common/Migrate.php - About 35 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 getActivatedSubfeeds has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function &getActivatedSubfeeds(string $fields = '', string $type = ''): ?array
          {
              $ret  = null;
              $subs = $this->pluginHandler->getObjects2(new \Criteria('subfeed', '1'), $fields);
              if (\is_array($subs) && !empty($subs)) {
      Severity: Minor
      Found in class/FeedHandler.php - About 35 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 xoops_module_update_rssfit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      function xoops_module_update_rssfit(\XoopsModule $xoopsMod, int $previousVersion): bool
      {
          global $xoopsDB;
          $helper = Rssfit\Helper::getInstance();
          //    rssfInstallLangFile($xoopsMod, $xoopsConfig['language']);
      Severity: Minor
      Found in include/install.php - About 35 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 getEditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getEditor(?\Xmf\Module\Helper $helper = null, ?array $options = null): ?\XoopsFormTextArea
          {
              $descEditor = null;
      
              /** @var Helper $helper */
      Severity: Minor
      Found in class/Common/SysUtility.php - About 35 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 getSticky has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getSticky(array &$feed): bool
          {
              if (!$intr = $this->miscHandler->getObjects2(new \Criteria('misc_category', 'sticky'))) {
                  return false;
              }
      Severity: Minor
      Found in class/FeedHandler.php - About 35 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

      Avoid too many return statements within this method.
      Open

              return $object->getVar($this->objKey);
      Severity: Major
      Found in class/MiscHandler.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return false;
        Severity: Major
        Found in class/PluginHandler.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return false;
          Severity: Major
          Found in class/MiscHandler.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return $object->getVar($this->objKey);
            Severity: Major
            Found in class/PluginHandler.php - About 30 mins to fix

              Function checkSubFeed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function checkSubFeed(array &$feed): void
                  {
                      if (!empty($feed['plugin'])) {
                          $criteria = new \CriteriaCompo();
                          $criteria->add(new \Criteria('rssf_filename', \sprintf($this->pluginFile, $feed['plugin'])));
              Severity: Minor
              Found in class/FeedHandler.php - About 25 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 grabEntries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function grabEntries(\XoopsMySQLDatabase $xoopsDB): ?array
                  {
                      $ret  = null;
                      $i    = 0;
                      //  The following example code grabs the latest entries from the module
              Severity: Minor
              Found in class/Plugins/Wgsimpleacc.php - About 25 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 grabEntries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function grabEntries(\XoopsMySQLDatabase $xoopsDB): ?array
                  {
                      $myts = \MyTextSanitizer::getInstance();
              
                      /** @var \XoopsGroupPermHandler $grouppermHandler */
              Severity: Minor
              Found in class/Plugins/Wfdownloads.php - About 25 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 grabEntries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function grabEntries(\XoopsMySQLDatabase $xoopsDB):?array
                  {
                      @require_once XOOPS_ROOT_PATH . '/modules/wfsection/include/groupaccess.php';
                      $ret = null;
                      $i = 0;
              Severity: Minor
              Found in class/Plugins/legacy/Wfsection.php - About 25 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 grabEntries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function grabEntries(\XoopsMySQLDatabase $xoopsDB): ?array
                  {
                      $myts = \MyTextSanitizer::getInstance();
                      $ret  = null;
                      require XOOPS_ROOT_PATH . '/include/comment_constants.php';
              Severity: Minor
              Found in class/Plugins/Comments.php - About 25 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 grabEntries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function grabEntries(\XoopsMySQLDatabase $xoopsDB): ?array
                  {
                      global $xoopsUser;
              
                      $groups = \is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
              Severity: Minor
              Found in class/Plugins/Wflinks.php - About 25 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 loadSampleData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              function loadSampleData(): void
              {
                  global $xoopsConfig;
                  $moduleDirName      = \basename(\dirname(__DIR__));
                  $moduleDirNameUpper = mb_strtoupper($moduleDirName);
              Severity: Minor
              Found in testdata/index.php - About 25 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 xoops_module_uninstall_rssfit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              function xoops_module_uninstall_rssfit(\XoopsModule $module): bool
              {
                  //    return true;
              
                  $moduleDirName      = \basename(\dirname(__DIR__));
              Severity: Minor
              Found in include/onuninstall.php - About 25 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 xoops_module_install_rssfit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              function xoops_module_install_rssfit(\XoopsModule $module): bool
              {
                  require_once \dirname(__DIR__) . '/preloads/autoloader.php';
                  require_once \dirname(__DIR__, 3) . '/mainfile.php';
              
              
              Severity: Minor
              Found in include/oninstall.php - About 25 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

              Severity
              Category
              Status
              Source
              Language