Showing 85 of 103 total issues
Function b_marquee_wfsection
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function b_marquee_wfsection($limit, $dateFormat, $itemsSize)
{
// require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
$block = [];
$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 isBlockCloned
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options = null): void
{
xoops_loadLanguage('admin', 'system');
xoops_loadLanguage('admin/blocksadmin', 'system');
xoops_loadLanguage('admin/groups', '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
Method truncateHtml
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
{
$openTags = [];
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
Method b_marquee_comments
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_marquee_comments($limit, $dateFormat, $itemsSize)
{
// require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
require XOOPS_ROOT_PATH . '/include/comment_constants.php';
$block = [];
Function deleteDirectory
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function deleteDirectory($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
Method b_marquee_article
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_marquee_article($limit, $dateFormat, $itemsSize)
{
global $xoopsDB;
// require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
require_once XOOPS_ROOT_PATH . '/modules/article/include/functions.php';
Method AddEditMarqueeForm
has 18 arguments (exceeds 4 allowed). Consider refactoring. Open
$marqueeid,
$action,
$formTitle,
$contentvalue,
$bgcolorvalue,
Method isBlockCloned
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options = null): void
{
xoops_loadLanguage('admin', 'system');
xoops_loadLanguage('admin/blocksadmin', 'system');
xoops_loadLanguage('admin/groups', 'system');
Method b_marquee_tplleaguestats
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_marquee_tplleaguestats($limit, $dateFormat, $itemsSize)
{
// require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
//######################## SETTINGS ######################
$displaySeason = false; // display season name?
Method b_marquee_catads
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_marquee_catads($limit, $dateFormat, $itemsSize)
{
global $xoopsModule, $xoopsModuleConfig, $xoopsDB;
// require_once XOOPS_ROOT_PATH . '/modules/catads/class/cat.php';
$block = [];
Method updateBlock
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups): void
{
$myblock = new XoopsBlock($bid);
$myblock->setVar('title', $btitle);
$myblock->setVar('weight', $bweight);
Method b_marquee_smartpartner
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_marquee_smartpartner($limit, $dateFormat, $itemsSize)
{
$block = $newObjects = [];
if (!defined('SMARTPARTNER_DIRNAME')) {
define('SMARTPARTNER_DIRNAME', 'smartpartner');
Function _getInnerSize
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
XbMarquee._getInnerSize = function (elm, propName) {
var val = 0;
if (document.layers) {
// navigator 4
- 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_marquee_catads
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function b_marquee_catads($limit, $dateFormat, $itemsSize)
{
global $xoopsModule, $xoopsModuleConfig, $xoopsDB;
// require_once XOOPS_ROOT_PATH . '/modules/catads/class/cat.php';
$block = [];
- 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 checkVerModule
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
{
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
$update = '';
Method b_marquee_smartfaq
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_marquee_smartfaq($limit, $dateFormat, $itemsSize)
{
require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
$block = [];
$smartModule = &sf_getModuleInfo();
Method cloneBlock
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function cloneBlock($bid): void
{
xoops_cp_header();
$adminObject = Admin::getInstance();
$adminObject->displayNavigation(basename(__FILE__));
Method b_marquee_wfdownloads
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_marquee_wfdownloads($limit, $dateFormat, $itemsSize)
{
$block = [];
global $xoopsUser;
/** @var \XoopsModuleHandler $moduleHandler */
Function b_marquee_xfsection
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function b_marquee_xfsection($limit, $dateFormat, $itemsSize)
{
$block = [];
global $xoopsDB;
if (!function_exists('xfblock_checkAccess')) {
- 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 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"