Showing 37 of 74 total issues
Function xoops_module_update_waiting
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_update_waiting(\XoopsModule $module, $previousVersion = null)
{
$moduleDirName = \basename(\dirname(__DIR__));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
- 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 truncateHtml
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
{
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
- 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_waiting_waiting_show
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
function b_waiting_waiting_show($options)
{
$userLang = $GLOBALS['xoopsConfig']['language'];
$sql_cache_min = empty($options[1]) ? 0 : (int)$options[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 checkVerModule
has a Cognitive Complexity of 21 (exceeds 5 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 = '';
- 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_waiting
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_update_waiting(\XoopsModule $module, $previousVersion = null)
{
$moduleDirName = \basename(\dirname(__DIR__));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Function waiting_get_plugin_info
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function waiting_get_plugin_info($dirname, $language = 'english')
{
// get $mytrustdirname for D3 modules
$mytrustdirname = '';
if (defined('XOOPS_TRUST_PATH') && is_file(XOOPS_ROOT_PATH . '/modules/' . $dirname . '/mytrustdirname.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 truncateHtml
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
{
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
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_waiting_waiting_show
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_waiting_waiting_show($options)
{
$userLang = $GLOBALS['xoopsConfig']['language'];
$sql_cache_min = empty($options[1]) ? 0 : (int)$options[1];
Method waiting_get_plugin_info
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function waiting_get_plugin_info($dirname, $language = 'english')
{
// get $mytrustdirname for D3 modules
$mytrustdirname = '';
if (defined('XOOPS_TRUST_PATH') && is_file(XOOPS_ROOT_PATH . '/modules/' . $dirname . '/mytrustdirname.php')) {
Function xoops_module_update_waiting
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_update_waiting($module, $version)
{
return true; // force return - following code is really only needed for XOOPS < 2.3
// Keep Block option values when update (by nobunobu)
$mid = $module->mid();
- 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_waiting
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_update_waiting($module, $version)
{
return true; // force return - following code is really only needed for XOOPS < 2.3
// Keep Block option values when update (by nobunobu)
$mid = $module->mid();
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_waiting_smartfaq
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_waiting_smartfaq()
{
/** @var \XoopsMySQLDatabase $xoopsDB */
$xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
$ret = [];
Method b_waiting_wfdownloads
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_waiting_wfdownloads()
{
/** @var \XoopsMySQLDatabase $xoopsDB */
$xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
$ret = [];
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 getServerStats
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getServerStats()
{
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
\xoops_loadLanguage('common', $moduleDirName);
Method xoops_module_install_waiting
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_install_waiting(\XoopsModule $module)
{
require_once \dirname(__DIR__, 3) . '/mainfile.php';
// require_once \dirname(__DIR__) . '/config/config.php';
Method b_waiting_addresses
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_waiting_addresses()
{
/** @var \XoopsMySQLDatabase $xoopsDB */
$xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
$ret = [];
Method b_waiting_wflinks
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_waiting_wflinks()
{
/** @var \XoopsMySQLDatabase $xoopsDB */
$xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
$ret = [];