xprt64/cqrs-es

View on GitHub

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) {
Severity: Minor
Found in src/Dudulina/Saga/SagasOnlyOnceEventDispatcher.php - About 2 hrs 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

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) {
Severity: Minor
Found in src/Dudulina/Saga/SagasOnlyOnceEventDispatcher.php - About 1 hr to fix

    Method thenShouldFailWith has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function thenShouldFailWith($exceptionClass, $message = null)
        {
            $this->checkCommand($this->command);
    
            try {
    Severity: Minor
    Found in src/Dudulina/Testing/BddAggregateTestHelper.php - About 1 hr to fix

      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) {
      Severity: Minor
      Found in src/Dudulina/Testing/EventStore/InMemory/InMemoryEventStore.php - About 1 hr 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 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();
      Severity: Minor
      Found in src/Dudulina/Saga/SagaRunner.php - About 1 hr 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

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

              CommandSubscriber $commandSubscriber,
              CommandApplier $commandApplier,
              AggregateRepository $aggregateRepository,
              ConcurrentProofFunctionCaller $functionCaller,
              EventsApplierOnAggregate $eventsApplier,
      Severity: Major
      Found in src/Dudulina/Command/CommandDispatcher/DefaultCommandDispatcher.php - About 1 hr to fix

        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 {
          Severity: Minor
          Found in src/Dudulina/Testing/BddAggregateTestHelper.php - About 45 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

          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,
            Severity: Minor
            Found in src/Dudulina/Command/CommandTester/DefaultCommandTester.php - About 45 mins to fix

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

                      $aggregateId,
                      string $aggregateClass,
                      \DateTimeImmutable $dateCreated,
                      $authenticatedUserId = null,
                      $commandMetadata = null
              Severity: Minor
              Found in src/Dudulina/Event/MetaData.php - About 35 mins to fix

                Method loadTemplate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function loadTemplate(string $content, string $templateClassName, string $templateNamespace, string $outputShortClassName, string $outputNamespace)
                Severity: Minor
                Found in src/Dudulina/CodeGeneration/TemplateLoader.php - About 35 mins to fix

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

                          EventStore $eventStore,
                          LoggerInterface $logger,
                          TailableEventStream $tailableEventStream,
                          ReadModelEventApplier $readModelEventApplier,
                          ReadModelReflector $readModelReflector
                  Severity: Minor
                  Found in src/Dudulina/ReadModel/ReadModelTail.php - About 35 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language