Showing 56 of 1,027 total issues
Method b_xfguestbook_show
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_xfguestbook_show($options)
{
global $xoopsModule, $xoopsModuleConfig, $xoopsDB;
/** @var Helper $helper */
$helper = Helper::getInstance();
Method xfguestbook_admin_menu
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xfguestbook_admin_menu($currentoption = 0, $breadcrumb = '')
{
/* Nice buttons styles */
echo "
<style type='text/css'>
Method checkVerModule
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function checkVerModule($helper, $source = 'github', $default = 'master')
{
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
$update = '';
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"
Further reading
Function banish
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function banish()
{
global $msgHandler, $xoopsDB;
$msg_count = (!empty($_POST['msg_id']) && is_array($_POST['msg_id'])) ? count($_POST['msg_id']) : 0;
if ($msg_count > 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"
Further reading
Method badIpShow
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function badIpShow()
{
global $action, $start, $xoopsModule, $xoopsModuleConfig;
$myts = \MyTextSanitizer::getInstance();
$limit = 15;
Method executeSQL
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function executeSQL($sql_file_path)
{
global $xoopsModule;
$error = false;
// $reservedTables = array('avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups','groups_users_link','group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish');
Method xoops_module_install_xfguestbook
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_install_xfguestbook(\XoopsModule $module)
{
require_once dirname(__DIR__) . '/preloads/autoloader.php';
$moduleDirName = basename(dirname(__DIR__));
Function delete
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function delete()
{
global $msgHandler, $xoopsModule;
$msg_count = (!empty($_POST['msg_id']) && is_array($_POST['msg_id'])) ? count($_POST['msg_id']) : 0;
if ($msg_count > 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"
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 flagUpload
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function flagUpload($country_code)
{
global $xoopsModule, $maxsize, $maxwidth, $maxheight, $format;
/** @var Helper $helper */
$helper = Helper::getInstance();
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 getServerStats
has 29 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 rmdirr
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function rmdirr($dirname)
{
// Simple delete for a file
if (is_file($dirname)) {
return unlink($dirname);
- 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_install_xfguestbook
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_install_xfguestbook(\XoopsModule $module)
{
require_once dirname(__DIR__) . '/preloads/autoloader.php';
$moduleDirName = basename(dirname(__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
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 xfguestbook_search
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xfguestbook_search($queryarray, $andor, $limit, $offset, $user_id)
{
global $xoopsDB;
$sql = 'SELECT msg_id,user_id,title,post_time FROM ' . $xoopsDB->prefix('xfguestbook_msg') . ' WHERE moderate=0 ';
if (0 != $user_id) {
Method upload
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function upload()
{
global $xoopsModule, $preview_name, $msgstop;
/** @var Helper $helper */
$helper = Helper::getInstance();
Function rmove
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function rmove($src, $dest)
{
// 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 recurseCopy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function recurseCopy($src, $dst)
{
$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"