Showing 355 of 3,032 total issues
Method publisher_latest_news_show
has 195 lines of code (exceeds 25 allowed). Consider refactoring. Open
function publisher_latest_news_show($options)
{
$block = [];
$configurator = new Configurator();
Function getItemRating
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
public function getItemRating($itemId = 0, $source = 0)
{
$helper = \XoopsModules\Publisher\Helper::getInstance();
$itemRating = [];
- 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
File ItemHandler.php
has 479 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\Publisher;
/*
File modinfo.php
has 477 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
define('_MI_PUBLISHER_ADMENU1', 'Summary');
define('_MI_PUBLISHER_ADMENU2', 'Categories');
define('_MI_PUBLISHER_ADMENU3', 'Articles');
Function getItemRating
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
public function getItemRating($itemId = null, $source = null): array
{
$itemId = $itemId ?? 0;
$source = $source ?? 0;
$xoopsUser = $GLOBALS['xoopsUser'];
- 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
Item
has 49 functions (exceeds 20 allowed). Consider refactoring. Open
class Item extends \XoopsObject
{
public const PAGEWRAP = '[pagewrap=';
public const BODYTAG = '<body>';
/**
Method search
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function search($icons): void
{
$helper = Helper::getInstance();
/** @var MimetypeHandler $mimetypeHandler */
$mimetypeHandler = $helper->getHandler('Mimetype');
Method createElements
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createElements(): void
{
// require_once \dirname(__DIR__, 2) . '/include/common.php';
// Category
$criteria = new \Criteria(null);
File item.php
has 432 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit authors.
Utility
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
class Utility extends Common\SysUtility
{
//--------------- Custom module methods -----------------------------
/**
* Function responsible for checking if a directory exists, we can also write in and create an index.html file
Method getItemRating5
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getItemRating5($itemObj = null, $source = null): array
{
$itemId = $itemObj->itemid();
$source = $source ?? 0;
$xoopsUser = $GLOBALS['xoopsUser'];
File jquery.popeye-2.1.js
has 409 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* jQuery Popeye 2.1 - http://dev.herr-schuessler.de/jquery/popeye/
*
* converts a HTML image list in image gallery with inline enlargement
*
Function __construct
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
- 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 getItemRating
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getItemRating($itemId = null, $source = null): array
{
$itemId = $itemId ?? 0;
$source = $source ?? 0;
$xoopsUser = $GLOBALS['xoopsUser'];
Method publisher_items_spot_show
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
function publisher_items_spot_show($options)
{
// global $xoTheme;
$helper = Helper::getInstance();
/** @var CategoryHandler $categoryHandler */
Method publisher_latest_news_edit
has 133 lines of code (exceeds 25 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">';
Function getElementsBySelector
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
document.getElementsBySelector = function (selector) {
// Attempt to fail gracefully in lesser browsers
if (!document.getElementsByTagName) {
return new Array();
}
Method getItemRating
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getItemRating($itemId = 0, $source = 0)
{
$helper = \XoopsModules\Publisher\Helper::getInstance();
$itemRating = [];
File latest_news.php
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
which is considered copyrighted (c) material of the original comment or credit authors.
Method manage
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function manage($icons): void
{
$helper = Helper::getInstance();
$utility = new Utility();
/** @var MimetypeHandler $mimetypeHandler */