Showing 30 of 30 total issues
File ConfigureCommand.php
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/*
Monitor
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
final class Monitor
{
/** @var string */
private const TRACK = 'track';
File Monitor.php
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/*
Function validateTopic
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private function validateTopic(string $identity, string $type, string $topic, array $identities): void
{
$currentPath = sprintf('shq_aws_ses_monitor.identities.%s.%s.topic', $identity, $type);
$checkCurrentPath = sprintf('Check the configuration at path "%s".', $currentPath);
$wantsToUseDomain = self::USE_DOMAIN === $topic;
- 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
Bounce
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Bounce
{
/** Hard bounces and subtypes.
* @var string */
public const TYPE_PERMANENT = 'Permanent';
ConfigureCommand
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
final class ConfigureCommand extends Command
{
/** @var string */
private const FORCE = 'force';
MailMessage
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class MailMessage
{
/**
* A unique ID that Amazon SES assigned to the message.
*
Method subscribeIdentityToTopic
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function subscribeIdentityToTopic(string $identity, string $messageType): void
{
static $lastCall = 0;
switch ($messageType) {
case SnsTypes::MESSAGE_TYPE_BOUNCE:
Method getConfigTreeBuilder
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder(): TreeBuilder
{
$this->identityGuesser = new IdentityGuesser();
$treeBuilder = new TreeBuilder('shq_aws_ses_monitor');
Function checkIdentityDkimConfiguration
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function checkIdentityDkimConfiguration(string $identity): void
{
// (Requires a verified identity) If the remote configuration is different than the local configuration...
$this->console->overwrite('Checking DKIM configuration...', $this->sectionBody);
$log = sprintf('Identity <comment>%s</comment> is not still verified: cannot synch dkim enabling', $identity);
- 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 checkIdentityVerificationStatus
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkIdentityVerificationStatus(string $identity): void
{
// If the identity is not still verified (or doesn't exist at all)...
$this->console->overwrite('Checking Identity verification status:', $this->sectionBody);
$log = sprintf('Identity <comment>%s</comment> is already verified: skipping...', $identity);
Method checkIdentityDkimConfiguration
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkIdentityDkimConfiguration(string $identity): void
{
// (Requires a verified identity) If the remote configuration is different than the local configuration...
$this->console->overwrite('Checking DKIM configuration...', $this->sectionBody);
$log = sprintf('Identity <comment>%s</comment> is not still verified: cannot synch dkim enabling', $identity);
Method validateTopic
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function validateTopic(string $identity, string $type, string $topic, array $identities): void
{
$currentPath = sprintf('shq_aws_ses_monitor.identities.%s.%s.topic', $identity, $type);
$checkCurrentPath = sprintf('Check the configuration at path "%s".', $currentPath);
$wantsToUseDomain = self::USE_DOMAIN === $topic;
Method execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
// Show to developer the selction of identities
$selectedIdentities = $this->getHelper('question')->ask($input, $output, $this->createIdentitiesQuestion());
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
string $env,
AwsDataProcessor $awsDataProcessor,
Console $console,
IdentitiesStore $configuredIdentities,
IdentityGuesser $identityGuesser,
Function subscribeIdentityToTopic
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function subscribeIdentityToTopic(string $identity, string $messageType): void
{
static $lastCall = 0;
switch ($messageType) {
case SnsTypes::MESSAGE_TYPE_BOUNCE:
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $env,
EntityManagerInterface $entityManager,
Monitor $monitor,
SesManager $sesManager,
SnsManager $snsManager,
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(array $configuration, string $notificationType, AwsClientFactory $awsClientFactory, EntityManagerInterface $entityManager, RouterInterface $router)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
BounceNotificationHandler $bounceNotificationHandler,
ComplaintNotificationHandler $complaintNotificationHandler,
DeliveryNotificationHandler $deliveryNotificationHandler,
EntityManagerInterface $entityManager,
MessageHelper $messageHelper
Function filterBlacklisted
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function filterBlacklisted(array $identities, array $recipients): array
{
$emails = \array_keys($recipients);
$fromIdentities = \array_keys($identities);
- 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"