XoopsModules25x/news

View on GitHub

Showing 236 of 310 total issues

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

    public static function getAllSubmitted($limit = 0, $asobject = true, $checkRight = false, $start = 0)
    {
        /** @var \XoopsMySQLDatabase $db */
        $db       = \XoopsDatabaseFactory::getDatabaseConnection();
        $myts     = \MyTextSanitizer::getInstance();
Severity: Minor
Found in class/NewsStory.php - About 1 hr to fix

    Method renderEnhancedSelect has 26 lines of code (exceeds 25 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

      Method isBlockCloned has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function isBlockCloned(int $bid, 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 makeSelectElement has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $name,
                $fieldName,
                $prefix = '-',
                $selected = '',
                $addEmptyOption = false,
        Severity: Major
        Found in class/ObjectTree.php - About 1 hr to fix

          Method getAllPublished has 8 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 1 hr to fix

            Function b_news_bigstory_show has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            function b_news_bigstory_show()
            {
                // require_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
            
                /** @var Helper $helper */
            Severity: Minor
            Found in blocks/news_bigstory.php - About 55 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 rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function rcopy($src, $dest)
                {
                    // 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 55 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 addkeywords has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function addkeywords($keyword): void
                {
                    $myts = \MyTextSanitizer::getInstance();
                    if (\is_array($keyword)) {
                        foreach ($keyword as $onekeyword) {
            Severity: Minor
            Found in class/Blacklist.php - About 55 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 rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function rmove($src, $dest)
                {
                    // 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 55 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 recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function recurseCopy($src, $dst): void
                {
                    $dir = \opendir($src);
                    //        @mkdir($dst);
                    if (!@\mkdir($dst) && !\is_dir($dst)) {
            Severity: Minor
            Found in class/Common/FilesManagement.php - About 55 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 remove_blacklisted has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function remove_blacklisted($keywords)
                {
                    $ret       = [];
                    $tmp_array = \array_values($this->keywords);
                    foreach ($keywords as $onekeyword) {
            Severity: Minor
            Found in class/Blacklist.php - About 55 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 b_news_randomnews_edit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            function b_news_randomnews_edit($options)
            {
                global $xoopsDB;
                $form = _MB_NEWS_ORDER . "&nbsp;<select name='options[]'>";
                $form .= "<option value='published'";
            Severity: Minor
            Found in blocks/news_randomnews.php - About 55 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 getAllStoriesCount has a Cognitive Complexity of 9 (exceeds 5 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 55 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 getAllSubmitted has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function getAllSubmitted($limit = 0, $asobject = true, $checkRight = false, $start = 0)
                {
                    /** @var \XoopsMySQLDatabase $db */
                    $db       = \XoopsDatabaseFactory::getDatabaseConnection();
                    $myts     = \MyTextSanitizer::getInstance();
            Severity: Minor
            Found in class/NewsStory.php - About 55 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 uname has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function uname($uid = 0)
                {
                    global $xoopsConfig;
                    static $tblusers = [];
                    $option = -1;
            Severity: Minor
            Found in class/NewsStory.php - About 55 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 _searchPreviousOrNextArticle has a Cognitive Complexity of 9 (exceeds 5 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 55 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 store has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function store($approved = false)
                {
                    $myts        = \MyTextSanitizer::getInstance();
                    $counter     = $this->counter ?? 0;
                    $title       = $GLOBALS['xoopsDB']->escape($myts->censorString($this->title));
            Severity: Minor
            Found in class/NewsStory.php - About 55 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 makeSelBox has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    $name,
                    $fieldName,
                    $prefix = '-',
                    $selected = '',
                    $addEmptyOption = false,
            Severity: Major
            Found in class/ObjectTree.php - About 50 mins to fix

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

                      $title,
                      $order,
                      $preset_id,
                      $none,
                      $sel_name,
              Severity: Major
              Found in class/NewsTopic.php - About 50 mins to fix

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

                    public function setOrder(string $bid, string $title, string $weight, string $visible, string $side, string $bcachetime, ?array $bmodule = null): void
                Severity: Major
                Found in class/Common/Blocksadmin.php - About 50 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language