Showing 182 of 279 total issues
Function checkVerModule
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function checkVerModule($helper, $source = 'github', $default = 'master')
{
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
$update = '';
- 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 addElement
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function addElement($formElement, $required = false, $row = null, $column = null)
{
if (null === $row) {
$row = $this->_rows;
}
- 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 import_wmpdownloads_to_wfdownloads
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function import_wmpdownloads_to_wfdownloads()
{
echo '<br>';
echo _AM_WFDOWNLOADS_IMPORT_IMPORTINGDATA;
echo '<br>';
Method createThumb
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createThumb($imgName, $imgPath, $imgSavePath, $width = 100, $height = 100, $quality = 100, $update = false, $aspect = 1)
{
$helper = Helper::getInstance();
// Paths
Method import_mydownloads_to_wfdownloads
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
function import_mydownloads_to_wfdownloads()
{
echo '<br>';
echo _AM_WFDOWNLOADS_IMPORT_IMPORTINGDATA;
echo '<br>';
DbupdaterTable
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class DbupdaterTable
{
/**
* @var string $_name name of the table
*/
Method import_pddownloads_to_wfdownloads
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function import_pddownloads_to_wfdownloads()
{
echo '<br>';
echo _AM_WFDOWNLOADS_IMPORT_IMPORTINGDATA;
echo '<br>';
Function getListTypeAsArray
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public static function getListTypeAsArray($dirname, $type = '', $prefix = '', $noselection = 1)
{
$filelist = [];
switch (\trim($type)) {
case 'images':
- 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 isBlockCloned
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options = null)
{
xoops_loadLanguage('admin', 'system');
xoops_loadLanguage('admin/blocksadmin', 'system');
xoops_loadLanguage('admin/groups', 'system');
- 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 uploading
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function uploading(
$filename,
$uploadDirectory = 'uploads',
$allowedMimetypes = [],
$redirectURL = 'index.php',
- 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 copyDir
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function copyDir($source, $destination)
{
if (!$dirHandler = \opendir($source)) {
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 searchSwishe
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function searchSwishe($swisheQueryWords)
{
/**
* @param $str
* @param $num_chars
Method truncateHtml
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
{
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
Method truncateHtml
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
{
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
File singlefile.php
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
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 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"
Further reading
Function wfdownloads_cloneFileDir
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function wfdownloads_cloneFileDir($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
Function import_wfd_to_wfdownloads
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function import_wfd_to_wfdownloads()
{
/** @var \XoopsModuleHandler $moduleHandler */
$moduleHandler = xoops_getHandler('module');
// Get destination module/handlers/configs
- 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 import_tdmdownloads_to_wfdownloads
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function import_tdmdownloads_to_wfdownloads()
{
echo "<br><span style='font-weight: bold;'>Importing Data</span><br>";
$destination = [
'cat' => $GLOBALS['xoopsDB']->prefix('wfdownloads_cat'),
Method largeDownload
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function largeDownload($filePath, $fileMimetype)
{
/* You may need these ini settings too */
\set_time_limit(0);
\ini_set('memory_limit', '512M');