Showing 130 of 207 total issues
Method updateBlock
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public 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 getPathTreeUrl
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getPathTreeUrl(
$mytree,
$key,
$category_array,
$title,
Function rrmdir
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function rrmdir($src)
{
if (is_dir($src)) {
$dir = opendir($src);
while (false !== ($file = readdir($dir))) {
- 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 getNumbersOfEntries
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function getNumbersOfEntries($mytree, $categories, $entries, $cid)
{
$count = 0;
$child_arr = [];
if (\in_array($cid, $categories)) {
- 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 getNumbersOfEntries
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getNumbersOfEntries($mytree, $categories, $entries, $cid)
{
$count = 0;
$child_arr = [];
if (\in_array($cid, $categories)) {
- 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 convertSizeToString
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function convertSizeToString($sizeString)
{
$mysizeString = '';
if ('' != $sizeString) {
$size_value_arr = \explode(' ', $sizeString);
- 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 resizeAndCrop
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function resizeAndCrop($src_url, $src_mimetype, $dest_url, $dest_w, $dest_h, $quality = 90)
{
// check file extension
switch ($src_mimetype) {
case 'image/png':
- 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 tdmdownloads_notify_iteminfo
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tdmdownloads_notify_iteminfo($category, $item_id)
{
global $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
$moduleDirName = basename(dirname(__DIR__));
$item_id = (int)$item_id;
Method __construct
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($target)
{
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
/** @var \XoopsModules\Tdmdownloads\Helper $this- >helper */
Method tdmdownloads_search
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tdmdownloads_search($queryarray, $andor, $limit, $offset, $userid)
{
global $xoopsDB;
$moduleDirName = basename(dirname(__DIR__));
$sql = 'SELECT lid, cid, title, description, submitter, date FROM ' . $xoopsDB->prefix('tdmdownloads_downloads') . ' WHERE status != 0';
Method getForm
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getForm($lid, $action = false)
{
// global $xoopsDB, $xoopsModule, $xoopsModuleConfig;
if (!$action) {
$action = $_SERVER['REQUEST_URI'];
Method createLogo
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createLogo($dirname)
{
if (!\extension_loaded('gd')) {
return false;
}
Method cloneBlock
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cloneBlock($bid): void
{
//require __DIR__ . '/admin_header.php';
// \xoops_cp_header();
Method orderBlock
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function orderBlock(
$bid,
$oldtitle,
$oldside,
$oldweight,
Method loadTableFromArrayWithReplace
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadTableFromArrayWithReplace($table, $data, $search, $replace)
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$prefixedTable = $db->prefix($table);
Method editBlock
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function editBlock($bid): void
{
// require_once \dirname(__DIR__,2) . '/admin/admin_header.php';
// \xoops_cp_header();
\xoops_loadLanguage('admin', 'system');
Function isBlockCloned
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups): 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
Function tdmdownloads_tag_iteminfo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function tdmdownloads_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 rrmdir
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function rrmdir(string $src): bool
{
// 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 tdmdownloads_search
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function tdmdownloads_search($queryarray, $andor, $limit, $offset, $userid)
{
global $xoopsDB;
$moduleDirName = basename(dirname(__DIR__));
$sql = 'SELECT lid, cid, title, description, submitter, date FROM ' . $xoopsDB->prefix('tdmdownloads_downloads') . ' WHERE status != 0';
- 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"