Showing 283 of 379 total issues
Method getForm
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getForm($action = false)
{
global $xoopsDB;
if (false === $action) {
Method parseAddresses
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseAddresses($addrstr, $useimap = true)
{
$addresses = [];
if ($useimap and function_exists('imap_rfc822_parse_adrlist')) {
//Use this built-in parser if it's available
Method _convert_blockquotes
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _convert_blockquotes(&$text)
{
if (preg_match_all('/<\/*blockquote[^>]*>/i', $text, $matches, PREG_OFFSET_CAPTURE)) {
$start = 0;
$taglen = 0;
Method getMailMIME
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMailMIME()
{
$result = '';
$ismultipart = true;
switch ($this->message_type) {
Method xoops_module_update_xnewsletter_103
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoops_module_update_xnewsletter_103()
{
global $xoopsDB;
$sql = sprintf('DROP TABLE IF EXISTS `' . $xoopsDB->prefix('mod_xnewsletter_import') . '`');
Function addAnAddress
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function addAnAddress($kind, $address, $name = '')
{
if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'], true)) {
$error_message = $this->lang('Invalid recipient kind: ') . $kind;
$this->setError($error_message);
- 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 tln_body2div
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function tln_body2div($attary, $trans_image_path)
{
$divattary = ['class' => "'bodyclass'"];
$text = '#000000';
$has_bgc_stl = $has_txt_stl = 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 setError
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function setError($msg)
{
$this->error_count++;
if ('smtp' == $this->Mailer and null !== $this->smtp) {
$lasterror = $this->smtp->getError();
- 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 delete
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function delete(\XoopsObject $subscrObj, $force = false)
{
$res = true;
$subscr_id = (int)$subscrObj->getVar('subscr_id');
// delete subscriptions ({@link catsubscr} objects)
- 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_CleanVars
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xnewsletter_CleanVars($global, $key, $default = '', $type = 'int', $notset = false)
{
require_once XOOPS_ROOT_PATH . '/include/functions.php';
switch ($type) {
case 'string':
Method getForm
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getForm($action = false)
{
global $xoopsDB;
if (false === $action) {
Method getValuesAccount
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getValuesAccount($keys = null, $format = null, $maxDepth = null)
{
$ret = $this->getValues($keys, $format, $maxDepth);
$ret['id'] = $this->getVar('accounts_id');
$accounts_types = [
Method mb_pathinfo
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function mb_pathinfo($path, $options = null)
{
$ret = ['dirname' => '', 'basename' => '', 'extension' => '', 'filename' => ''];
$pathinfo = [];
if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) {
Method mailSend
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function mailSend($header, $body)
{
$toArr = [];
foreach ($this->to as $toaddr) {
$toArr[] = $this->addrFormat($toaddr);
Function DKIM_Sign
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function DKIM_Sign($signHeader)
{
if (!defined('PKCS7_TEXT')) {
if ($this->exceptions) {
throw new phpmailerException($this->lang('extension_missing') . 'openssl');
- 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 mailSend
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function mailSend($header, $body)
{
$toArr = [];
foreach ($this->to as $toaddr) {
$toArr[] = $this->addrFormat($toaddr);
- 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 tln_sanitize
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
$body,
$tag_list,
$rm_tags_with_content,
$self_closing_tags,
$force_tag_closing,
Function mailbox_exist
has a Cognitive Complexity of 11 (exceeds 5 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
- 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 getForm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getForm($action = false)
{
global $xoopsDB;
if (false === $action) {
- 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 rrmdir
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function rrmdir($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"