Showing 355 of 3,032 total issues
Method publisher_search
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
function publisher_search($queryArray, $andor, $limit, $offset, $userid, $categories = [], $sortby = 0, $searchin = '', $extra = '')
Method getAllPublished
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getAllPublished($limit = 0, $start = 0, $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $idKey = 'none', $excludeExpired = true)
Method getItemsFromSearch
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getItemsFromSearch($queryArray = [], $andor = 'AND', $limit = 0, $offset = 0, $userid = 0, $categories = [], $sortby = 0, $searchin = '', $extra = '')
Method updateBlock
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
Method serveExternalImage
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function serveExternalImage()
{
if (!preg_match('/^https?:\/\/[a-zA-Z0-9\-\.]+/i', $this->src)) {
$this->error('Invalid URL supplied.');
Method xoops_module_install_publisher
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_install_publisher(\XoopsModule $module)
{
require \dirname(__DIR__) . '/preloads/autoloader.php';
$helper = Helper::getInstance();
Method insert
has 28 lines of code (exceeds 25 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;
Method getGrantedGroupsById
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getGrantedGroupsById($gpermName, $id)
{
static $items;
if (isset($items[$gpermName][$id])) {
return $items[$gpermName][$id];
Function publisher_tag_iteminfo
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function publisher_tag_iteminfo(&$items)
{
if (empty($items) || !is_array($items)) {
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 xoops_module_install_publisher
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_install_publisher(\XoopsModule $module)
{
require \dirname(__DIR__) . '/preloads/autoloader.php';
$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 setTitle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function setTitle($title): void
{
$this->title = $this->html2text($title);
$this->originalTitle = $this->title;
$titleTag = [];
- 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($catId, $status, $inSubCat = false)
{
// global $resultCatCounts;
$ret = [];
- 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 findMetaKeywords
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function findMetaKeywords($text, $minChar)
{
$keywords = [];
$text = $this->purifyText($text);
$text = $this->html2text($text);
- 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 getArray
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getArray($mimeExt = null)
{
// global $publisherIsAdmin;
$ret = [];
if ($GLOBALS['xoopsUser'] && !$this->publisherIsAdmin) {
- 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 getCategoriesForSubmit
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function &getCategoriesForSubmit()
{
global $theresult;
$ret = [];
$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 getCategoriesForSearch
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getCategoriesForSearch()
{
global $theresult;
$ret = [];
- 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 getGrantedItems
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getGrantedItems($gpermName)
{
static $items;
if (isset($items[$gpermName])) {
return $items[$gpermName];
Method editFile
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function editFile($showmenu = false, $fileid = 0, $itemId = 0): void
{
$helper = Helper::getInstance();
require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
Method cloneFileFolder
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function cloneFileFolder($path): void
{
global $patKeys;
global $patValues;
Consider simplifying this complex logical expression. Open
if ('png' === $imgType && OPTIPNG_ENABLED && OPTIPNG_PATH && @is_file(OPTIPNG_PATH)) {
$exec = OPTIPNG_PATH;
$this->debug(3, "optipng'ing $tempfile");
$presize = filesize($tempfile);
$out = shell_exec('$exec -o1 $tempfile'); //you can use up to -o7 but it really slows things down