XoopsModules25x/news

View on GitHub
admin/index.php

Summary

Maintainability
F
2 wks
Test Coverage

File index.php has 1675 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php declare(strict_types=1);
//
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System                                    //
// Copyright (c) 2000-2020 XOOPS.org                                             //
Severity: Major
Found in admin/index.php - About 4 days to fix

    Method topicsmanager has 395 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function topicsmanager(): void
    {
        global $xoopsDB, $xoopsConfig, $xoopsModule, $myts;
        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
        xoops_cp_header();
    Severity: Major
    Found in admin/index.php - About 1 day to fix

      Function addTopic has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
      Open

      function addTopic(): void
      {
          global $xoopsDB, $xoopsModule;
          $helper = Helper::getInstance();
      
      
      Severity: Minor
      Found in admin/index.php - About 6 hrs 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 getStats has 144 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getStats(): void
      {
          global $xoopsModule, $xoopsConfig;
          xoops_cp_header();
          $myts   = \MyTextSanitizer::getInstance();
      Severity: Major
      Found in admin/index.php - About 5 hrs to fix

        Function topicsmanager has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
        Open

        function topicsmanager(): void
        {
            global $xoopsDB, $xoopsConfig, $xoopsModule, $myts;
            require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
            xoops_cp_header();
        Severity: Minor
        Found in admin/index.php - About 5 hrs 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 modTopicS has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

        function modTopicS(): void
        {
            global $xoopsDB, $xoopsModule;
            $helper = Helper::getInstance();
        
        
        Severity: Minor
        Found in admin/index.php - About 4 hrs 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 launchNewsletter has 93 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function launchNewsletter(): void
        {
            global $xoopsConfig, $dateformat;
            xoops_cp_header();
            $adminObject = Admin::getInstance();
        Severity: Major
        Found in admin/index.php - About 3 hrs to fix

          Method modTopicS has 80 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function modTopicS(): void
          {
              global $xoopsDB, $xoopsModule;
              $helper = Helper::getInstance();
          
          
          Severity: Major
          Found in admin/index.php - About 3 hrs to fix

            Method launchExport has 80 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function launchExport(): void
            {
                xoops_cp_header();
                $adminObject = Admin::getInstance();
                $adminObject->displayNavigation('index.php?op=export');
            Severity: Major
            Found in admin/index.php - About 3 hrs to fix

              Method autoStories has 78 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function autoStories(): void
              {
                  global $dateformat, $pathIcon16;
              
                  $start        = Request::getInt('startauto', 0, 'GET');
              Severity: Major
              Found in admin/index.php - About 3 hrs to fix

                Method addTopic has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function addTopic(): void
                {
                    global $xoopsDB, $xoopsModule;
                    $helper = Helper::getInstance();
                
                
                Severity: Major
                Found in admin/index.php - About 2 hrs to fix

                  Method newSubmissions has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function newSubmissions(): void
                  {
                      global $dateformat, $pathIcon16;
                      $start       = Request::getInt('startnew', 0, 'GET');
                      $newsubcount = NewsStory::getAllStoriesCount(3, false);
                  Severity: Major
                  Found in admin/index.php - About 2 hrs to fix

                    Method getMetagen has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function getMetagen(): void
                    {
                        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
                        global $xoopsModule, $xoopsConfig, $cfg;
                        $helper = Helper::getInstance();
                    Severity: Major
                    Found in admin/index.php - About 2 hrs to fix

                      Function launchNewsletter has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function launchNewsletter(): void
                      {
                          global $xoopsConfig, $dateformat;
                          xoops_cp_header();
                          $adminObject = Admin::getInstance();
                      Severity: Minor
                      Found in admin/index.php - About 2 hrs 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 expStories has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function expStories(): void
                      {
                          global $dateformat, $pathIcon16;
                          $start        = Request::getInt('startexp', 0, 'GET');
                          $expiredcount = NewsStory::getAllStoriesCount(1, false);
                      Severity: Major
                      Found in admin/index.php - About 2 hrs to fix

                        Method lastStories has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function lastStories(): void
                        {
                            global $dateformat, $pathIcon16;
                            news_collapsableBar('laststories', 'toplaststories');
                            echo "<img onclick=\"toggle('toptable'); toggleIcon('toptableicon');\" id='toplaststories' name='toplaststories' src='" . $pathIcon16 . "/close12.gif' alt=''></a>&nbsp;" . sprintf(_AM_LAST10ARTS, Utility::getModuleOption('storycountadmin')) . '</h4>';
                        Severity: Major
                        Found in admin/index.php - About 2 hrs to fix

                          Function getStats has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function getStats(): void
                          {
                              global $xoopsModule, $xoopsConfig;
                              xoops_cp_header();
                              $myts   = \MyTextSanitizer::getInstance();
                          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 delTopic has a Cognitive Complexity of 13 (exceeds 5 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

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

                          function launchExport(): void
                          {
                              xoops_cp_header();
                              $adminObject = Admin::getInstance();
                              $adminObject->displayNavigation('index.php?op=export');
                          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

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

                          function createNewsletter(): 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 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 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 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 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

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

                                    function getMetagen(): void
                                    {
                                        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
                                        global $xoopsModule, $xoopsConfig, $cfg;
                                        $helper = Helper::getInstance();
                                    Severity: Minor
                                    Found in admin/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

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                        foreach ($lessreadednews as $storyid => $data) {
                                            $url1  = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/index.php?storytopic=' . $data['topicid'];
                                            $url2  = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/article.php?storyid=' . $storyid;
                                            $url3  = XOOPS_URL . '/userinfo.php?uid=' . $data['uid'];
                                            $class = ('even' === $class) ? 'odd' : 'even';
                                    Severity: Major
                                    Found in admin/index.php and 1 other location - About 5 hrs to fix
                                    admin/index.php on lines 1564..1579

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 202.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                        foreach ($mostreadednews as $storyid => $data) {
                                            $url1  = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/index.php?storytopic=' . $data['topicid'];
                                            $url2  = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/article.php?storyid=' . $storyid;
                                            $url3  = XOOPS_URL . '/userinfo.php?uid=' . $data['uid'];
                                            $class = ('even' === $class) ? 'odd' : 'even';
                                    Severity: Major
                                    Found in admin/index.php and 1 other location - About 5 hrs to fix
                                    admin/index.php on lines 1586..1601

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 202.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                                if ('' !== xoops_trim($fldname)) {
                                                    $sfiles         = new Files();
                                                    $dstpath        = XOOPS_ROOT_PATH . '/uploads/news/image';
                                                    $destname       = $sfiles->createUploadName($dstpath, $fldname, true);
                                                    $permittedtypes = ['image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png'];
                                    Severity: Major
                                    Found in admin/index.php and 1 other location - About 4 hrs to fix
                                    admin/index.php on lines 1279..1295

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 178.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            if (xoops_trim('' !== $fldname)) {
                                                $sfiles         = new Files();
                                                $dstpath        = XOOPS_ROOT_PATH . '/uploads/news/image';
                                                $destname       = $sfiles->createUploadName($dstpath, $fldname, true);
                                                $permittedtypes = ['image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png'];
                                    Severity: Major
                                    Found in admin/index.php and 1 other location - About 4 hrs to fix
                                    admin/index.php on lines 1409..1425

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 178.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            echo "<td align='center'><b>" . $eachstory->storyid() . "</b>
                                                </td><td align='left'><a href='" . XOOPS_URL . '/modules/news/article.php?storyid=' . $eachstory->storyid() . "'>" . $eachstory->title() . "</a>
                                                </td><td align='center'>" . $topic->topic_title() . "
                                                </td><td align='center'><a href='" . XOOPS_URL . '/userinfo.php?uid=' . $eachstory->uid() . "'>" . $eachstory->uname() . "</a></td><td align='center' class='nw'>" . $published . "</td><td align='center'>" . $eachstory->counter() . "</td><td align='center'>
                                    Severity: Minor
                                    Found in admin/index.php and 1 other location - About 55 mins to fix
                                    admin/index.php on lines 368..371

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 98.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                                echo "<td align='center'><b>" . $eachstory->storyid() . "</b>
                                                    </td><td align='left'><a href='" . XOOPS_URL . '/modules/news/article.php?returnside=1&amp;storyid=' . $eachstory->storyid() . "'>" . $eachstory->title() . "</a>
                                                    </td><td align='center'>" . $topic->topic_title() . "
                                                    </td><td align='center'><a href='" . XOOPS_URL . '/userinfo.php?uid=' . $eachstory->uid() . "'>" . $eachstory->uname() . "</a></td><td align='center' class='nw'>" . $created . "</td><td align='center' class='nw'>" . $expired . "</td><td align='center'>
                                    Severity: Minor
                                    Found in admin/index.php and 1 other location - About 55 mins to fix
                                    admin/index.php on lines 293..296

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 98.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                        if ($topic_id > 0) { // Edit mode
                                            $groups_ids                    = $grouppermHandler->getGroupIds('news_view', $topic_id, $xoopsModule->getVar('mid'));
                                            $groups_ids                    = array_values($groups_ids);
                                            $groups_news_can_view_checkbox = new \XoopsFormCheckBox(_AM_VIEWFORM, 'groups_news_can_view[]', $groups_ids);
                                        } else { // Creation mode
                                    Severity: Major
                                    Found in admin/index.php and 2 other locations - About 50 mins to fix
                                    admin/index.php on lines 1202..1208
                                    admin/index.php on lines 1213..1219

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 97.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                        if ($topic_id > 0) { // Edit mode
                                            $groups_ids                      = $grouppermHandler->getGroupIds('news_submit', $topic_id, $xoopsModule->getVar('mid'));
                                            $groups_ids                      = array_values($groups_ids);
                                            $groups_news_can_submit_checkbox = new \XoopsFormCheckBox(_AM_SUBMITFORM, 'groups_news_can_submit[]', $groups_ids);
                                        } else { // Creation mode
                                    Severity: Major
                                    Found in admin/index.php and 2 other locations - About 50 mins to fix
                                    admin/index.php on lines 1202..1208
                                    admin/index.php on lines 1224..1230

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 97.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                        if ($topic_id > 0) { // Edit mode
                                            $groups_ids                       = $grouppermHandler->getGroupIds('news_approve', $topic_id, $xoopsModule->getVar('mid'));
                                            $groups_ids                       = array_values($groups_ids);
                                            $groups_news_can_approve_checkbox = new \XoopsFormCheckBox(_AM_APPROVEFORM, 'groups_news_can_approve[]', $groups_ids);
                                        } else { // Creation mode
                                    Severity: Major
                                    Found in admin/index.php and 2 other locations - About 50 mins to fix
                                    admin/index.php on lines 1213..1219
                                    admin/index.php on lines 1224..1230

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 97.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                        foreach ($biggestcontributors as $uid => $count) {
                                            $url   = XOOPS_URL . '/userinfo.php?uid=' . $uid;
                                            $class = ('even' === $class) ? 'odd' : 'even';
                                            printf("<tr class='" . $class . "'><td align='left'><a href='%s' target ='_blank'>%s</a></td><td align='right'>%u</td></tr>\n", $url, htmlspecialchars($news->uname($uid), ENT_QUOTES | ENT_HTML5), $count);
                                        }
                                    Severity: Major
                                    Found in admin/index.php and 2 other locations - About 45 mins to fix
                                    admin/index.php on lines 1631..1635
                                    admin/index.php on lines 1642..1646

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 96.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                        foreach ($mostreadedauthors as $uid => $reads) {
                                            $url   = XOOPS_URL . '/userinfo.php?uid=' . $uid;
                                            $class = ('even' === $class) ? 'odd' : 'even';
                                            printf("<tr class='" . $class . "'><td align='left'><a href='%s' target ='_blank'>%s</a></td><td align='right'>%u</td></tr>\n", $url, htmlspecialchars($news->uname($uid), ENT_QUOTES | ENT_HTML5), $reads);
                                        }
                                    Severity: Major
                                    Found in admin/index.php and 2 other locations - About 45 mins to fix
                                    admin/index.php on lines 1642..1646
                                    admin/index.php on lines 1653..1657

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 96.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                    Open

                                        foreach ($bestratedauthors as $uid => $rating) {
                                            $url   = XOOPS_URL . '/userinfo.php?uid=' . $uid;
                                            $class = ('even' === $class) ? 'odd' : 'even';
                                            printf("<tr class='" . $class . "'><td align='left'><a href='%s' target ='_blank'>%s</a></td><td align='right'>%u</td></tr>\n", $url, htmlspecialchars($news->uname($uid), ENT_QUOTES | ENT_HTML5), $rating);
                                        }
                                    Severity: Major
                                    Found in admin/index.php and 2 other locations - About 45 mins to fix
                                    admin/index.php on lines 1631..1635
                                    admin/index.php on lines 1653..1657

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 96.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    There are no issues that match your filters.

                                    Category
                                    Status