Showing 16 of 16 total issues
MailerMessage
has 39 functions (exceeds 20 allowed). Consider refactoring. Open
class MailerMessage extends BaseMessage
{
private $_charset;
private $_from;
Function init
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function init()
{
parent::init();
- 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 extractMessage
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function extractMessage(MailerMessage $message)
{
$array = [
'From' => $message->getFrom(),
'To' => $message->getTo(),
Method items
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function items($listId = null, $isExcludedFromCampaigns = null, $contactData = false)
{
// setup limit
$limit = 100;
// prepare filters
Function processConfirmLink
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function processConfirmLink()
{
$widgetId = Yii::$app->request->get('w');
$subscribe = Yii::$app->request->get('subscribe');
- 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 create
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create($name, $mjml)
{
$this->_errorMessage = false;
$json = Mjml::getArray($mjml);
Method init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init()
{
parent::init();
Method mjmlToArray
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function mjmlToArray($mjml)
{
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
Function sendBulk
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function sendBulk($chunk = 50)
{
if (empty($this->_bulkList)) {
throw new InvalidConfigException("The list of bulk messages can not be empty. use addToBulk().");
}
- 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 mjmlToArray
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function mjmlToArray($mjml)
{
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
- 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 send
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function send($text, $to, $from, $validate = false, $throwException = false)
Function send
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function send($text, $to, $from, $validate = false, $throwException = false)
{
if ($validate) {
$model = new DynamicModel(compact('to', 'from'));
$model->addRule(['from'], 'string', ['min' => 3, 'max' => 11]);
- 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 items
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function items($listId = null, $isExcludedFromCampaigns = null, $contactData = false)
{
// setup limit
$limit = 100;
// prepare filters
- 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 extractMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function extractMessage(MailerMessage $message)
{
$array = [
'From' => $message->getFrom(),
'To' => $message->getTo(),
- 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 parseMjmlToHtml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function parseMjmlToHtml($mjml)
{
$module = Module::getInstance();
$ch = curl_init('https://api.mjml.io/v1/render');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 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
Function wrapCdataForRawElements
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function wrapCdataForRawElements($content)
{
foreach ($this->rawElements as $name) {
// save the replacmenets which are done in order to ensure no double replacements happens.
$doneReplacements = [];
- 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"