Showing 355 of 3,032 total issues
Method html2text
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function html2text($document)
{
if (empty($document)) {
return '';
}
Method publisher_category_items_sel_show
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function publisher_category_items_sel_show($options)
{
$helper = Helper::getInstance();
$block = $item = [];
Function _getResponse
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getResponse: function (iframe, file) {
// getting response
var toDeleteFlag = false, self = this, settings = this._settings;
addEvent(iframe, 'load', function () {
Method updateBlock
has 41 lines of code (exceeds 25 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
{
$myblock = new \XoopsBlock($bid);
$myblock->setVar('title', $btitle);
$myblock->setVar('weight', $bweight);
Method displayCategory
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function displayCategory(Category $categoryObj, $level = 0): void
{
$helper = Helper::getInstance();
$configurator = new Common\Configurator();
$icons = $configurator->icons;
Method createDir
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createDir(): void
{
// auto crate folders
// $thePath = static::getUploadDir();
Function tryBrowserCache
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function tryBrowserCache()
{
if (BROWSER_CACHE_DISABLE) {
$this->debug(3, 'Browser caching is disabled');
- 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 loadTableFromArrayWithReplace
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function loadTableFromArrayWithReplace($table, $data, $search, $replace)
{
/** @var \XoopsMySQLDatabase $db */
$db = \XoopsDatabaseFactory::getDatabaseConnection();
- 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 tryServerCache
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function tryServerCache()
{
$this->debug(3, 'Trying server cache');
if (is_file($this->cachefile)) {
$this->debug(3, "Cachefile {$this->cachefile} exists");
- 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_latest_news_edit
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function publisher_latest_news_edit($options)
{
$tabletag1 = '<tr><td style="padding:3px;" width="37%">';
$tabletag2 = '</td><td style="padding:3px;">';
$tabletag3 = '<tr><td style="padding-top:20px;border-bottom:1px solid #000;" colspan="2">';
- 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_category_items_sel_show
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function publisher_category_items_sel_show($options)
{
$helper = Helper::getInstance();
$block = $item = [];
- 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 resizeAndCrop
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function resizeAndCrop()
{
// check file extension
switch ($this->imageMimetype) {
case 'image/png':
- 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 getAdminLinks
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getAdminLinks($icons)
{
$adminLinks = '';
if (\is_object($GLOBALS['xoopsUser'])
&& (Utility::userIsAdmin() || Utility::userIsAuthor($this)
- 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 showImage
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showImage(i) {
// optional parameter i
i = i || cur;
Method html2text
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function html2text($document)
{
// PHP Manual:: function preg_replace
// $document should contain an HTML document.
// This will remove HTML tags, javascript sections
Method __construct
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($id = null)
{
// $this->helper = Helper::getInstance();
$this->db = \XoopsDatabaseFactory::getDatabaseConnection();
$this->initVar('itemid', \XOBJ_DTYPE_INT, 0);
Method getArticle
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getArticle(Item $itemObj, Category $categoryObj, \XoopsUser $xoopsUser, Helper $helper)
{
$itemImage = $itemObj->getVar('image');
if (isset($itemImage)) {
$imageHandler = xoops_getHandler('image');
Method saveSampleData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function saveSampleData(): void
{
global $xoopsConfig;
$moduleDirName = \basename(\dirname(__DIR__));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Method sendNotifications
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sendNotifications($notifications = []): void
{
/** @var \XoopsNotificationHandler $notificationHandler */
$notificationHandler = \xoops_getHandler('notification');
$tags = [];
Method publisher_tag_iteminfo
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function publisher_tag_iteminfo(&$items)
{
if (empty($items) || !is_array($items)) {
return false;
}