Showing 130 of 207 total issues
Method getStatusImage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStatusImage($time, $status)
{
global $xoopsModuleConfig;
$moduleDirName = \basename(\dirname(__DIR__));
$helper = Helper::getInstance();
Method getStatusImage
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getStatusImage($time, $status)
{
$moduleDirName = \basename(\dirname(__DIR__));
$helper = Helper::getInstance();
$count = 7;
Method updateBlock
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups): void
Method tdmdownloads_tag_iteminfo
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tdmdownloads_tag_iteminfo(&$items)
{
if (empty($items) || !is_array($items)) {
return false;
}
Method convertSizeToString
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function convertSizeToString($sizeString)
{
$mysizeString = '';
if ('' != $sizeString) {
$size_value_arr = \explode(' ', $sizeString);
Method b_waiting_tdmdownloads
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_waiting_tdmdownloads()
{
/** @var \XoopsMySQLDatabase $xoopsDB */
$xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
$moduleDirName = basename(dirname(__DIR__, 2));
Function tdmdownloads_notify_iteminfo
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function tdmdownloads_notify_iteminfo($category, $item_id)
{
global $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
$moduleDirName = basename(dirname(__DIR__));
$item_id = (int)$item_id;
- 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 loadSampleData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadSampleData()
{
global $xoopsConfig;
$moduleDirName = \basename(\dirname(__DIR__));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Method getServerStats
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getServerStats(): string
{
//mb $wfdownloads = WfdownloadsWfdownloads::getInstance();
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Method handleImageDB
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleImageDB()
{
$moduleDirName = \basename(\dirname(__DIR__, 2));
require_once XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/header.php';
global $xoopsUser;
Method cloneFileFolder
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function cloneFileFolder($path)
{
global $patKeys;
global $patValues;
Method getValuesImages
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getValuesImages($keys = null, $format = null, $maxDepth = null)
{
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
$helper = Helper::getInstance();
Method isBlockCloned
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups): void
Method getPathTreeUrl
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function getPathTreeUrl($mytree, $key, $category_array, $title, $prefix = '', $link = false, $order = 'ASC', $lasturl = false)
Method getPathTreeUrl
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$mytree,
$key,
$category_array,
$title,
$prefix = '',
Function recurseCopy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function recurseCopy(string $src, string $dst): void
{
$dir = \opendir($src);
// @mkdir($dst);
if (!@\mkdir($dst) && !\is_dir($dst)) {
- 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 rcopy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function rcopy(string $src, string $dest): 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 update_tdmdownloads_v200
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function update_tdmdownloads_v200(&$module)
{
// Update size
$moduleDirName = basename(dirname(__DIR__));
$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 rmove
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function rmove(string $src, string $dest): 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
Method setOrder
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setOrder($bid, $title, $weight, $visible, $side, $bcachetime, $bmodule): void