Showing 13 of 34 total issues
Function dispatchEvent
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function dispatchEvent(EventWithMetaData $eventWithMetadata)
{
$listeners = $this->eventSubscriber->getListenersForEvent($eventWithMetadata->getEvent());
foreach ($listeners as $listener) {
- 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 dispatchEvent
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function dispatchEvent(EventWithMetaData $eventWithMetadata)
{
$listeners = $this->eventSubscriber->getListenersForEvent($eventWithMetadata->getEvent());
foreach ($listeners as $listener) {
Method thenShouldFailWith
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function thenShouldFailWith($exceptionClass, $message = null)
{
$this->checkCommand($this->command);
try {
Function findEventById
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function findEventById(string $eventId): ?EventWithMetaData
{
foreach ($this->commitsByAggregate as $commits) {
/** @var InMemoryEventsCommit[] $commits */
foreach ($commits as $commit) {
- 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 processEvent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function processEvent($saga, EventWithMetaData $eventWithMetadata, $allMethods): void
{
/** @var EventWithMetaData $eventWithMetadata */
$methods = $this->findMethodsByEventClass(\get_class($eventWithMetadata->getEvent()), $allMethods);
$metaData = $eventWithMetadata->getMetaData();
- 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 8 arguments (exceeds 4 allowed). Consider refactoring. Open
CommandSubscriber $commandSubscriber,
CommandApplier $commandApplier,
AggregateRepository $aggregateRepository,
ConcurrentProofFunctionCaller $functionCaller,
EventsApplierOnAggregate $eventsApplier,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CommandSubscriber $commandSubscriber,
CommandApplier $commandApplier,
EventSourcedAggregateRepository $aggregateRepository,
EventsApplierOnAggregate $eventsApplier,
EventMetadataFactory $eventMetadataFactory,
Function thenShouldFailWith
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function thenShouldFailWith($exceptionClass, $message = null)
{
$this->checkCommand($this->command);
try {
- 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
CommandSubscriber $commandSubscriber,
CommandApplier $commandApplier,
EventSourcedAggregateRepository $aggregateRepository,
EventsApplierOnAggregate $eventsApplier,
EventMetadataFactory $eventMetadataFactory,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CommandSubscriber $commandSubscriber,
CommandApplier $commandApplier,
EventSourcedAggregateRepository $aggregateRepository,
EventsApplierOnAggregate $eventsApplier,
EventMetadataFactory $eventMetadataFactory,
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$aggregateId,
string $aggregateClass,
\DateTimeImmutable $dateCreated,
$authenticatedUserId = null,
$commandMetadata = null
Method loadTemplate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function loadTemplate(string $content, string $templateClassName, string $templateNamespace, string $outputShortClassName, string $outputNamespace)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
EventStore $eventStore,
LoggerInterface $logger,
TailableEventStream $tailableEventStream,
ReadModelEventApplier $readModelEventApplier,
ReadModelReflector $readModelReflector