Showing 130 of 207 total issues
Method getImagesCriteria
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function getImagesCriteria($crImages, $albId, $start, $limit, $sort, $order)
Avoid deeply nested control flow statements. Open
if (1 == $helper->getConfig('permission_download')) {
/** @var \XoopsGroupPermHandler $grouppermHandler */
$grouppermHandler = xoops_getHandler('groupperm');
$criteria = new \CriteriaCompo();
$criteria->add(new \Criteria('gperm_itemid', $lidDownloads, '='));
Method resizeAndCrop
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function resizeAndCrop($src_url, $src_mimetype, $dest_url, $dest_w, $dest_h, $quality = 90)
Method truncateHtml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $text,
?int $length = 100,
string $ending = '...',
bool $exact = false,
bool $considerHtml = true
Method getCountImages
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getCountImages($albId = 0, $start = 0, $limit = 0, $sort = 'img_id ASC, img_name', $order = 'ASC')
Method makeArrayTreeOptions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function makeArrayTreeOptions($fieldName, $key, &$ret, $prefix_orig, $prefix_curr = '')
Method getPathTree
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function getPathTree($mytree, $key, $category_array, $title, $prefix = '')
Method getPathTree
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function getPathTree($mytree, $key, $category_array, $title, $prefix = '')
Method tdmdownloads_search
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function tdmdownloads_search($queryarray, $andor, $limit, $offset, $userid)
Method resizeImage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function resizeImage($sourcefile, $endfile, $max_width, $max_height, $imageMimetype)
Method openCollapsableBar
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function openCollapsableBar($tablename = '', $iconname = '', $tabletitle = '', $tabledsc = '', $open = true)
Function __construct
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($target)
{
$moduleDirName = \basename(\dirname(__DIR__, 2));
$moduleDirNameUpper = \mb_strtoupper($moduleDirName);
/** @var \XoopsModules\Tdmdownloads\Helper $this- >helper */
- 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 renameColumns
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function renameColumns(): void
{
foreach ($this->renameColumns as $tableName) {
if ($this->tableHandler->useTable($tableName)) {
$oldName = $tableName['from'];
- 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 getEditor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getEditor(?\Xmf\Module\Helper $helper = null, ?array $options = null): ?\XoopsFormTextArea
{
$descEditor = null;
/** @var Helper $helper */
- 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 b_tdmdownloads_top_edit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function b_tdmdownloads_top_edit($options)
{
//appel de la class
$moduleDirName = basename(dirname(__DIR__));
$categoryHandler = Helper::getInstance()->getHandler('Category');
- 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 getFileSize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getFileSize($url)
{
if (\function_exists('curl_init') && false !== ($curlHandle = \curl_init($url))) {
\curl_setopt($curlHandle, \CURLOPT_RETURNTRANSFER, true);
\curl_setopt($curlHandle, \CURLOPT_HEADER, true);
- 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
Avoid too many return
statements within this method. Open
return ['error' => \sprintf(\constant($moduleDirNameUpper . '_' . 'FAILSAVEWM_MEDIUM'), $this->imageNicename, $resWm)];
Avoid too many return
statements within this method. Open
return ['error' => \sprintf(\constant($moduleDirNameUpper . '_' . 'FAILSAVEWM_LARGE'), $this->imageNicename, $resWm)];
Avoid too many return
statements within this method. Open
return ['success' => true, 'uuid' => $uuid];
Avoid too many return
statements within this method. Open
return true;