XoopsModules25x/news

View on GitHub

Showing 236 of 310 total issues

Method exportNews has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $fromdate,
        $todate,
        $topicslist,
        $usetopicsdef,
        &$tbltopics,
Severity: Major
Found in class/NewsStory.php - About 50 mins to fix

    Method getBigStory has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $limit = 0,
            $start = 0,
            $checkRight = false,
            $topic = 0,
            $ihome = 0,
    Severity: Major
    Found in class/NewsStory.php - About 50 mins to fix

      Method getRandomNews has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $limit = 0,
              $start = 0,
              $checkRight = false,
              $topic = 0,
              $ihome = 0,
      Severity: Major
      Found in class/NewsStory.php - About 50 mins to fix

        Method makeMySelBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = ''): void
        Severity: Minor
        Found in class/XoopsTree.php - About 45 mins to fix

          Function newSubmissions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function newSubmissions(): void
          {
              global $dateformat, $pathIcon16;
              $start       = Request::getInt('startnew', 0, 'GET');
              $newsubcount = NewsStory::getAllStoriesCount(3, false);
          Severity: Minor
          Found in admin/index.php - About 45 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 replace has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function replace($replace_matches)
              {
                  $patterns = [];
                  if ($this->singlewords) {
                      $keywords = \explode(' ', $this->preg_keywords);
          Severity: Minor
          Found in class/Keyhighlighter.php - About 45 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

          Method makeSelBoxOptions has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              protected function makeSelBoxOptions($fieldName, $selected, $key, &$ret, $prefix_orig, $prefix_curr = ''): void
          Severity: Minor
          Found in class/ObjectTree.php - About 45 mins to fix

            Method news_getWysiwygForm has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function news_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
            Severity: Minor
            Found in include/functions.php - About 45 mins to fix

              Method makeMyTopicSelBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      $none = 0,
                      $seltopic = -1,
                      $selname = '',
                      $onchange = '',
                      $checkRight = false,
              Severity: Minor
              Found in class/NewsTopic.php - About 45 mins to fix

                Method getWysiwygForm has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static function getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
                Severity: Minor
                Found in class/Utility.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (is_file($templateFolder . $v)) {
                                                  unlink($templateFolder . $v);
                                              }
                  Severity: Major
                  Found in include/onupdate.php - About 45 mins to fix

                    Method news_resizePicture has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        $src_path,
                        $dst_path,
                        $param_width,
                        $param_height,
                        $keep_original = false,
                    Severity: Minor
                    Found in include/functions.php - About 45 mins to fix

                      Method resizePicture has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              $src_path,
                              $dst_path,
                              $param_width,
                              $param_height,
                              $keep_original = false,
                      Severity: Minor
                      Found in class/Utility.php - About 45 mins to fix

                        Function deleteBeforeDate has a Cognitive Complexity of 8 (exceeds 5 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 45 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 deeply nested control flow statements.
                        Open

                                                    if (file_exists($newName)) {
                                                        @unlink($fullPictureName);
                                                        rename($newName, $fullPictureName);
                                                    }
                        Severity: Major
                        Found in submit.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if (!unlink($currentPicture)) {
                                                  trigger_error('Error, impossible to delete the picture attached to this article');
                                              }
                          Severity: Major
                          Found in submit.php - About 45 mins to fix

                            Function countPublishedByTopic has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static function countPublishedByTopic($topicid = 0, $checkRight = false)
                                {
                                    /** @var \XoopsMySQLDatabase $db */
                                    $db  = \XoopsDatabaseFactory::getDatabaseConnection();
                                    $sql = 'SELECT COUNT(*) FROM ' . $db->prefix('news_stories') . ' WHERE published > 0 AND published <= ' . \time() . ' AND (expired = 0 OR expired > ' . \time() . ')';
                            Severity: Minor
                            Found in class/NewsStory.php - About 45 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 getArchive has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function getArchive(
                                    $publish_start,
                                    $publish_end,
                                    $checkRight = false,
                                    $asobject = true,
                            Severity: Minor
                            Found in class/NewsStory.php - About 45 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 deeply nested control flow statements.
                            Open

                                                            if (!$sfiles->store()) {
                                                                echo _AM_UPLOAD_DBERROR_SAVE;
                                                            }
                            Severity: Major
                            Found in submit.php - About 45 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                          if ($oldtitle[$i] !== $title[$i]
                                              || $oldweight[$i] !== $weight[$i]
                                              || $oldvisible[$i] !== $visible[$i]
                                              || $oldside[$i] !== $side[$i]
                                              || $oldbcachetime[$i] !== $bcachetime[$i]
                              Severity: Major
                              Found in class/Common/Blocksadmin.php - About 40 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language