Showing 355 of 3,032 total issues
ItemHandler
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class ItemHandler extends \XoopsPersistableObjectHandler
{
private const TABLE = 'publisher_items';
private const ENTITY = Item::class;
private const ENTITYNAME = 'Item';
Function publisher_editItem
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function publisher_editItem($showmenu = false, $itemId = 0, $clone = false): void
{
$helper = Helper::getInstance();
global $publisherCurrentPage;
- 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_spot_edit
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function publisher_items_spot_edit($options)
{
// require_once PUBLISHER_ROOT_PATH . '/class/blockform.php';
xoops_load('XoopsFormLoader');
$form = new BlockForm();
File Metagen.php
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\Publisher;
/*
File script.easing.js
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
// JavaScript Document
/*! Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
File xnews.php
has 279 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.
File SysUtility.php
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\Publisher\Common;
/*
File ams.php
has 275 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.
Function addSrcToDestList
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function addSrcToDestList() {
destList = window.document.forms[0].destList;
srcList = window.document.forms[0].srcList;
var len = destList.length;
for (var i = 0; i < srcList.length; i++) {
- 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 getObjects
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function &getObjects(\CriteriaElement $criteria = null, $idKey = 'none', $as_object = true, $notNullFields = null)
{
$limit = $start = 0;
$ret = [];
$notNullFields = (null !== $notNullFields) ?: '';
- 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 resizeImage
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function resizeImage()
{
// 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 getAllFiles
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function getAllFiles($itemId = 0, $status = -1, $limit = 0, $start = 0, $sort = 'datesub', $order = 'DESC', $category = [])
{
$files = [];
$this->table_link = $this->db->prefix($this->helper->getDirname() . '_items');
- 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 fmcontent.php
has 274 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.
File CategoryHandler.php
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
namespace XoopsModules\Publisher;
/*
Function showThumb
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showThumb(i, transition) {
// optional parameters
transition = transition || false;
i = i || cur;
Method generateSeoTitle
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function generateSeoTitle($title = '', $withExt = true)
{
// Transformation de la chaine en minuscule
// Codage de la chaine afin d'éviter les erreurs 500 en cas de caractères imprévus
$title = \rawurlencode(\mb_strtolower($title));
Method truncateHtml
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function truncateHtml(
string $text,
?int $length = 100,
string $ending = '...',
bool $exact = false,
Method ratingBar
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function ratingBar($itemId)
{
$helper = Helper::getInstance();
$ratingUnitWidth = 30;
$units = 5;
Function add
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function add(): 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 deleteDirectory
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function deleteDirectory($src)
{
// Only continue if user is a 'global' Admin
if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
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"