Showing 236 of 310 total issues
Function news_createmeta_keywords
has a Cognitive Complexity of 16 (exceeds 5 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';
- 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 createMetaKeywords
has a Cognitive Complexity of 16 (exceeds 5 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';
- 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 isBlockCloned
has 52 lines of code (exceeds 25 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');
File Files.php
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\News;
/*
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> " . sprintf(_AM_LAST10ARTS, Utility::getModuleOption('storycountadmin')) . '</h4>';
Function b_news_randomnews_show
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function b_news_randomnews_show($options)
{
/** @var Helper $helper */
if (!class_exists(Helper::class)) {
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 checkVerModule
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function checkVerModule(
\Xmf\Module\Helper $helper,
?string $source = null,
?string $default = null
): ?array {
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
function getStats(): void
{
global $xoopsModule, $xoopsConfig;
xoops_cp_header();
$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 getAllPublishedByAuthor
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getAllPublishedByAuthor($uid, $checkRight = false, $asobject = true)
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$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 b_news_topicsnav_show
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_news_topicsnav_show($options)
{
/** @var Helper $helper */
if (!class_exists(Helper::class)) {
return false;
Method orderBlock
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
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
Method checkVerModule
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function checkVerModule(
\Xmf\Module\Helper $helper,
?string $source = null,
?string $default = null
): ?array {
Function news_close_tags
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function news_close_tags($string)
{
// match opened tags
if (preg_match_all('/<([a-z\:\-]+)[^\/]>/', $string, $start_tags)) {
$start_tags = $start_tags[1];
- 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 closeTags
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function closeTags($string)
{
// match opened tags
if (\preg_match_all('/<([a-z\:\-]+)[^\/]>/', $string, $start_tags)) {
$start_tags = $start_tags[1];
- 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 auto_summary
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function auto_summary($text, &$titles)
{
$auto_summary = '';
if (Utility::getModuleOption('enhanced_pagenav')) {
$expr_matches = [];
- 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 b_news_archives_show
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_news_archives_show($options)
{
global $xoopsDB, $xoopsConfig;
// require_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
require_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/calendar.php';
Method b_news_topics_moderate
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_news_topics_moderate()
{
// require_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
/** @var Helper $helper */
Method updateBlock
has 41 lines of code (exceeds 25 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);
Function loadTableFromArrayWithReplace
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function loadTableFromArrayWithReplace($table, $data, $search, $replace)
{
/** @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 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();
- 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"