include/task.inc.php
Function xnewsletter_executeTasks
has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring. Open
Open
function xnewsletter_executeTasks($xn_send_in_packages, $letter_id = 0, $cron = 0)
{
require_once XOOPS_ROOT_PATH . '/modules/xnewsletter/include/functions.php';
// require_once XNEWSLETTER_ROOT_PATH . '/class/class.xnewslettermailer.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
Method xnewsletter_executeTasks
has 303 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function xnewsletter_executeTasks($xn_send_in_packages, $letter_id = 0, $cron = 0)
{
require_once XOOPS_ROOT_PATH . '/modules/xnewsletter/include/functions.php';
// require_once XNEWSLETTER_ROOT_PATH . '/class/class.xnewslettermailer.php';
Function xnewsletter_createTasks
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
Open
function xnewsletter_createTasks($op, $letter_id, $xn_send_in_packages, $xn_send_in_packages_time)
{
global $xoopsUser, $xoopsDB;
$helper = Xnewsletter\Helper::getInstance();
- 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
File task.inc.php
has 408 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* ****************************************************************************
* - A Project by Developers TEAM For Xoops - ( https://xoops.org )
* ****************************************************************************
Method xnewsletter_createTasks
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function xnewsletter_createTasks($op, $letter_id, $xn_send_in_packages, $xn_send_in_packages_time)
{
global $xoopsUser, $xoopsDB;
$helper = Xnewsletter\Helper::getInstance();
Avoid too many return
statements within this method. Open
Open
return null;
Avoid too many return
statements within this method. Open
Open
return $protocol_status;
Avoid too many return
statements within this method. Open
Open
return _MA_XNEWSLETTER_ACCOUNTS_NONEAVAIL;
Avoid too many return
statements within this method. Open
Open
return $task_subscrs->getErrors();
Avoid too many return
statements within this method. Open
Open
return $task_letters->getErrors();