File ConfigureCommand.php
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/*
ConfigureCommand
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
final class ConfigureCommand extends Command
{
/** @var string */
private const FORCE = 'force';
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:
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 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 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $env,
EntityManagerInterface $entityManager,
Monitor $monitor,
SesManager $sesManager,
SnsManager $snsManager,
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
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"