Showing 16 of 16 total issues
MailDto
has 44 functions (exceeds 20 allowed). Consider refactoring. Open
class MailDto
{
const DATE_FORMAT = 'Y-m-d';
/**
MetricsDto
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
class MetricsDto
{
/**
* @var array
*/
UserProfileDto
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class UserProfileDto
{
/**
* @var string $address
*/
File MailDto.php
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* iDimensionz/{sendgrid-webapi-v3}
* MailDto.php
*
Method toArray
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toArray()
{
$output = [];
$personalizationData = [];
$personalizations = $this->getPersonalizations();
Function toArray
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function toArray()
{
$output = [];
$personalizationData = [];
$personalizations = $this->getPersonalizations();
- 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
MailSettingsDto
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class MailSettingsDto
{
/**
* @var boolean
*/
File MetricsDto.php
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* iDimensionz/{sendgrid-webapi-v3}
* MetricsDto.php
*
Function isReadyToSend
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function isReadyToSend(MailDto $mailDto)
{
$isReady = true;
// Check personalizations.
$personalizationCount = count($mailDto->getPersonalizations());
- 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 toArray
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toArray()
{
$output = [];
if (!empty($this->getBccEmailAddress()) && !empty($this->isBccEnabled())) {
$output['bcc'] = [
Method isReadyToSend
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isReadyToSend(MailDto $mailDto)
{
$isReady = true;
// Check personalizations.
$personalizationCount = count($mailDto->getPersonalizations());
Consider simplifying this complex logical expression. Open
if ($isValid) {
$keys = array_keys($templateVersionData);
$isValid = $isValid &&
in_array('id', $keys) &&
in_array('template_id', $keys) &&
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($content, $filename, $type=null, $disposition=null, $contentId=null)
Function toArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function toArray()
{
$output = [];
if (!empty($this->getBccEmailAddress()) && !empty($this->isBccEnabled())) {
$output['bcc'] = [
- 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 __construct
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(array $templateVersionData)
{
$this->validateArray($templateVersionData);
if (!empty($templateVersionData)) {
$this->setId($templateVersionData['id']);
- 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 __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(array $metricsData)
{
if (array_key_exists('metrics', $metricsData)) {
$this->setMetrics($metricsData['metrics']);
if (array_key_exists('name', $metricsData)) {
- 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"