Showing 216 of 316 total issues
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
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 (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_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
Avoid deeply nested control flow statements. Open
for ($j = 0, $jMax = count($old_vals); $j < $jMax; ++$j) {
$def_vals[$j] = $old_vals[$j];
}
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
Method setPermissions
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function setPermissions($myArray, $permissionGroup, $categoryID, $grouppermHandler, $permissionName, $mid)
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 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_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
Function getCategoryArray
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getCategoryArray()
{
global $xoopsDB, $xoopsUser, $xoopsModule;
$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 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"
Further reading
Function getServiceLinks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getServiceLinks($variable)
{
global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsConfig, $entrytype;
$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
Method getWysiwygForm
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function getWysiwygForm($caption, $name, $value = '', $width = '100%', $height = '400px', $supplemental = '')
Avoid deeply nested control flow statements. Open
switch ($helper->getConfig('linkterms')) {
default:
$replace_term = '<span><b><a style="cursor:help;border-bottom: 1px dotted #000;color: #2F5376;" href="' . $staticURL . '" >' . $term . '</a></b></span>';
break;
case 3: //tooltip
Function getAlphaArray
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getAlphaArray()
{
global $xoopsUser, $xoopsDB, $xoopsModule;
$grouppermHandler = \xoops_getHandler('groupperm');
$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
Method makeMySelBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
Function domticker
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function domticker(content, divId, divClass, delay, fadeornot) {
Method lx_search
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function lx_search($queryarray, $andor, $limit, $offset, $userid)
Method truncateHtml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)