Showing 36 of 48 total issues
Method xfaq_search
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xfaq_search($queryarray, $andor, $limit, $offset, $userid)
{
global $xoopsDB;
global $xoopsDB;
Method xfaq_tag_iteminfo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xfaq_tag_iteminfo(&$items)
{
if (empty($items) || !is_array($items)) {
return false;
}
Function getList
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getList($criteria = null, $limit = 0, $start = 0)
{
$ret = [];
if ($criteria == null) {
$criteria = new CriteriaCompo();
- 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 updateAll
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function updateAll($fieldname, $fieldvalue, $criteria = null, $force = false)
{
$set_clause = $fieldname . ' = ';
if (is_numeric($fieldvalue)) {
$set_clause .= $fieldvalue;
- 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 addItem
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addItem($id, $link = '', $icon = '', $name = '', $extra = '', $alt = '')
Function recurseCopy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function recurseCopy($src, $dst)
{
$dir = opendir($src);
// @mkdir($dst);
while (false !== ($file = readdir($dir))) {
- 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 xfaq_search
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function xfaq_search($queryarray, $andor, $limit, $offset, $userid)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(XoopsDatabase $db, $tablename, $classname, $keyname, $idenfierName = false)
Function b_xfaq_faq
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function b_xfaq_faq($options)
{
require_once XOOPS_ROOT_PATH . '/modules/xfaq/class/faq.php';
$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
Function render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function render()
{
$ret = "<div class=\"rmmenuicon\">";
foreach ($this->_items as $k => $v) {
$ret .= "<a href=\"" . $v['link'] . "\" title=\"" . ($v['alt'] != '' ? $v['alt'] : $v['name']) . "\">" . ($v['icon'] != '' ? "<img src=\"" . $v['icon'] . "\" alt=\"" . $v['name'] . "\"> " : '');
- 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 delete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function delete($obj, $force = false)
{
if (is_array($this->keyName)) {
$clause = [];
for ($i = 0, $iMax = count($this->keyName); $i < $iMax; ++$i) {
- 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 getForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getForm($action = false)
{
global $xoopsDB, $xoopsModuleConfig, $xoopsModule;
if ($action === 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 too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
Function createFolder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function createFolder($folder)
{
// try {
// if (!mkdir($folder) && !is_dir($folder)) {
// throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder));
- 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 xoops_module_install_xfaq
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_install_xfaq()
{
global $xoopsModule, $xoopsConfig;
//Create directory /xfaq
- 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"