Showing 130 of 207 total issues
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 update_tdmdownloads_v201
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update_tdmdownloads_v201($module)
{
$moduleDirName = \basename(\dirname(__DIR__));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
$helper = Helper::getInstance();
Function deleteDirectory
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function deleteDirectory(string $src): bool
{
// 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"
Further reading
Function render
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function render($block = null)
{
\xoops_load('XoopsFormLoader');
\xoops_loadLanguage('common', $this->moduleDirNameUpper);
- 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 cloneFileFolder
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function cloneFileFolder($path)
{
global $patKeys;
global $patValues;
- 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 getFormImages
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFormImages($action = false)
{
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
$helper = Helper::getInstance();
File submit.php
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use XoopsModules\Tag\{
Helper as TagHelper,
Tag,
File modified.php
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
Method resizeImage
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resizeImage($sourcefile, $endfile, $max_width, $max_height, $imageMimetype)
{
// check file extension
switch ($imageMimetype) {
case 'image/png':
Consider simplifying this complex logical expression. Open
if (\Xmf\Request::hasVar('ok', 'REQUEST') && 1 == \Xmf\Request::getInt('ok', 0, 'REQUEST')) {
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('category.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
// supression des téléchargements de la catégorie
Method isBlockCloned
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups): void
{
\xoops_loadLanguage('admin', 'system');
\xoops_loadLanguage('admin/blocksadmin', 'system');
\xoops_loadLanguage('admin/groups', 'system');
Method resizeAndCrop
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resizeAndCrop($src_url, $src_mimetype, $dest_url, $dest_w, $dest_h, $quality = 90)
{
// check file extension
switch ($src_mimetype) {
case 'image/png':
Method getForm
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getForm($action = false)
{
$helper = Helper::getInstance();
$moduleDirName = \basename(\dirname(__DIR__));
if (!$action) {
Function cloneFolder
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function cloneFolder($pathSource, $pathTarget)
{
if (\is_dir($pathSource)) {
// Create new dir
if (!\mkdir($pathTarget) && !\is_dir($pathTarget)) {
- 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 orderBlock
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
$bid,
$oldtitle,
$oldside,
$oldweight,
$oldvisible,
Function mergeImage
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function mergeImage($src_url, $dest_url, $pos, $of)
{
$dest = \imagecreatefromjpeg($dest_url);
$src = \imagecreatefromjpeg($src_url);
// ImageCopy ( resource $dst_im , resource $src_im , int $dst_x , int $dst_y , int $src_x , int $src_y , int $src_w , int $src_h )
- 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 mergeImage
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mergeImage($src_url, $dest_url, $pos, $of)
{
$dest = \imagecreatefromjpeg($dest_url);
$src = \imagecreatefromjpeg($src_url);
// ImageCopy ( resource $dst_im , resource $src_im , int $dst_x , int $dst_y , int $src_x , int $src_y , int $src_w , int $src_h )
Method update_tdmdownloads_v200
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update_tdmdownloads_v200(&$module)
{
// Update size
$moduleDirName = basename(dirname(__DIR__));
$db = \XoopsDatabaseFactory::getDatabaseConnection();
Method checkVerModule
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function checkVerModule(Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
{
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
$update = '';
Method getPathTreeUrl
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getPathTreeUrl($mytree, $key, $category_array, $title, $prefix = '', $link = false, $order = 'ASC', $lasturl = false)
{
global $xoopsModule;
$categoryParent = $mytree->getAllParent($key);
if ('ASC' === $order) {