Showing 56 of 1,027 total issues
Function rcopy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function rcopy($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
Avoid deeply nested control flow statements. Open
if (is_file($templateFolder . $v)) {
unlink($templateFolder . $v);
}
Function badIpDel
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function badIpDel($ip_id)
{
global $xoopsDB;
$ip_count = (!empty($_POST['ip_id']) && is_array($_POST['ip_id'])) ? count($_POST['ip_id']) : 0;
if ($ip_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 approve
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function approve()
{
global $msgHandler;
$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 __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($caption, $name, $value = null, $size = 1, $nullopt = false)
Method xfguestbook_search
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function xfguestbook_search($queryarray, $andor, $limit, $offset, $user_id)
Method truncateHtml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
Function delete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function delete($msg_id)
{
global $msgHandler, $xoopsModule;
$ok = Request::getInt('ok', 0, 'POST');
if (1 == $ok) {
- 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 getEditor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getEditor($helper = null, $options = null)
{
/** @var Helper $helper */
if (null === $options) {
$options = [];
- 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 countryShow
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function countryShow()
{
global $action, $start, $xoopsModule, $pathIcon16;
/** @var Helper $helper */
$helper = Helper::getInstance();
- 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 clear_tmp_files
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function clear_tmp_files($dir_path, $prefix = 'tmp_')
{
if (!($dir = @\opendir($dir_path))) {
return 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 insert
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function insert(\XoopsObject $msg, $force = true)
{
if (Message::class !== \get_class($msg)) {
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 xfguestbook_search
has a Cognitive Complexity of 6 (exceeds 5 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) {
- 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 get_badips
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function get_badips($all = null)
{
global $xoopsDB;
$ret = [];
$sql = 'SELECT * FROM ' . $xoopsDB->prefix('xfguestbook_badips');
- 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 loadSampleData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function loadSampleData()
{
global $xoopsConfig;
$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 convertIPAddresses
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function convertIPAddresses($tableName, $columnName)
{
if ($this->tableHandler->useTable($tableName)) {
$attributes = $this->tableHandler->getColumnAttributes($tableName, $columnName);
if (false !== mb_strpos($attributes, ' int(')) {
- 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"