Showing 355 of 3,032 total issues
Method setVarsFromRequest
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setVarsFromRequest(): void
{
//Required fields
// if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
// $this->setVar('categoryid', $categoryid);}
Function publisher_items_recent_show
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function publisher_items_recent_show($options)
{
$helper = Helper::getInstance();
/** @var ItemHandler $itemHandler */
$itemHandler = $helper->getHandler('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 setVarsFromRequest
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function setVarsFromRequest(): void
{
//Required fields
// if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) {
// $this->setVar('categoryid', $categoryid);}
- 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 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
global $allowedSites;
$this->startTime = microtime(true);
date_default_timezone_set('UTC');
Method publisher_items_recent_show
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
function publisher_items_recent_show($options)
{
$helper = Helper::getInstance();
/** @var ItemHandler $itemHandler */
$itemHandler = $helper->getHandler('Item');
Function edit
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public static function edit(): void
{
$helper = Helper::getInstance();
/** @var MimetypeHandler $mimetypeHandler */
$mimetypeHandler = $helper->getHandler('Mimetype');
- 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 publisher_items_columns_show
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
function publisher_items_columns_show($options)
{
// global $xoTheme;
$helper = Helper::getInstance();
/** @var CategoryHandler $categoryHandler */
ThemeTabForm
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class ThemeTabForm extends \XoopsForm
{
public $formTabs = [];
/**
* "action" attribute for the html form
Method xoops_module_update_publisher
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_update_publisher(\XoopsModule $module, ?string $previousVersion = null)
{
// global $GLOBALS['xoopsDB'];
$moduleDirName = \basename(\dirname(__DIR__));
// $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
Function publisher_search
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
function publisher_search($queryArray, $andor, $limit, $offset, $userid, $categories = [], $sortby = 0, $searchin = '', $extra = '')
{
$helper = Helper::getInstance();
$ret = $item = [];
$hightlightKey = '';
- 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 search
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public static function search($icons): void
{
$helper = Helper::getInstance();
/** @var MimetypeHandler $mimetypeHandler */
$mimetypeHandler = $helper->getHandler('Mimetype');
- 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 getItemsFromSearch
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function getItemsFromSearch($queryArray = [], $andor = 'AND', $limit = 0, $offset = 0, $userid = 0, $categories = [], $sortby = 0, $searchin = '', $extra = '')
{
$count = 0;
$ret = [];
$criteriaKeywords = $criteriaPermissions = $criteriaUser = null;
- 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 getItemsFromSearch
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getItemsFromSearch($queryArray = [], $andor = 'AND', $limit = 0, $offset = 0, $userid = 0, $categories = [], $sortby = 0, $searchin = '', $extra = '')
{
$count = 0;
$ret = [];
$criteriaKeywords = $criteriaPermissions = $criteriaUser = null;
Consider simplifying this complex logical expression. Open
if (document.documentElement.getBoundingClientRect) {
// Get Offset using getBoundingClientRect
// http://ejohn.org/blog/getboundingclientrect-is-awesome/
var getOffset = function (el) {
var box = el.getBoundingClientRect();
Function getLocalImagePath
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function getLocalImagePath($src)
{
$src = ltrim($src, '/'); //strip off the leading '/'
if (!$this->docRoot) {
$this->debug(3, 'We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.');
- 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 checkVerModule
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
{
/*
// Generated by curl-to-PHP: https://incarnate.github.io/curl-to-php/
$ch = curl_init();
- 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 updateBlock
has a Cognitive Complexity of 21 (exceeds 5 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);
- 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 orderBlock
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function orderBlock(
array $bid,
array $oldtitle,
array $oldside,
array $oldweight,
- 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 editCategory
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function editCategory($showmenu = false, $categoryid = 0, $nbSubCats = 4, $categoryObj = null): void
{
$helper = Helper::getInstance();
$configurator = new Common\Configurator();
$icons = $configurator->icons;
- 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 toArraySimple
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toArraySimple($display = 'default', $maxCharTitle = 0, $maxCharSummary = 300, $fullSummary = false)
{
$itemPageId = -1;
if (\is_numeric($display)) {
$itemPageId = $display;