Showing 374 of 649 total issues
Function sf_displayImage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function sf_displayImage($image, $alt = '', $display = true, $extra = "class='forum_icon'")
{
$iconHandler = sf_getIconHandler();
// START hacked by irmtfan
// to show text links instead of buttons - func_num_args()==2 => only when $image, $alt is set and optional $display not set
- 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_faqs_recent_questions_show
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function b_faqs_recent_questions_show($options)
{
// require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
$block = [];
- 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 getCountsByCat
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getCountsByCat($cat_id, $status)
{
global $xoopsUser;
$ret = [];
$sql = 'SELECT categoryid, COUNT(*) AS count FROM ' . $this->db->prefix('smartfaq_faq');
- 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_faqs_new_show
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function b_faqs_new_show($options)
{
// require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
$block = [];
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public function insert(\XoopsObject $object, $force = false)
{
if ('xoopsmodules\smartfaq\faq' !== \mb_strtolower(\get_class($object))) {
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 editcat
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function editcat($showmenu = false, $categoryid = 0): void
{
//$moderators = []; // just to define the variable
//$allmods = [];
$startfaq = Request::getInt('startfaq', 0, 'GET');
- 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 getCount
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getCount($criteria = null, $notNullFields = '')
{
$sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('smartfaq_faq');
if (($criteria instanceof \CriteriaCompo) || ($criteria instanceof \Criteria)) {
$whereClause = $criteria->renderWhere();
- 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 parseExclusiveExtras
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function parseExclusiveExtras(pf, i, ar) {
var k = i, v;
olOverrideIsSet = false; // a global variable
- 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 editfaq
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function editfaq(string $faqid = ''): void
{
global $answerHandler, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModule, $XOOPS_URL, $myts, $pathIcon16;
/** @var Smartfaq\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 updateTable
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function updateTable($table)
{
global $xoopsDB;
$ret = true;
- 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 overrideFaqsPermissions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function overrideFaqsPermissions($groups, $categoryid)
{
global $xoopsDB;
$result = true;
- 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 _loadAllChildItemIds
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function _loadAllChildItemIds($itemId, &$childIds): void
{
if (!empty($this->_itemTree[$itemId]['children'])) {
$first_child = $this->_itemTree[$itemId]['children'];
foreach ($first_child as $fcid) {
- 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 deleteAttachment
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function deleteAttachment($attach_array = null)
{
/** @var Smartfaq\Helper $helper */
$helper = Smartfaq\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 loadSampleData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadSampleData(): void
{
global $xoopsConfig;
$moduleDirName = \basename(\dirname(__DIR__));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Method updateTable
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateTable($table)
{
global $xoopsDB;
$ret = true;
Method getCountsByCat
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCountsByCat($cat_id, $status)
{
global $xoopsUser;
$ret = [];
$sql = 'SELECT categoryid, COUNT(*) AS count FROM ' . $this->db->prefix('smartfaq_faq');
Method toArray
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toArray($faq = [], $category = null, $linkInQuestion = true)
{
/** @var Smartfaq\Helper $helper */
$helper = Smartfaq\Helper::getInstance();
Method deleteAttachment
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deleteAttachment($attach_array = null)
{
/** @var Smartfaq\Helper $helper */
$helper = Smartfaq\Helper::getInstance();
Consider simplifying this complex logical expression. Open
if (typeof o3_scroll != 'undefined' && o3_scroll && o3_sticky && (o3_relx || o3_rely) && (typeof o3_draggable == 'undefined' || !o3_draggable)) {
if (typeof over.scroller == 'undefined' || over.scroller.canScroll) over.scroller = new scroller(placeX - winoffset, placeY - scrolloffset, setTimeout("repositionOver()", 20));
}
Consider simplifying this complex logical expression. Open
if (!olIe4 || olOp || !olIe55 || (typeof o3_shadow != 'undefined' && o3_shadow) || (typeof o3_bubble != 'undefined' && o3_bubble)) return;