XoopsModules25x/news

View on GitHub

Showing 236 of 310 total issues

Method renderImageNav has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function renderImageNav($offset = 4)
    {
        if ($this->total < $this->perpage) {
            return null;
        }
Severity: Minor
Found in class/PageNav.php - About 1 hr to fix

    Method editBlock has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function editBlock(int $bid): void
        {
            //        require_once \dirname(__DIR__,2) . '/admin/admin_header.php';
            //        \xoops_cp_header();
            \xoops_loadLanguage('admin', 'system');
    Severity: Minor
    Found in class/Common/Blocksadmin.php - About 1 hr to fix

      Method uname has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function uname($uid = 0)
          {
              global $xoopsConfig;
              static $tblusers = [];
              $option = -1;
      Severity: Minor
      Found in class/NewsStory.php - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

            if ($approveprivilege && 'edit' === $_GET['op']) {
                $op      = 'edit';
                $storyid = Request::getInt('storyid', 0, 'GET');
            } elseif ($approveprivilege && 'delete' === $_GET['op']) {
                $op      = 'delete';
        Severity: Critical
        Found in submit.php - About 1 hr to fix

          Method confirmBeforePrune has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function confirmBeforePrune(): void
          {
              global $dateformat;
              $story = new NewsStory();
              xoops_cp_header();
          Severity: Minor
          Found in admin/index.php - About 1 hr to fix

            Method news_tag_synchronization has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function news_tag_synchronization($mid): void
            {
                global $xoopsDB;
                $itemHandler_keyName = 'storyid';
                $itemHandler_table   = $xoopsDB->prefix('news_stories');
            Severity: Minor
            Found in class/plugins/plugin.tag.php - About 1 hr to fix

              Method renderNav has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function renderNav($offset = 4)
                  {
                      $ret = '';
                      if ($this->total <= $this->perpage) {
                          return $ret;
              Severity: Minor
              Found in class/PageNav.php - About 1 hr to fix

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

                function exportNews(): void
                {
                    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
                    xoops_cp_header();
                    $adminObject = Admin::getInstance();
                Severity: Minor
                Found in admin/index.php - About 1 hr to fix

                  Method getStoriesByIds has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getStoriesByIds(
                          $ids,
                          $checkRight = true,
                          $asobject = true,
                          $order = 'published',
                  Severity: Minor
                  Found in class/NewsStory.php - About 1 hr to fix

                    Function rrmdir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function rrmdir($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 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 news_tag_iteminfo has a Cognitive Complexity of 11 (exceeds 5 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

                    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 makeMySelBox has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function makeMySelBox(
                            $title,
                            $order,
                            $preset_id,
                            $none,
                    Severity: Minor
                    Found in class/NewsTopic.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 getStats has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getStats($limit)
                        {
                            $ret = [];
                            /** @var \XoopsMySQLDatabase $db */
                            $db   = \XoopsDatabaseFactory::getDatabaseConnection();
                    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 getStoriesByIds has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getStoriesByIds(
                            $ids,
                            $checkRight = true,
                            $asobject = true,
                            $order = 'published',
                    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

                    Method delTopic has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function delTopic(): void
                    {
                        global $xoopsDB, $xoopsModule;
                        if (!isset($_POST['ok'])) {
                            xoops_cp_header();
                    Severity: Minor
                    Found in admin/index.php - About 1 hr to fix

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

                      function xoops_module_install_news(\XoopsModule $module)
                      {
                          require_once \dirname(__DIR__, 3) . '/mainfile.php';
                      
                          $moduleDirName = \basename(\dirname(__DIR__));
                      Severity: Minor
                      Found in include/oninstall.php - About 1 hr to fix

                        Method loadTableFromArrayWithReplace has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function loadTableFromArrayWithReplace($table, $data, $search, $replace)
                        {
                            /** @var \XoopsMySQLDatabase $db */
                            $db = \XoopsDatabaseFactory::getDatabaseConnection();
                        
                        
                        Severity: Minor
                        Found in testdata/index.php - About 1 hr to fix

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

                              public static function getServerStats()
                              {
                                  //mb    $wfdownloads = WfdownloadsWfdownloads::getInstance();
                                  $moduleDirName      = \basename(\dirname(__DIR__, 2));
                                  $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                          Severity: Minor
                          Found in class/Common/ServerStats.php - About 1 hr to fix

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

                            function news_notify_iteminfo($category, $item_id)
                            {
                                if ('global' === $category) {
                                    $item['name'] = '';
                                    $item['url']  = '';
                            Severity: Minor
                            Found in include/notification.inc.php - About 1 hr to fix

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

                              function setPruneManager(): void
                              {
                                  require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
                                  xoops_cp_header();
                                  $adminObject = Admin::getInstance();
                              Severity: Minor
                              Found in admin/index.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language