Showing 85 of 103 total issues
Method editBlock
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function editBlock($bid): void
{
xoops_cp_header();
$adminObject = Admin::getInstance();
$adminObject->displayNavigation(basename(__FILE__));
Method b_marquee_wfsection
has 37 lines of code (exceeds 25 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();
Function marquee_getmoduleoption
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function marquee_getmoduleoption($option, $repmodule = 'marquee')
{
global $xoopsModuleConfig, $xoopsModule;
static $tbloptions = [];
if (is_array($tbloptions) && array_key_exists($option, $tbloptions)) {
- 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_mydownloads
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_marquee_mydownloads($limit, $dateFormat, $itemsSize)
{
// require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
require XOOPS_ROOT_PATH . '/include/comment_constants.php';
$block = [];
Method b_marquee_xfsection
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_marquee_xfsection($limit, $dateFormat, $itemsSize)
{
$block = [];
global $xoopsDB;
if (!function_exists('xfblock_checkAccess')) {
Method getServerStats
has 33 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);
Function getModuleOption
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function getModuleOption($option, $repmodule = 'marquee')
{
global $xoopsModule;
$helper = Helper::getInstance();
static $tbloptions = [];
- 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 xoops_module_update_marquee
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_update_marquee(\XoopsObject $module, $oldversion = null)
{
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$sql = 'ALTER TABLE `' . $db->prefix('marquee') . "` MODIFY `marquee_bgcolor` VARCHAR(7) NOT NULL DEFAULT '';";
$db->query($sql);
- 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 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
Method b_marquee_smartsection
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_marquee_smartsection($limit, $dateFormat, $itemsSize)
{
if (!class_exists('XoopsModules\Smartsection\Helper')) {
return false;
Method xoops_module_install_marquee
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_install_marquee(\XoopsModule $module)
{
require_once \dirname(__DIR__, 3) . '/mainfile.php';
$moduleDirName = \basename(\dirname(__DIR__));
/** @var Marquee\Helper $helper */ /** @var Marquee\Utility $utility */
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 updateBlock
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups): void
Function recurseCopy
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function recurseCopy($src, $dst): void
{
$dir = \opendir($src);
// @mkdir($dst);
try {
- 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_marquee
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_update_marquee(\XoopsObject $module, $oldversion = null)
{
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$sql = 'ALTER TABLE `' . $db->prefix('marquee') . "` MODIFY `marquee_bgcolor` VARCHAR(7) NOT NULL DEFAULT '';";
$db->query($sql);
Method xoopspartners_random
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoopspartners_random($numberPartners, $random = true, $orden = '', $desc = '')
{
global $xoopsDB;
$PartnersId = [];
$ArrayReturn = [];
Method loadSampleData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadSampleData(): void
{
global $xoopsConfig;
$moduleDirName = \basename(\dirname(__DIR__));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Method b_marquee_smartmedia
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_marquee_smartmedia($limit, $dateFormat, $itemsSize)
{
$block = [];
if (!defined('SMARTMEDIA_DIRNAME')) {
define('SMARTMEDIA_DIRNAME', 'smartmedia');
Method getModuleOption
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getModuleOption($option, $repmodule = 'marquee')
{
global $xoopsModule;
$helper = Helper::getInstance();
static $tbloptions = [];
Function XbMarquee
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function XbMarquee(id, height, width, scrollAmount, scrollDelay, direction, behavior, html) {