XoopsModules25x/news

View on GitHub

Showing 236 of 310 total issues

Function store has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function store($approved = false)
    {
        //$newpost = 0;
        $myts     = MyTextSanitizer::getInstance();
        $title    = $myts->censorString($this->title);
Severity: Minor
Found in class/XoopsStory.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 b_news_bigstory_show has 39 lines of code (exceeds 25 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 1 hr to fix

    Method news_html2text has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function news_html2text($document)
    {
        // PHP Manual:: function preg_replace
        // $document should contain an HTML document.
        // This will remove HTML tags, javascript sections
    Severity: Minor
    Found in include/functions.php - About 1 hr to fix

      Method html2text has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function html2text($document)
          {
              // PHP Manual:: function preg_replace
              // $document should contain an HTML document.
              // This will remove HTML tags, javascript sections
      Severity: Minor
      Found in class/Utility.php - About 1 hr to fix

        Method b_news_randomnews_edit has 38 lines of code (exceeds 25 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 1 hr to fix

          Method getBigStory has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getBigStory(
                  $limit = 0,
                  $start = 0,
                  $checkRight = false,
                  $topic = 0,
          Severity: Minor
          Found in class/NewsStory.php - About 1 hr to fix

            Method makeMySelBox has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function makeMySelBox(
                    $title,
                    $order,
                    $preset_id,
                    $none,
            Severity: Minor
            Found in class/NewsTopic.php - About 1 hr to fix

              Method makeMySelBox has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = ''): void
                  {
                      if ('' == $sel_name) {
                          $sel_name = $this->id;
                      }
              Severity: Minor
              Found in class/XoopsTree.php - About 1 hr to fix

                Function b_news_topics_moderate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

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

                    public function isBlockCloned(int $bid, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
                    {
                        \xoops_loadLanguage('admin', 'system');
                        \xoops_loadLanguage('admin/blocksadmin', 'system');
                        \xoops_loadLanguage('admin/groups', 'system');
                Severity: Minor
                Found in class/Common/Blocksadmin.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 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = ''): void
                    {
                        if ('' == $sel_name) {
                            $sel_name = $this->id;
                        }
                Severity: Minor
                Found in class/XoopsTree.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_getmoduleoption has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                function news_getmoduleoption($option, $repmodule = 'news')
                {
                    global $xoopsModuleConfig, $xoopsModule;
                    static $tbloptions = [];
                    if (is_array($tbloptions) && array_key_exists($option, $tbloptions)) {
                Severity: Minor
                Found in include/functions.php - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function news_getWysiwygForm has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                function news_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
                {
                    $editor_option            = \mb_strtolower(news_getmoduleoption('form_options'));
                    $editor                   = false;
                    $editor_configs           = [];
                Severity: Minor
                Found in include/functions.php - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function 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

                Function xoops_module_pre_install_news has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                function xoops_module_pre_install_news(\XoopsModule $module)
                {
                    // Check if this XOOPS version is supported
                    $minSupportedVersion = explode('.', '2.5.0');
                    $currentVersion      = explode('.', mb_substr(XOOPS_VERSION, 6));
                Severity: Minor
                Found in include/install_function.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 getModuleOption has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function getModuleOption($option, $repmodule = 'news')
                    {
                        global $xoopsModuleConfig, $xoopsModule;
                        static $tbloptions = [];
                        if (\is_array($tbloptions) && \array_key_exists($option, $tbloptions)) {
                Severity: Minor
                Found in class/Utility.php - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function getWysiwygForm has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
                    {
                        $editor_option            = \mb_strtolower(static::getModuleOption('form_options'));
                        $editor                   = false;
                        $editor_configs           = [];
                Severity: Minor
                Found in class/Utility.php - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                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 orderBlock has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function orderBlock(
                          array $bid, array $oldtitle, array $oldside, array $oldweight, array $oldvisible, array $oldgroups, array $oldbcachetime, array $oldbmodule, array $title, array $weight, array $visible, array $side, array $bcachetime, array $groups, array $bmodule
                      ): void {
                          if (!$GLOBALS['xoopsSecurity']->check()) {
                              \redirect_header($_SERVER['SCRIPT_NAME'], 3, \implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
                  Severity: Minor
                  Found in class/Common/Blocksadmin.php - About 1 hr to fix

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

                        public function cloneBlock(int $bid): void
                        {
                            //require_once __DIR__ . '/admin_header.php';
                            //        \xoops_cp_header();
                    
                    
                    Severity: Minor
                    Found in class/Common/Blocksadmin.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language