Showing 30 of 30 total issues
Function processIdentitiesNotificationAttributes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function processIdentitiesNotificationAttributes(Result $result): void
{
foreach ($result->get('NotificationAttributes') as $identity => $attribute) {
$this->data[self::IDENTITIES][$identity][self::NOTIFICATIONS] = [
'forwarding_enabled' => $attribute['ForwardingEnabled'],
- 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
Avoid too many return
statements within this method. Open
return new Response('Notification type not understood', 403);
Avoid too many return
statements within this method. Open
return $this->deliveryNotificationHandler->processNotification($notificationData, $mailMessage);
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $this->complaintNotificationHandler->processNotification($notificationData, $mailMessage);
Function fetchSubscriptionsData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function fetchSubscriptionsData(): void
{
// Returns a list of the requester's subscriptions. Each call returns a limited list of subscriptions, up to 100.
// If there are more subscriptions, a NextToken is also returned. Use the NextToken parameter in a new
// ListSubscriptions call to get further results.
- 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 logActionsToTake
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function logActionsToTake(): void
{
if (false === empty($this->actionsToTakeNow)) {
$this->ioWriter->warning('There are pending actions.');
$this->ioWriter->writeln('You have to take the actions listed below, then run again the command <comment>bin/console aws:ses:configure</comment> to complete the configuration.');
- 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 getConfiguredIdentitiesList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getConfiguredIdentitiesList(bool $ignoreEnv = false): array
{
if ($ignoreEnv) {
return [
'allowed' => $this->configuredIdentities->getIdentitiesList(),
- 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 canReceiveMessages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function canReceiveMessages(EmailStatus $emailStatus, string $identity): bool
{
$filter = $this->monitor->findConfiguredIdentity($identity, 'bounces')['filter'];
$maxBounces = $filter['max_bounces'];
$softAsHard = $filter['soft_as_hard'];
- 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 identityRequiresTopicSubscription
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function identityRequiresTopicSubscription(string $identity, string $notificationType): bool
{
$identityNotifications = $this->getLiveIdentity($identity, 'notifications');
// If the notification SNS topic is not configured
- 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"