Showing 182 of 279 total issues
Method render
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($alphaCount = null, $howmanyother = null)
{
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
\xoops_loadLanguage('common', $moduleDirName);
Function searchSwishe
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function searchSwishe($swisheQueryWords)
{
/**
* @param $str
* @param $num_chars
- 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 __construct
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($id = null)
{
parent::__construct();
$this->initVar('requestid', \XOBJ_DTYPE_INT);
Method __construct
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($id = null)
{
/** @var \XoopsModules\Wfdownloads\Helper $this ->helper */
$this->helper = Helper::getInstance();
$this->db = \XoopsDatabaseFactory::getDatabaseConnection();
Method render
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
$ele_name = $this->getName();
$ret = '';
$ret .= "<form name='{$ele_name}' id='{$ele_name}' action='{$this->getAction()}' method='{$this->getMethod()}' onsubmit='return xoopsFormValidate_{$ele_name}();' {$this->getExtra()} >" . NWLINE;
Method isBlockCloned
has 54 lines of code (exceeds 25 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');
Method xoops_module_update_wfdownloads
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_update_wfdownloads(XoopsModule $module, $previousVersion = null)
{
$moduleDirName = basename(dirname(__DIR__));
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
Method getForm
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getForm()
{
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$uid = !empty($GLOBALS['xoopsUser']) ? (int)$GLOBALS['xoopsUser']->getVar('uid') : 0;
Method getForm
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getForm()
{
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$uid = !empty($GLOBALS['xoopsUser']) ? (int)$GLOBALS['xoopsUser']->getVar('uid') : 0;
Consider simplifying this complex logical expression. Open
if (!is_object($GLOBALS['xoopsUser']) && true === $use_mirrors
&& (_WFDOWNLOADS_ANONPOST_MIRROR == $helper->getConfig('anonpost')
|| _WFDOWNLOADS_ANONPOST_BOTH == $helper->getConfig('anonpost'))
&& (_WFDOWNLOADS_SUBMISSIONS_MIRROR == $helper->getConfig('submissions')
|| _WFDOWNLOADS_SUBMISSIONS_BOTH == $helper->getConfig('submissions'))) {
Consider simplifying this complex logical expression. Open
if (!\is_object($GLOBALS['xoopsUser'])
&& (\_WFDOWNLOADS_ANONPOST_MIRROR == $this->helper->getConfig('anonpost')
|| \_WFDOWNLOADS_ANONPOST_BOTH == $this->helper->getConfig('anonpost'))
&& (\_WFDOWNLOADS_SUBMISSIONS_MIRROR == $this->helper->getConfig('submissions')
|| \_WFDOWNLOADS_SUBMISSIONS_BOTH == $this->helper->getConfig('submissions'))
Method uploading
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function uploading(
$filename,
$uploadDirectory = 'uploads',
$allowedMimetypes = [],
$redirectURL = 'index.php',
Method updateBlock
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
{
$myblock = new XoopsBlock($bid);
$myblock->setVar('title', $btitle);
$myblock->setVar('weight', $bweight);
Method getDownloadTime
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getDownloadTime($size = 0, $gmodem = 1, $gisdn = 1, $gdsl = 1, $gslan = 0, $gflan = 0)
{
$aflag = [];
$amtime = [];
$artime = [];
Method getDirectoryStatus
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getDirectoryStatus($path, $mode = 0777, $redirectFile = null)
{
global $pathIcon16;
if (empty($path)) {
Function xcopy
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function xcopy($source, $dest)
{
// Check for symlinks
if (\is_link($source)) {
return \symlink(\readlink($source), $dest);
- 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 delDir
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function delDir($dir, $if_not_empty = true)
{
if (!\file_exists($dir)) {
return 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
Method wfdownloads_top_by_cat_show
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wfdownloads_top_by_cat_show($options)
{
if (!class_exists(Helper::class)) {
return false;
}
Method checkVerModule
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function checkVerModule($helper, $source = 'github', $default = 'master')
{
$moduleDirName = \basename(dirname(__DIR__, 2));
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
$update = '';
Method getForm
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getForm($action = false)
{
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
if (!$action) {