XoopsModules25x/news

View on GitHub

Showing 236 of 310 total issues

Method deleteBeforeDate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function deleteBeforeDate($timestamp, $expired, $topicslist = '')
    {
        global $xoopsModule;
        /** @var \XoopsMySQLDatabase $db */
        $db           = \XoopsDatabaseFactory::getDatabaseConnection();
Severity: Minor
Found in class/NewsStory.php - About 1 hr to fix

    Method updateBlock has 9 arguments (exceeds 4 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
    Severity: Major
    Found in class/Common/Blocksadmin.php - About 1 hr to fix

      Method news_tag_iteminfo has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function news_tag_iteminfo(&$items)
      {
          if (empty($items) || !\is_array($items)) {
              return false;
          }
      Severity: Minor
      Found in class/plugins/plugin.tag.php - About 1 hr to fix

        Method xoops_module_install_news has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function xoops_module_install_news(\XoopsModule $module)
        {
            $module_id = $module->getVar('mid');
            /** @var \XoopsGroupPermHandler $grouppermHandler */
            $grouppermHandler = xoops_getHandler('groupperm');
        Severity: Minor
        Found in include/install_function.php - About 1 hr to fix

          Method adminlink has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function adminlink()
              {
                  global $xoopsModule;
                  $dirname = \basename(\dirname(__DIR__));
                  /** @var \XoopsModuleHandler $moduleHandler */
          Severity: Minor
          Found in class/NewsStory.php - About 1 hr to fix

            Method bodytext has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function bodytext($format = 'Show')
                {
                    $myts   = \MyTextSanitizer::getInstance();
                    $html   = 1;
                    $smiley = 1;
            Severity: Minor
            Found in class/NewsStory.php - About 1 hr to fix

              Method getAllStoriesCount has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function getAllStoriesCount($storytype = 1, $checkRight = false)
                  {
                      /** @var \XoopsMySQLDatabase $db */
                      $db  = \XoopsDatabaseFactory::getDatabaseConnection();
                      $sql = 'SELECT count(*) AS cpt FROM ' . $db->prefix('news_stories') . ' WHERE ';
              Severity: Minor
              Found in class/NewsStory.php - About 1 hr to fix

                Function news_updateCache has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                function news_updateCache(): void
                {
                    global $xoopsModule;
                    $folder  = $xoopsModule->getVar('dirname');
                    $tpllist = [];
                Severity: Minor
                Found in include/functions.php - About 1 hr 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 b_news_archives_edit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                function b_news_archives_edit($options)
                {
                    global $xoopsDB;
                    $syear    = $smonth = $eyear = $emonth = $older = $recent = 0;
                    $selsyear = $selsmonth = $seleyear = $selemonth = 0;
                Severity: Minor
                Found in blocks/news_archives.php - About 1 hr 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 saveMetagenBlackList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                function saveMetagenBlackList(): void
                {
                    $blacklist = new Blacklist();
                    $words     = $blacklist->getAllKeywords();
                
                
                Severity: Minor
                Found in admin/index.php - About 1 hr 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 renderEnhancedSelect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function renderEnhancedSelect($showbutton = false, $titles = null)
                    {
                        if ($this->total < $this->perpage) {
                            return null;
                        }
                Severity: Minor
                Found in class/PageNav.php - About 1 hr 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 exportNews has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function exportNews(
                        $fromdate,
                        $todate,
                        $topicslist,
                        $usetopicsdef,
                Severity: Minor
                Found in class/NewsStory.php - About 1 hr 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 updateCache has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function updateCache(): void
                    {
                        global $xoopsModule;
                        $folder  = $xoopsModule->getVar('dirname');
                        $tpllist = [];
                Severity: Minor
                Found in class/Utility.php - About 1 hr 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 renderSelect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function renderSelect($showbutton = false)
                    {
                        if ($this->total < $this->perpage) {
                            return null;
                        }
                Severity: Minor
                Found in class/PageNav.php - About 1 hr 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 loadSampleData has 27 lines of code (exceeds 25 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 1 hr to fix

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

                      public function _searchPreviousOrNextArticle($storyid, $next = true, $checkRight = false)
                      {
                          /** @var \XoopsMySQLDatabase $db */
                          $db      = \XoopsDatabaseFactory::getDatabaseConnection();
                          $ret     = [];
                  Severity: Minor
                  Found in class/NewsStory.php - About 1 hr to fix

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

                        public function exportNews(
                            $fromdate,
                            $todate,
                            $topicslist,
                            $usetopicsdef,
                    Severity: Minor
                    Found in class/NewsStory.php - About 1 hr to fix

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

                          public function auto_summary($text, &$titles)
                          {
                              $auto_summary = '';
                              if (Utility::getModuleOption('enhanced_pagenav')) {
                                  $expr_matches = [];
                      Severity: Minor
                      Found in class/NewsStory.php - About 1 hr to fix

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

                            public function __construct()
                            {
                                parent::__construct();
                                $this->initVar('storyid', \XOBJ_DTYPE_INT, null, false, 8);
                                $this->initVar('uid', \XOBJ_DTYPE_INT, null, false, 5);
                        Severity: Minor
                        Found in class/NewsStories.php - About 1 hr to fix

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

                              public function hometext($format = 'Show')
                              {
                                  $hometext = '';
                                  $myts     = \MyTextSanitizer::getInstance();
                                  $html     = $smiley = $xcodes = 1;
                          Severity: Minor
                          Found in class/NewsStory.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language