Showing 355 of 3,032 total issues
Method getAllRejected
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getAllRejected($limit = 0, $start = 0, $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = '', $asObject = true, $idKey = 'none')
Method getAllOffline
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getAllOffline($limit = 0, $start = 0, $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = '', $asObject = true, $idKey = 'none')
Method getAllSubmitted
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getAllSubmitted($limit = 0, $start = 0, $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $idKey = 'none')
Method isBlockCloned
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function isBlockCloned(int $bid, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
Method getAllExpired
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getAllExpired($limit = 0, $start = 0, $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $idKey = 'none')
Function apply
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
apply: function () {
for (h = 0; sheet = Behaviour.list[h]; h++) {
for (selector in sheet) {
list = document.getElementsBySelector(selector);
- 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 calcDocRoot
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function calcDocRoot()
{
$docRoot = @$_SERVER['DOCUMENT_ROOT'];
if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
$docRoot = LOCAL_FILE_BASE_DIRECTORY;
- 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 recurseCopy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function recurseCopy(string $src, string $dst): void
{
$dir = \opendir($src);
if (!\mkdir($dst) && !\is_dir($dst)) {
throw new \RuntimeException(\sprintf('Directory "%s" was not created', $dst));
- 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 getItemsCriteria
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getItemsCriteria($categoryid = -1, $status = '', $notNullFields = null, $criteriaPermissions = null)
{
// $notNullFields = (null !== $notNullFields) ?: '';
// global $publisherIsAdmin;
// $ret = 0;
- 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 rcopy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function rcopy($src, $dest)
{
// Only continue if user is a 'global' Admin
if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
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 insert
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function insert(\XoopsObject $obj, $force = false)// insert($obj, $force = false)
{
// Make sure object is of correct type
if (0 != \strcasecmp($this->className, \get_class($obj))) {
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 rmove
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function rmove($src, $dest)
{
// Only continue if user is a 'global' Admin
if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
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 store
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function store($force = true)
{
$isNew = $this->isNew();
if (!$this->helper->getHandler('Item')
->insert($this, $force)) {
- 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 setOrder
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setOrder(string $bid, string $title, string $weight, string $visible, string $side, string $bcachetime, ?array $bmodule = null): void
Method getAllFiles
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getAllFiles($itemId = 0, $status = -1, $limit = 0, $start = 0, $sort = 'datesub', $order = 'DESC', $category = [])
Avoid deeply nested control flow statements. Open
if (file_exists($filename)) {
if (copy($filename, $GLOBALS['xoops']->path('uploads/publisher/' . $arrFile['filerealname']))) {
/** @var File $fileObj */
$fileObj = $helper->getHandler('File')
->create();
Avoid deeply nested control flow statements. Open
if (file_exists($pagewrap_filename)) {
if (copy($pagewrap_filename, PUBLISHER_UPLOAD_PATH . '/content/' . $arrArticle['htmlpage'])) {
$itemObj->setVar('body', '[pagewrap=' . $arrArticle['htmlpage'] . ']');
echo sprintf(' ' . _AM_PUBLISHER_IMPORT_ARTICLE_WRAP, $arrArticle['htmlpage']) . '<br>';
}
Avoid deeply nested control flow statements. Open
if ($fileObj->storeUpload('item_upload_file', $allowedMimetypes, $errors)) {
unlink($oldfile);
}
Avoid deeply nested control flow statements. Open
if (is_file($templateFolder . $v)) {
unlink($templateFolder . $v);
}
Avoid deeply nested control flow statements. Open
if (file_exists($filename)) {
if (copy($filename, $GLOBALS['xoops']->path('uploads/publisher/' . $arrFile['filerealname']))) {
/** @var File $fileObj */
$fileObj = $helper->getHandler('File')
->create();