Showing 236 of 310 total issues
Function news_search
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
function news_search($queryarray, $andor, $limit, $offset, $userid)
{
global $xoopsDB, $xoopsUser;
$restricted = News\Utility::getModuleOption('restrictindex');
$highlight = false;
- Read upRead up
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 privBuildMimeArray
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function privBuildMimeArray()
{
return [
'ez' => 'application/andrew-inset',
'hqx' => 'application/mac-binhex40',
Function xoops_module_update_news
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_update_news()
{
global $xoopsDB;
$errors = 0;
- Read upRead up
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 xoops_module_update_news
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_update_news()
{
global $xoopsDB;
$errors = 0;
File XoopsStory.php
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\News;
use MyTextSanitizer;
Method listBlocks
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function listBlocks(): void
{
global $xoopsModule, $pathIcon16;
require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
// xoops_loadLanguage('admin', 'system');
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();
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();
- Read upRead up
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 getAllPublished
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public static function getAllPublished(
$limit = 0,
$start = 0,
$checkRight = false,
$topic = 0,
- Read upRead up
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 getRandomNews
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function getRandomNews(
$limit = 0,
$start = 0,
$checkRight = false,
$topic = 0,
- Read upRead up
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 store
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function store()
{
$myts = \MyTextSanitizer::getInstance();
$title = '';
$imgurl = '';
Method createMetaKeywords
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createMetaKeywords($content)
{
global $cfg;
require_once XOOPS_ROOT_PATH . '/modules/news/config.php';
// require_once XOOPS_ROOT_PATH . '/modules/news/class/blacklist.php';
Method news_createmeta_keywords
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
function news_createmeta_keywords($content)
{
require_once XOOPS_ROOT_PATH . '/modules/news/config.php';
// require_once XOOPS_ROOT_PATH . '/modules/news/class/blacklist.php';
// require_once XOOPS_ROOT_PATH . '/modules/news/class/registryfile.php';
Function listBlocks
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function listBlocks(): void
{
global $xoopsModule, $pathIcon16;
require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
// xoops_loadLanguage('admin', 'system');
- Read upRead up
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 prepare2show
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function prepare2show($filescount)
{
global $xoopsUser, $xoopsConfig, $xoopsModule;
/** @var News\Helper $helper */
$helper = Helper::getInstance();
- Read upRead up
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 prepare2show
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepare2show($filescount)
{
global $xoopsUser, $xoopsConfig, $xoopsModule;
/** @var News\Helper $helper */
$helper = Helper::getInstance();
Function modTopicS
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
function modTopicS(): void
{
global $xoopsDB, $xoopsModule;
$helper = Helper::getInstance();
- Read upRead up
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 store
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function store($approved = false)
{
$myts = \MyTextSanitizer::getInstance();
$counter = $this->counter ?? 0;
$title = $GLOBALS['xoopsDB']->escape($myts->censorString($this->title));
Method b_news_top_edit
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_news_top_edit($options)
{
global $xoopsDB;
$tmpstory = new NewsStory();
$form = _MB_NEWS_ORDER . " <select name='options[]'>";
Method render
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(?array $block = null): void
{
\xoops_load('XoopsFormLoader');
\xoops_loadLanguage('common', $this->moduleDirNameUpper);