Showing 236 of 310 total issues
Method store
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function store($approved = false)
{
//$newpost = 0;
$myts = MyTextSanitizer::getInstance();
$title = $myts->censorString($this->title);
Method getStats
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStats($limit)
{
$ret = [];
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
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();
File article.php
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
/*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
Method news_search
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
function news_search($queryarray, $andor, $limit, $offset, $userid)
{
global $xoopsDB, $xoopsUser;
$restricted = News\Utility::getModuleOption('restrictindex');
$highlight = false;
Method store
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function store()
{
$myts = MyTextSanitizer::getInstance();
$title = '';
$imgurl = '';
Function renderNav
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function renderNav($offset = 4)
{
$ret = '';
if ($this->total <= $this->perpage) {
return $ret;
- 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 renderImageNav
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function renderImageNav($offset = 4)
{
if ($this->total < $this->perpage) {
return null;
}
- 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 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');
Method modTopicS
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
function modTopicS(): void
{
global $xoopsDB, $xoopsModule;
$helper = Helper::getInstance();
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');
Function updateBlock
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
{
$myblock = new \XoopsBlock($bid);
$myblock->setVar('title', $btitle);
$myblock->setVar('weight', $bweight);
- 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 orderBlock
has a Cognitive Complexity of 21 (exceeds 5 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()));
- 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 b_news_top_edit
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function b_news_top_edit($options)
{
global $xoopsDB;
$tmpstory = new NewsStory();
$form = _MB_NEWS_ORDER . " <select name='options[]'>";
- 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
File XoopsTopic.php
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\News;
/**
Method addTopic
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addTopic(): void
{
global $xoopsDB, $xoopsModule;
$helper = Helper::getInstance();
NewsTopic
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class NewsTopic extends XoopsTopic
{
public $menu;
public $topic_description;
public $topic_frontpage;
Function news_CreateMetaDatas
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function news_CreateMetaDatas($story = null): void
{
global $xoopsConfig, $xoTheme, $xoopsTpl;
$content = '';
$myts = \MyTextSanitizer::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
Function createMetaDatas
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function createMetaDatas($story = null): void
{
global $xoopsConfig, $xoTheme, $xoopsTpl;
$content = '';
$myts = MyTextSanitizer::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 getAllPublishedByAuthor
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllPublishedByAuthor($uid, $checkRight = false, $asobject = true)
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$myts = \MyTextSanitizer::getInstance();