Showing 236 of 310 total issues
Method renderImageNav
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderImageNav($offset = 4)
{
if ($this->total < $this->perpage) {
return null;
}
Method editBlock
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function editBlock(int $bid): void
{
// require_once \dirname(__DIR__,2) . '/admin/admin_header.php';
// \xoops_cp_header();
\xoops_loadLanguage('admin', 'system');
Method uname
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function uname($uid = 0)
{
global $xoopsConfig;
static $tblusers = [];
$option = -1;
Consider simplifying this complex logical expression. Open
if ($approveprivilege && 'edit' === $_GET['op']) {
$op = 'edit';
$storyid = Request::getInt('storyid', 0, 'GET');
} elseif ($approveprivilege && 'delete' === $_GET['op']) {
$op = 'delete';
Method confirmBeforePrune
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function confirmBeforePrune(): void
{
global $dateformat;
$story = new NewsStory();
xoops_cp_header();
Method news_tag_synchronization
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function news_tag_synchronization($mid): void
{
global $xoopsDB;
$itemHandler_keyName = 'storyid';
$itemHandler_table = $xoopsDB->prefix('news_stories');
Method renderNav
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderNav($offset = 4)
{
$ret = '';
if ($this->total <= $this->perpage) {
return $ret;
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();
Method getStoriesByIds
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStoriesByIds(
$ids,
$checkRight = true,
$asobject = true,
$order = 'published',
Function rrmdir
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function rrmdir($src)
{
// Only continue if user is a 'global' Admin
if (!($GLOBALS['xoopsUser'] instanceof XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
return 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
Function news_tag_iteminfo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function news_tag_iteminfo(&$items)
{
if (empty($items) || !\is_array($items)) {
return 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
Function makeMySelBox
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function makeMySelBox(
$title,
$order,
$preset_id,
$none,
- 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 getStats
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getStats($limit)
{
$ret = [];
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
- 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 getStoriesByIds
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getStoriesByIds(
$ids,
$checkRight = true,
$asobject = true,
$order = 'published',
- 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 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();
Method xoops_module_install_news
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_install_news(\XoopsModule $module)
{
require_once \dirname(__DIR__, 3) . '/mainfile.php';
$moduleDirName = \basename(\dirname(__DIR__));
Method loadTableFromArrayWithReplace
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadTableFromArrayWithReplace($table, $data, $search, $replace)
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
Method getServerStats
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getServerStats()
{
//mb $wfdownloads = WfdownloadsWfdownloads::getInstance();
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Method news_notify_iteminfo
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function news_notify_iteminfo($category, $item_id)
{
if ('global' === $category) {
$item['name'] = '';
$item['url'] = '';
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();