Showing 94 of 107 total issues
Function getNestedMessages
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getNestedMessages(Message $message, Schema $schema): array
{
$messages = [];
foreach ($schema->getFields() as $field) {
- 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 getItemKeyByEventId
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getItemKeyByEventId(Identifier $eventId, array $context = []): ?array
{
$tableName = $this->getTableNameForRead($context);
$params = [
'TableName' => $tableName,
- 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 deleteEvent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
final public function deleteEvent(Identifier $eventId, array $context = []): void
{
$context = $this->enrichContext(__FUNCTION__, $context);
$tableName = $this->getTableNameForWrite($context);
$key = $this->getItemKeyByEventId($eventId, $context);
- 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 applyDateFilters
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function applyDateFilters(Message $request, ParsedQuery $parsedQuery): void
{
$required = BoolOperator::REQUIRED;
$dateFilters = [
Method create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function create(string $content, string $aud, string $kid, string $secret, array $options = []): self
{
$header = [
'alg' => self::ALGO,
'typ' => 'JWT',
Function __construct
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(Pbjx $pbjx, array $streams = [])
{
$this->pbjx = $pbjx;
foreach ($streams as $streamId => $events) {
- 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 dispatch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function dispatch(Message $event, string $eventName): void
{
foreach ($this->dispatcher->getListeners($eventName) as $listener) {
try {
call_user_func($listener, $event, $this->pbjx);
- 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 copyContext
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function copyContext(Message $from, Message $to): static
{
if ($to->isFrozen()) {
return $this;
}
- 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 getStreamSlice
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getStreamSlice(StreamId $streamId, ?Microtime $since = null, int $count = 25, bool $forward = true, bool $consistent = false, array $context = []): StreamSlice;
Method getStreamSlice
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getStreamSlice(StreamId $streamId, ?Microtime $since = null, int $count = 25, bool $forward = true, bool $consistent = false, array $context = []): StreamSlice
Method getStreamSlice
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getStreamSlice(StreamId $streamId, ?Microtime $since = null, int $count = 25, bool $forward = true, bool $consistent = false, array $context = []): StreamSlice
Function checkClaims
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function checkClaims(): void
{
if (!is_array($this->header)) {
throw new InvalidArgumentException('PbjxToken header encoding is invalid.');
}
- 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
DynamoDbClient $dynamoDbClient,
string $tableName,
SfnClient $sfnClient,
string $stateMachineArn,
EventDispatcher $dispatcher,
Function getClient
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getClient(string $cluster = 'default'): Client
{
if (isset($this->clients[$cluster])) {
return $this->clients[$cluster];
}
- 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 getStreamSlice
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
final public function getStreamSlice(StreamId $streamId, ?Microtime $since = null, int $count = 25, bool $forward = true, bool $consistent = false, array $context = []): StreamSlice
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Pbjx $pbjx,
DynamoDbClient $client,
string $tableName,
EventDispatcher $dispatcher,
?LoggerInterface $logger = null
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(array $events = [], ?StreamId $streamId = null, bool $forward = true, bool $consistent = false, bool $hasMore = false)
Method create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function create(string $content, string $aud, string $kid, string $secret, array $options = []): self
Method trigger
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function trigger(Message $message, string $suffix, ?PbjxEvent $event = null, bool $recursive = true, bool $throw = true): static;
Method searchEvents
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function searchEvents(Message $request, ParsedQuery $parsedQuery, Message $response, array $curies = [], array $context = []): void;