Showing 182 of 279 total issues
Method setOrder
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function setOrder($bid, $title, $weight, $visible, $side, $bcachetime, $bmodule)
Method isBlockCloned
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options = null)
Method makeSelBox
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function makeSelBox($name, $fieldName, $prefix = '-', $selected = '', $addEmptyOption = false, $key = 0, $extra = '')
Method makeMySelBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
Method getDownloadTime
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function getDownloadTime($size = 0, $gmodem = 1, $gisdn = 1, $gdsl = 1, $gslan = 0, $gflan = 0)
Function download
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function download($filePath, $isBinary = true, $retBytes = true)
{
// how many bytes per chunk
//$chunkSize = 1 * (1024 * 1024);
$chunkSize = 8 * (1024 * 1024); //8MB (highest possible fread length)
- 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 deeply nested control flow statements. Open
if (is_file($templateFolder . $v)) {
unlink($templateFolder . $v);
}
Function wfdownloads_top_show
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function wfdownloads_top_show($options)
{
if (!class_exists(Helper::class)) {
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
Method makeMySelBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function makeMySelBox($title, $order = '', $preset_id = 0, $none = 0, $sel_name = '', $onchange = '')
Function displayImage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function displayImage($image = '', $href = '', $imgSource = '', $altText = '')
{
$helper = Helper::getInstance();
$showImage = '';
- 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
Consider simplifying this complex logical expression. Open
if (0 == $downloadObj->getVar('published') || $downloadObj->getVar('published') > time()
|| true === $downloadObj->getVar('offline')
|| (0 != $downloadObj->getVar('expired')
&& $downloadObj->getVar('expired') < time())
|| _WFDOWNLOADS_STATUS_WAITING == $downloadObj->getVar('status')) {
Consider simplifying this complex logical expression. Open
if (0 == $downloadObj->getVar('published') || $downloadObj->getVar('published') > time()
|| 1 === $downloadObj->getVar('offline')
|| (1 === $downloadObj->getVar('expired')
&& $downloadObj->getVar('expired') < time())
|| _WFDOWNLOADS_STATUS_WAITING == $downloadObj->getVar('status')) {
Consider simplifying this complex logical expression. Open
if (0 == $downloadObj->getVar('published') || $downloadObj->getVar('published') > time()
|| true === $downloadObj->getVar('offline')
|| (0 != $downloadObj->getVar('expired')
&& $downloadObj->getVar('expired') < time())
|| _WFDOWNLOADS_STATUS_WAITING == $downloadObj->getVar('status')) {
Consider simplifying this complex logical expression. Open
if (0 == $downloadObj->getVar('published') || $downloadObj->getVar('published') > time()
|| true === $downloadObj->getVar('offline')
|| (0 != $downloadObj->getVar('expired')
&& $downloadObj->getVar('expired') < time())
|| _WFDOWNLOADS_STATUS_WAITING == $downloadObj->getVar('status')) {
Consider simplifying this complex logical expression. Open
if (0 == $downloadObj->getVar('published') || $downloadObj->getVar('published') > time() || true === $downloadObj->getVar('offline')
|| (0 != $downloadObj->getVar('expired')
&& $downloadObj->getVar('expired') < time())
|| _WFDOWNLOADS_STATUS_WAITING == $downloadObj->getVar('status')) {
redirect_header('index.php', 3, _MD_WFDOWNLOADS_NODOWNLOAD);
Method makeSelBoxOptionsArray
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function makeSelBoxOptionsArray($fieldName, $key, &$optionsArray, $prefix_orig, $prefix_curr = '')
Method truncateHtml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
Method makeSelBoxOptionsArray
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function makeSelBoxOptionsArray($fieldName, $key, &$optionsArray, $prefix_orig, $prefix_curr = '')
Method truncateHtml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($uploadDir, $allowedMimeTypes, $maxFileSize, $maxWidth = 0, $maxHeight = 0)