Showing 3,032 of 3,032 total issues
Avoid deeply nested control flow statements. Open
if ($fileObj->storeUpload('item_upload_file', $allowedMimetypes, $errors)) {
unlink($oldfile);
}
Function getIP
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getIP()
{
$rem = @$_SERVER['REMOTE_ADDR'];
$ff = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$ci = @$_SERVER['HTTP_CLIENT_IP'];
- 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 deeply nested control flow statements. Open
if (file_exists($filename)) {
if (copy($filename, PUBLISHER_UPLOAD_PATH . '/' . $arrFile['filerealname'])) {
/** @var File $fileObj */
$fileObj = $helper->getHandler('File')
->create();
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['filename']))) {
/** @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 (srcList.options[i].text == destList.options[count].text) {
found = true;
break;
}
Avoid deeply nested control flow statements. Open
if (file_exists($filename)) {
if (copy($filename, PUBLISHER_UPLOAD_PATH . '/' . $arrFile['filerealname'])) {
/** @var File $fileObj */
$fileObj = $helper->getHandler('File')
->create();
Function setCookie
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function setCookie(name, value, expires, path, domain, secure) {
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>';
}
Function recurseCopy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function recurseCopy($src, $dst): void
{
$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
Function addElement
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function addElement($formElement, $required = false): void
{
if (\is_string($formElement)) {
$this->elements[] = &$formElement;
} elseif (\is_subclass_of($formElement, 'xoopsformelement')) {
- 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 publisher_items_menu_show
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function publisher_items_menu_show($options)
{
$block = [];
$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
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($caption, $name, $size = 15, $value = 0, $showtime = true, $formatTimestamp = true)
Function store
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function store($allowedMimetypes = null, $force = true, $doupload = true)
{
if ($this->isNew()) {
$errors = [];
$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 mkdir
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function mkdir($target)
{
// https://www.php.net/manual/en/function.mkdir.php
// saint at corenova.com
// bart at cdasites dot com
- 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 generateUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function generateUrl($op, $id, $shortUrl = '')
{
$helper = Helper::getInstance();
if ('none' !== $helper->getConfig('seo_url_rewrite')) {
if (!empty($shortUrl)) {
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($title, $name, $action, $method = 'post', $addtoken = false, $summary = '')
Function displayFlash
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function displayFlash($url, $width = false, $height = false)
{
if (!$width || !$height) {
if (!$dimension = @\getimagesize($url)) {
return "<a href='{$url}' target='_blank'>{$url}</a>";
- 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"