Showing 316 of 316 total issues
Function setPermissions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function setPermissions($myArray, $permissionGroup, $categoryID, $grouppermHandler, $permissionName, $mid)
{
$permissionArray = $myArray;
if ($categoryID > 0) {
$sql = 'DELETE FROM `' . $GLOBALS['xoopsDB']->prefix('group_permission') . "` WHERE `gperm_name` = '" . $permissionName . "' AND `gperm_itemid`= $categoryID;";
- 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 lx_serviceLinks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function lx_serviceLinks($variable)
{
global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsConfig, $entrytype;
/** @var \XoopsModuleHandler $moduleHandler */
- 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 setPermissions
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function setPermissions($myArray, $permissionGroup, $categoryID, $grouppermHandler, $permissionName, $mid)
Function lx_getWysiwygForm
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function &lx_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
{
$editor_option = mb_strtolower(lx_getmoduleoption('form_options'));
$editor = false;
$editor_configs = [];
- 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_object($submitter)) {
$submitter->setVar('posts', $submitter->getVar('posts') + 1);
$res = $memberHandler->insertUser($submitter, true);
unset($submitter);
}
Function lexikon_tag_iteminfo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function lexikon_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
Avoid deeply nested control flow statements. Open
if (is_object($submitter)) {
$submitter->setVar('posts', $submitter->getVar('posts') + 1);
$res = $memberHandler->insertUser($submitter, true);
unset($submitter);
}
Avoid deeply nested control flow statements. Open
if (is_file($templateFolder . $v)) {
unlink($templateFolder . $v);
}
Avoid deeply nested control flow statements. Open
if (false !== $all_ok || in_array($modversion['category'], $ok_syscats)) {
echo "<td class='$class' align='center' valign='bottom' width='19%'>";
echo "<a href='" . XOOPS_URL . '/modules/system/admin.php?fct=' . $file . "'><b>" . trim($modversion['name']) . "</b></a>\n";
echo '</td>';
++$counter;
Function lx_CatsArray
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function lx_CatsArray()
{
global $xoopsDB, $xoopsModuleConfig, $xoopsUser, $xoopsModule;
$myts = \MyTextSanitizer::getInstance();
$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
- 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 lx_getinit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function lx_getinit($init)
{
global $init;
echo "<div><select name='init'>";
echo "<option value='#'> # </option>";
- 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 lx_GetStatistics
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function lx_GetStatistics($limit)
{
$ret = [];
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$tbls = $db->prefix('lxentries');
- 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 replace
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function replace($replace_matches)
{
$patterns = [];
if ($this->singlewords) {
$keywords = \explode(' ', $this->preg_keywords);
- 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 categoryDefault
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function categoryDefault()
{
$helper = Helper::getInstance();
$op = 'default';
require_once XOOPS_ROOT_PATH . '/class/xoopslists.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
Avoid deeply nested control flow statements. Open
if (is_object($submitter)) {
$submitter->setVar('posts', $submitter->getVar('posts') + 1);
$res = $memberHandler->insertUser($submitter, true);
unset($submitter);
}
Avoid deeply nested control flow statements. Open
if ($counter > 4) {
$counter = 0;
echo '</tr>';
echo '<tr>';
}
Avoid deeply nested control flow statements. Open
for ($j = 0, $jMax = count($old_vals); $j < $jMax; ++$j) {
$def_vals[$j] = $old_vals[$j];
}
Method lx_getWysiwygForm
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function &lx_getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
Function lexikon_tag_iteminfo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function lexikon_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 getWysiwygForm
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
{
$editor_option = mb_strtolower(static::getModuleOption('form_options'));
$editor = false;
$editor_configs = [];
- 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"