Aerendir/aws-ses-monitor-bundle

View on GitHub
src/Service/Monitor.php

Summary

Maintainability
C
1 day
Test Coverage

Monitor has 32 functions (exceeds 20 allowed). Consider refactoring.
Open

final class Monitor
{
    /** @var string */
    private const TRACK = 'track';

Severity: Minor
Found in src/Service/Monitor.php - About 4 hrs to fix

    File Monitor.php has 329 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    declare(strict_types=1);
    
    /*
    Severity: Minor
    Found in src/Service/Monitor.php - About 3 hrs to fix

      Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              string $env,
              AwsDataProcessor $awsDataProcessor,
              Console $console,
              IdentitiesStore $configuredIdentities,
              IdentityGuesser $identityGuesser,
      Severity: Major
      Found in src/Service/Monitor.php - About 50 mins to fix

        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.
        Severity: Minor
        Found in src/Service/Monitor.php - About 25 mins to fix

        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(),
        Severity: Minor
        Found in src/Service/Monitor.php - About 25 mins to fix

        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
        Severity: Minor
        Found in src/Service/Monitor.php - About 25 mins to fix

        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

        There are no issues that match your filters.

        Category
        Status