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);
/*
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
string $env,
AwsDataProcessor $awsDataProcessor,
Console $console,
IdentitiesStore $configuredIdentities,
IdentityGuesser $identityGuesser,
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 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 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"