Showing 283 of 379 total issues
Method encodeFile
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function encodeFile($path, $encoding = 'base64')
{
try {
if (!is_readable($path)) {
throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE);
Method addOrEnqueueAnAddress
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addOrEnqueueAnAddress($kind, $address, $name)
{
$address = trim($address);
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
if (false === ($pos = mb_strrpos($address, '@'))) {
Method mailbox_exist
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mailbox_exist($mailbox, $create = true)
{
if ('' == trim($mailbox) || false === mb_strpos($mailbox, 'INBOX.')) {
// this is a critical error with either the mailbox name blank or an invalid mailbox name
// need to stop processing and exit at this point
Method getForm
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getForm($action = false)
{
global $xoopsDB;
if (false === $action) {
Method _build_link_list
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _build_link_list($link, $display, $link_override = null)
{
$link_method = $link_override ?: $this->_options['do_links'];
if ('none' === $link_method) {
return $display;
Method deleteDirectory
has 26 lines of code (exceeds 25 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;
Method getForm
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getForm($action = false)
{
global $xoopsDB;
if (false === $action) {
Method getValuesMailinglist
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getValuesMailinglist($keys = null, $format = null, $maxDepth = null)
{
$ret['id'] = $this->getVar('mailinglist_id');
$ret['name'] = $this->getVar('mailinglist_name');
$ret['email'] = $this->getVar('mailinglist_email');
Function rmove
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function rmove($src, $dest)
{
// 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 recurseCopy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function recurseCopy($src, $dst)
{
$dir = opendir($src);
// @mkdir($dst);
if (!@mkdir($dst) && !is_dir($dst)) {
- 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 rcopy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function rcopy($src, $dest)
{
// 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
Method xnewsletter_plugin_getdata_csv
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$cat_id,
$action_after_read,
$limitCheck,
$skipCatsubscrExist,
$file,
Method tln_fixatts
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$tagname,
$attary,
$rm_attnames,
$bad_attvals,
$add_attr_to_tag,
Method doCallback
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from)
Method authorise
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
Avoid deeply nested control flow statements. Open
if ($helper->getHandler('Template')->insert($templateObj)) {
redirect_header('?op=list', 3, _AM_XNEWSLETTER_FORMOK);
}
Method addStringEmbeddedImage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$string,
$cid,
$name = '',
$encoding = 'base64',
$type = '',
Function encodeQ
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function encodeQ($str, $position = 'text')
{
// There should not be any EOL in the string
$pattern = '';
$encoded = str_replace(["\r", "\n"], '', $str);
- 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 (count($protocolsAll) > 1) {
$protocol_status .= "($p) ";
}
Avoid deeply nested control flow statements. Open
if ($protocolCount > 2) {
$protocol_status .= '...';
}