Function processMailbox
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
public function processMailbox($max = false)
{
if (empty($this->action_function) || !function_exists($this->action_function)) {
$this->error_msg = 'Action function not found!';
$this->output();
- 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 class.phpmailer-bmh.php
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/* class.phpmailer-bmh.php
.---------------------------------------------------------------------------.
| Software: PHPMailer-BMH (Bounce Mail Handler) |
| Version: 5.0.0rc1 |
Method processMailbox
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function processMailbox($max = false)
{
if (empty($this->action_function) || !function_exists($this->action_function)) {
$this->error_msg = 'Action function not found!';
$this->output();
Method processBounce
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function processBounce($pos, $type, $totalFetched)
{
$header = imap_headerinfo($this->_mailbox_link, $pos);
$subject = strip_tags($header->subject);
if ('DSN' === $type) {
Function processBounce
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function processBounce($pos, $type, $totalFetched)
{
$header = imap_headerinfo($this->_mailbox_link, $pos);
$subject = strip_tags($header->subject);
if ('DSN' === $type) {
- 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 globalDelete
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function globalDelete()
{
$dateArr = explode('-', $this->deleteMsgDate); // date format is yyyy-mm-dd
$delDate = mktime(0, 0, 0, $dateArr[1], $dateArr[2], $dateArr[0]);
- 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 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
Method globalDelete
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function globalDelete()
{
$dateArr = explode('-', $this->deleteMsgDate); // date format is yyyy-mm-dd
$delDate = mktime(0, 0, 0, $dateArr[1], $dateArr[2], $dateArr[0]);
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
Avoid too many return
statements within this method. Open
return null;
Function isParameter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function isParameter($currParameters, $varKey, $varValue)
{
foreach ($currParameters as $key => $value) {
if ($key == $varKey) {
if ($value == $varValue) {
- 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"