* replace $firstKeyFromTableFilterByTrue()
with match(true)
expr …
#126
Annotations
39 errors and 35 warnings
runs-on (ubuntu-latest) / phpmd:
tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L52
BaseQueryTest.php: The method reOrderNestedPosts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (ElseExpression, Clean Code Rules)
|
runs-on (ubuntu-latest) / phpmd
Process completed with exit code 2.
|
runs-on (ubuntu-latest) / psalm
Process completed with exit code 2.
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L37
BatchTableSQLGenerator.php: property.notFound: Access to an undefined property App\Eloquent\Model\Forum::$fid.
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L38
BatchTableSQLGenerator.php: argument.type: Parameter #3 $subject of function str_replace expects array|string, mixed given.
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L45
BatchTableSQLGenerator.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Connection::statement().
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L46
BatchTableSQLGenerator.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L26
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\Post\Reply>::whereBetween().
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L32
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::groupBy().
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L32
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::selectRaw().
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L32
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::whereIn().
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L43
GenerateBilibiliVote.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L43
GenerateBilibiliVote.php: argument.type: Parameter #1 $value of static method App\Helper::jsonEncode() expects string, mixed given.
|
runs-on (windows-latest) / phpmd:
be/tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L52
BaseQueryTest.php: The method reOrderNestedPosts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (ElseExpression, Clean Code Rules)
|
runs-on (windows-latest) / phpmd
Process completed with exit code 2.
|
runs-on (windows-latest) / psalm
Process completed with exit code 127.
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L37
BatchTableSQLGenerator.php: property.notFound: Access to an undefined property App\Eloquent\Model\Forum::$fid.
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L38
BatchTableSQLGenerator.php: argument.type: Parameter #3 $subject of function str_replace expects array|string, mixed given.
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L45
BatchTableSQLGenerator.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Connection::statement().
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L46
BatchTableSQLGenerator.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L26
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\Post\Reply>::whereBetween().
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L32
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::groupBy().
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L32
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::selectRaw().
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L32
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::whereIn().
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L43
GenerateBilibiliVote.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L43
GenerateBilibiliVote.php: argument.type: Parameter #1 $value of static method App\Helper::jsonEncode() expects string, mixed given.
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L37
BatchTableSQLGenerator.php: property.notFound: Access to an undefined property App\Eloquent\Model\Forum::$fid.
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L38
BatchTableSQLGenerator.php: argument.type: Parameter #3 $subject of function str_replace expects array|string, mixed given.
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L45
BatchTableSQLGenerator.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Connection::statement().
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L46
BatchTableSQLGenerator.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L26
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\Post\Reply>::whereBetween().
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L32
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::groupBy().
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L32
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::selectRaw().
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L32
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::whereIn().
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L43
GenerateBilibiliVote.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L43
GenerateBilibiliVote.php: argument.type: Parameter #1 $value of static method App\Helper::jsonEncode() expects string, mixed given.
|
runs-on (macos-latest) / phpmd:
tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L52
BaseQueryTest.php: The method reOrderNestedPosts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (ElseExpression, Clean Code Rules)
|
runs-on (macos-latest) / phpmd
Process completed with exit code 2.
|
runs-on (macos-latest) / psalm
Process completed with exit code 2.
|
runs-on (ubuntu-latest) / phpmd:
app/Http/PostsQuery/BaseQuery.php#L19
BaseQuery.php: The class BaseQuery has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13. (CouplingBetweenObjects, Design Rules)
|
runs-on (ubuntu-latest) / phpmd:
app/Http/PostsQuery/IndexQuery.php#L17
IndexQuery.php: The method query() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. (CyclomaticComplexity, Code Size Rules)
|
runs-on (ubuntu-latest) / phpmd:
app/Http/PostsQuery/IndexQuery.php#L17
IndexQuery.php: The method query() has an NPath complexity of 400. The configured NPath complexity threshold is 200. (NPathComplexity, Code Size Rules)
|
runs-on (ubuntu-latest) / phpmd:
app/Http/PostsQuery/SearchQuery.php#L53
SearchQuery.php: The method applyQueryParamsOnQuery() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. (CyclomaticComplexity, Code Size Rules)
|
runs-on (ubuntu-latest) / phpmd:
tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L57
BaseQueryTest.php: The method reOrderNestedPostsDataProvider() has 168 lines of code. Current threshold is set to 100. Avoid really long methods. (ExcessiveMethodLength, Code Size Rules)
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L135
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
return '0';
}
$prefix = match (true) {
- \is_int($cursor) && $cursor < 0 => '-',
+ \is_int($cursor) && $cursor <= 0 => '-',
\is_string($cursor) => 'S',
default => '',
};
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L142
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
--- Original
+++ New
@@ @@
\is_string($cursor) => 'S',
default => '',
};
- $value = \is_int($cursor) ? rtrim(pack('P', $cursor), $cursor >= 0 ? "\x00" : "\xff") : ($prefix === 'S' ? $cursor : throw new \RuntimeException('Invalid cursor value'));
+ $value = \is_int($cursor) ? rtrim(pack('P', $cursor), $cursor > 0 ? "\x00" : "\xff") : ($prefix === 'S' ? $cursor : throw new \RuntimeException('Invalid cursor value'));
if ($prefix !== 'S') {
// https://en.wikipedia.org/wiki/Base64#URL_applications
$value = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($value));
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L177
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
* @var string $cursor
* @var string $prefix
*/
- [$prefix, $cursor] = array_pad(explode(':', $encodedCursor), 2, null);
+ [$prefix, $cursor] = array_pad(explode(':', $encodedCursor), 3, null);
if ($cursor === null) {
// no prefix being provided means the value of cursor is a positive int
$cursor = $prefix;
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L184
Escaped Mutant for Mutator "CastArray":
--- Original
+++ New
@@ @@
// keep 0 as is
'S' => $cursor,
// string literal is not base64 encoded
- default => ((array) unpack(format: 'P', string: str_pad(
+ default => unpack(format: 'P', string: str_pad(
// re-add removed trailing 0x00 or 0xFF
base64_decode(
// https://en.wikipedia.org/wiki/Base64#URL_applications
@@ @@
),
length: 8,
pad_string: $prefix === '-' ? "\xff" : "\x00"
- )))[1],
+ ))[1],
};
})->chunk(2)->map(static fn(Collection $i) => $i->values()))->mapWithKeys(fn(Collection $cursors, string $postType) => [$postType => $cursors->mapWithKeys(fn(int|string|null $cursor, int $index) => [$index === 0 ? Helper::POST_TYPE_TO_ID[$postType] : $this->orderByField => $cursor])])->reject(static fn(Collection $cursors) => $cursors->every(static fn(int|string|null $cursor) => $cursor === null))->map(static fn(Collection $cursors) => new Cursor($cursors->toArray()));
}
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L192
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
// https://en.wikipedia.org/wiki/Base64#URL_applications
str_replace(['-', '_'], ['+', '/'], $cursor)
),
- length: 8,
+ length: 9,
pad_string: $prefix === '-' ? "\xff" : "\x00"
)))[1],
};
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L375
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
// use the topmost value between sorting key or value of orderBy field within its child posts
$curAndChildSortingKeys = collect([
// value of orderBy field in the first sorted child post that isMatchQuery after previous sorting
- $childPosts->filter(static fn(Collection $p) => ($p['isMatchQuery'] ?? true) === true)->first()[$this->orderByField] ?? null,
+ $childPosts->filter(static fn(Collection $p) => (true ?? $p['isMatchQuery']) === true)->first()[$this->orderByField] ?? null,
// sorting key from the first sorted child posts
// not requiring isMatchQuery since a child post without isMatchQuery
// might have its own child posts with isMatchQuery
|
runs-on (windows-latest) / phpmd:
be/app/Http/PostsQuery/BaseQuery.php#L19
BaseQuery.php: The class BaseQuery has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13. (CouplingBetweenObjects, Design Rules)
|
runs-on (windows-latest) / phpmd:
be/app/Http/PostsQuery/IndexQuery.php#L17
IndexQuery.php: The method query() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. (CyclomaticComplexity, Code Size Rules)
|
runs-on (windows-latest) / phpmd:
be/app/Http/PostsQuery/IndexQuery.php#L17
IndexQuery.php: The method query() has an NPath complexity of 400. The configured NPath complexity threshold is 200. (NPathComplexity, Code Size Rules)
|
runs-on (windows-latest) / phpmd:
be/app/Http/PostsQuery/SearchQuery.php#L53
SearchQuery.php: The method applyQueryParamsOnQuery() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. (CyclomaticComplexity, Code Size Rules)
|
runs-on (windows-latest) / phpmd:
be/tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L57
BaseQueryTest.php: The method reOrderNestedPostsDataProvider() has 168 lines of code. Current threshold is set to 100. Avoid really long methods. (ExcessiveMethodLength, Code Size Rules)
|
runs-on (windows-latest) / phpunit-infection
JIT is incompatible with third party extensions that override zend_execute_ex(). JIT disabled.
|
runs-on (windows-latest) / phpunit-infection
JIT is incompatible with third party extensions that override zend_execute_ex(). JIT disabled.
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L135
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
return '0';
}
$prefix = match (true) {
- \is_int($cursor) && $cursor < 0 => '-',
+ \is_int($cursor) && $cursor <= 0 => '-',
\is_string($cursor) => 'S',
default => '',
};
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L142
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
--- Original
+++ New
@@ @@
\is_string($cursor) => 'S',
default => '',
};
- $value = \is_int($cursor) ? rtrim(pack('P', $cursor), $cursor >= 0 ? "\x00" : "\xff") : ($prefix === 'S' ? $cursor : throw new \RuntimeException('Invalid cursor value'));
+ $value = \is_int($cursor) ? rtrim(pack('P', $cursor), $cursor > 0 ? "\x00" : "\xff") : ($prefix === 'S' ? $cursor : throw new \RuntimeException('Invalid cursor value'));
if ($prefix !== 'S') {
// https://en.wikipedia.org/wiki/Base64#URL_applications
$value = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($value));
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L177
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
* @var string $cursor
* @var string $prefix
*/
- [$prefix, $cursor] = array_pad(explode(':', $encodedCursor), 2, null);
+ [$prefix, $cursor] = array_pad(explode(':', $encodedCursor), 3, null);
if ($cursor === null) {
// no prefix being provided means the value of cursor is a positive int
$cursor = $prefix;
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L184
Escaped Mutant for Mutator "CastArray":
--- Original
+++ New
@@ @@
// keep 0 as is
'S' => $cursor,
// string literal is not base64 encoded
- default => ((array) unpack(format: 'P', string: str_pad(
+ default => unpack(format: 'P', string: str_pad(
// re-add removed trailing 0x00 or 0xFF
base64_decode(
// https://en.wikipedia.org/wiki/Base64#URL_applications
@@ @@
),
length: 8,
pad_string: $prefix === '-' ? "\xff" : "\x00"
- )))[1],
+ ))[1],
};
})->chunk(2)->map(static fn(Collection $i) => $i->values()))->mapWithKeys(fn(Collection $cursors, string $postType) => [$postType => $cursors->mapWithKeys(fn(int|string|null $cursor, int $index) => [$index === 0 ? Helper::POST_TYPE_TO_ID[$postType] : $this->orderByField => $cursor])])->reject(static fn(Collection $cursors) => $cursors->every(static fn(int|string|null $cursor) => $cursor === null))->map(static fn(Collection $cursors) => new Cursor($cursors->toArray()));
}
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L192
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
// https://en.wikipedia.org/wiki/Base64#URL_applications
str_replace(['-', '_'], ['+', '/'], $cursor)
),
- length: 8,
+ length: 9,
pad_string: $prefix === '-' ? "\xff" : "\x00"
)))[1],
};
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L375
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
// use the topmost value between sorting key or value of orderBy field within its child posts
$curAndChildSortingKeys = collect([
// value of orderBy field in the first sorted child post that isMatchQuery after previous sorting
- $childPosts->filter(static fn(Collection $p) => ($p['isMatchQuery'] ?? true) === true)->first()[$this->orderByField] ?? null,
+ $childPosts->filter(static fn(Collection $p) => (true ?? $p['isMatchQuery']) === true)->first()[$this->orderByField] ?? null,
// sorting key from the first sorted child posts
// not requiring isMatchQuery since a child post without isMatchQuery
// might have its own child posts with isMatchQuery
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L135
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
return '0';
}
$prefix = match (true) {
- \is_int($cursor) && $cursor < 0 => '-',
+ \is_int($cursor) && $cursor <= 0 => '-',
\is_string($cursor) => 'S',
default => '',
};
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L142
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
--- Original
+++ New
@@ @@
\is_string($cursor) => 'S',
default => '',
};
- $value = \is_int($cursor) ? rtrim(pack('P', $cursor), $cursor >= 0 ? "\x00" : "\xff") : ($prefix === 'S' ? $cursor : throw new \RuntimeException('Invalid cursor value'));
+ $value = \is_int($cursor) ? rtrim(pack('P', $cursor), $cursor > 0 ? "\x00" : "\xff") : ($prefix === 'S' ? $cursor : throw new \RuntimeException('Invalid cursor value'));
if ($prefix !== 'S') {
// https://en.wikipedia.org/wiki/Base64#URL_applications
$value = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($value));
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L177
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
* @var string $cursor
* @var string $prefix
*/
- [$prefix, $cursor] = array_pad(explode(':', $encodedCursor), 2, null);
+ [$prefix, $cursor] = array_pad(explode(':', $encodedCursor), 3, null);
if ($cursor === null) {
// no prefix being provided means the value of cursor is a positive int
$cursor = $prefix;
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L184
Escaped Mutant for Mutator "CastArray":
--- Original
+++ New
@@ @@
// keep 0 as is
'S' => $cursor,
// string literal is not base64 encoded
- default => ((array) unpack(format: 'P', string: str_pad(
+ default => unpack(format: 'P', string: str_pad(
// re-add removed trailing 0x00 or 0xFF
base64_decode(
// https://en.wikipedia.org/wiki/Base64#URL_applications
@@ @@
),
length: 8,
pad_string: $prefix === '-' ? "\xff" : "\x00"
- )))[1],
+ ))[1],
};
})->chunk(2)->map(static fn(Collection $i) => $i->values()))->mapWithKeys(fn(Collection $cursors, string $postType) => [$postType => $cursors->mapWithKeys(fn(int|string|null $cursor, int $index) => [$index === 0 ? Helper::POST_TYPE_TO_ID[$postType] : $this->orderByField => $cursor])])->reject(static fn(Collection $cursors) => $cursors->every(static fn(int|string|null $cursor) => $cursor === null))->map(static fn(Collection $cursors) => new Cursor($cursors->toArray()));
}
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L192
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
// https://en.wikipedia.org/wiki/Base64#URL_applications
str_replace(['-', '_'], ['+', '/'], $cursor)
),
- length: 8,
+ length: 9,
pad_string: $prefix === '-' ? "\xff" : "\x00"
)))[1],
};
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L375
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
// use the topmost value between sorting key or value of orderBy field within its child posts
$curAndChildSortingKeys = collect([
// value of orderBy field in the first sorted child post that isMatchQuery after previous sorting
- $childPosts->filter(static fn(Collection $p) => ($p['isMatchQuery'] ?? true) === true)->first()[$this->orderByField] ?? null,
+ $childPosts->filter(static fn(Collection $p) => (true ?? $p['isMatchQuery']) === true)->first()[$this->orderByField] ?? null,
// sorting key from the first sorted child posts
// not requiring isMatchQuery since a child post without isMatchQuery
// might have its own child posts with isMatchQuery
|
runs-on (macos-latest) / phpmd:
app/Http/PostsQuery/BaseQuery.php#L19
BaseQuery.php: The class BaseQuery has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13. (CouplingBetweenObjects, Design Rules)
|
runs-on (macos-latest) / phpmd:
app/Http/PostsQuery/IndexQuery.php#L17
IndexQuery.php: The method query() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. (CyclomaticComplexity, Code Size Rules)
|
runs-on (macos-latest) / phpmd:
app/Http/PostsQuery/IndexQuery.php#L17
IndexQuery.php: The method query() has an NPath complexity of 400. The configured NPath complexity threshold is 200. (NPathComplexity, Code Size Rules)
|
runs-on (macos-latest) / phpmd:
app/Http/PostsQuery/SearchQuery.php#L53
SearchQuery.php: The method applyQueryParamsOnQuery() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. (CyclomaticComplexity, Code Size Rules)
|
runs-on (macos-latest) / phpmd:
tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L57
BaseQueryTest.php: The method reOrderNestedPostsDataProvider() has 168 lines of code. Current threshold is set to 100. Avoid really long methods. (ExcessiveMethodLength, Code Size Rules)
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
coverage-macos-latest
|
5.2 KB |
|
coverage-ubuntu-latest
|
5.2 KB |
|
coverage-windows-latest
|
5.12 KB |
|