Showing 94 of 107 total issues
Method updateNormalizers
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function updateNormalizers(Index $index, string $name): void
{
$settings = $index->getSettings();
$customNormalizers = $this->getCustomNormalizers();
$missingNormalizers = [];
Function getStreamSlice
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getStreamSlice(StreamId $streamId, ?Microtime $since = null, int $count = 25, bool $forward = true, bool $consistent = false, array $context = []): StreamSlice
{
$key = $streamId->toString();
if (!isset($this->streams[$key])) {
return new StreamSlice([], $streamId, $forward, $consistent, false);
- 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 cancelJobs
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cancelJobs(array $jobIds, array $context = []): void
{
$context = $this->enrichContext(__FUNCTION__, $context);
$tableName = $this->getTableName($context);
Method getClient
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getClient(string $cluster = 'default'): Client
{
if (isset($this->clients[$cluster])) {
return $this->clients[$cluster];
}
Method trigger
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function trigger(Message $message, string $suffix, ?PbjxEvent $event = null, bool $recursive = true, bool $throw = true): static
{
$suffix = '.' . trim($suffix, '.');
if ('.' === $suffix) {
throw new InvalidArgumentException('Trigger requires a non-empty suffix.');
Function startExecution
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function startExecution(
string $stateMachineArn,
int $timestamp,
string $jobId,
?string $tenantId = null
- 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 getEvent
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
final public function getEvent(Identifier $eventId, array $context = []): Message
{
$context = $this->enrichContext(__FUNCTION__, $context);
$tableName = $this->getTableNameForRead($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
Function putEvents
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
final public function putEvents(StreamId $streamId, array $events, ?string $expectedEtag = null, array $context = []): void
{
if (!count($events)) {
// ignore empty events array
return;
- 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 sendAt
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function sendAt(Message $command, int $timestamp, ?string $jobId = null, array $context = []): string
{
$context['causator'] = $command;
$context = $this->enrichContext(__FUNCTION__, $context);
$ttl = strtotime('+7 days', $timestamp);
- 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 vendorToHttp
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function vendorToHttp(Code $code = Code::OK): HttpCode
{
if (Code::OK === $code) {
return HttpCode::HTTP_OK;
}
Method createStorage
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public function createStorage(array $context = []): void
{
$context = $this->enrichContext(__FUNCTION__, $context);
if (isset($context['cluster'])) {
Method httpToVendor
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function httpToVendor(HttpCode $httpCode = HttpCode::HTTP_OK): Code
{
if ($httpCode->value < 400) {
return Code::OK;
}
Method deleteEvent
has 34 lines of code (exceeds 25 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);
Method describeStorage
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public function describeStorage(array $context = []): string
{
$context = $this->enrichContext(__FUNCTION__, $context);
if (isset($context['cluster'])) {
Method create
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create(DynamoDbClient $client, string $tableName): void
{
try {
$client->describeTable(['TableName' => $tableName]);
return;
Function describeStorage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
final public function describeStorage(array $context = []): string
{
$context = $this->enrichContext(__FUNCTION__, $context);
if (isset($context['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
Function createStorage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
final public function createStorage(array $context = []): void
{
$context = $this->enrichContext(__FUNCTION__, $context);
if (isset($context['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 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStreamSlice(StreamId $streamId, ?Microtime $since = null, int $count = 25, bool $forward = true, bool $consistent = false, array $context = []): StreamSlice
{
$key = $streamId->toString();
if (!isset($this->streams[$key])) {
return new StreamSlice([], $streamId, $forward, $consistent, false);
Method checkClaims
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkClaims(): void
{
if (!is_array($this->header)) {
throw new InvalidArgumentException('PbjxToken header encoding is invalid.');
}
Method copyContext
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function copyContext(Message $from, Message $to): static
{
if ($to->isFrozen()) {
return $this;
}