Showing 374 of 649 total issues
Function getCategoriesWithOpenQuestionsCount
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getCategoriesWithOpenQuestionsCount($parentid = 0)
{
if (-1 == $parentid) {
return $this->getCount();
}
- 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 alterTable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function alterTable()
{
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
Method makeMySelBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = ''): void
Method getCategories
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$limit = 0,
$start = 0,
$parentid = 0,
$sort = 'weight',
$order = 'ASC',
Function getWhoAndWhen
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getWhoAndWhen($answerObj = null, $users = [])
{
/** @var Smartfaq\Helper $helper */
$helper = Smartfaq\Helper::getInstance();
$smartModuleConfig = $helper->getConfig();
- 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 question
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function question($maxLength = 0, $format = 'S')
{
$ret = $this->getVar('question', $format);
if (('s' === $format) || ('S' === $format) || ('show' === $format)) {
$myts = MyTextSanitizer::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 getAllAnswers
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$faqid = 0,
$status = -1,
$limit = 0,
$start = 0,
$sort = 'datesub',
Consider simplifying this complex logical expression. Open
if (o3_followscroll && 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, o3_followscrollrefresh);
}
Consider simplifying this complex logical expression. Open
if (o3_followscroll && 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, o3_followscrollrefresh);
}
Consider simplifying this complex logical expression. Open
if ($oldtitle[$i] !== $title[$i]
|| $oldweight[$i] !== $weight[$i]
|| $oldvisible[$i] !== $visible[$i]
|| $oldside[$i] !== $side[$i]
|| $oldbcachetime[$i] !== $bcachetime[$i]
Consider simplifying this complex logical expression. Open
if (!($isAdmin
|| (null !== $helper->getConfig('allowrequest')
&& 1 == $helper->getConfig('allowrequest')
&& (is_object($xoopsUser) || (null !== $helper->getConfig('anonpost') && 1 == $helper->getConfig('anonpost')))))) {
redirect_header('index.php', 1, _NOPERM);
Consider simplifying this complex logical expression. Open
if (!($isAdmin
|| (null !== $helper->getConfig('allowsubmit') && 1 == $helper->getConfig('allowsubmit')
&& (is_object($xoopsUser)
|| (null !== $helper->getConfig('anonpost')
&& 1 == $helper->getConfig('anonpost')))))) {
Consider simplifying this complex logical expression. Open
if ($isAdmin
|| (isset($smartConfig['allowsubmit']) && 1 == $smartConfig['allowsubmit']
&& (is_object($xoopsUser)
|| (isset($smartConfig['anonpost'])
&& 1 == $smartConfig['anonpost'])))) {
Consider simplifying this complex logical expression. Open
if ($isAdmin
|| (isset($smartConfig['allowrequest']) && 1 == $smartConfig['allowrequest']
&& (is_object($xoopsUser)
|| (isset($smartConfig['anonpost'])
&& 1 == $smartConfig['anonpost'])))) {
Method getFaqsFromSearch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getFaqsFromSearch($queryarray = [], $andor = 'AND', $limit = 0, $offset = 0, $userid = 0)
Method sf_getButton
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function sf_getButton($link, $button, $alt = '', $asImage = true, $extra = "class='forum_button'")
Method truncateHtml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
Method smartfaq_search
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function smartfaq_search($queryarray, $andor, $limit, $offset, $userid)
Method getCategoriesWithOpenQuestion
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$limit = 0,
$start = 0,
$parentid = 0,
$sort = 'weight',
$order = 'ASC'
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($uploadDir, $allowedMimeTypes = 0, $maxFileSize = 0, $maxWidth = 0, $maxHeight = 0)