+ class App\Http\Middleware\DumpJsonResponseTest
& `App\Exceptions\…
#170
Annotations
60 errors and 67 warnings
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#L25
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#L31
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#L31
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#L31
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#L42
GenerateBilibiliVote.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L63
GenerateBilibiliVote.php: method.notFound: Call to an undefined method App\Eloquent\Model\BilibiliVote::chunkInsertOnDuplicate().
|
runs-on (ubuntu-latest) / psalm
Process completed with exit code 2.
|
runs-on (ubuntu-latest) / phpmd:
tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L50
BaseQueryTest.php: The method testReOrderNestedPosts 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) / phan:
app/Eloquent/Model/Post/Post.php#L33
Post.php: PhanTypeMismatchReturnReal: Returning self::MODEL_CLASS_TO_TABLE_NAME_SUFFIX[$this::class] of type null but getTableNameSuffix() is declared to return string
|
runs-on (ubuntu-latest) / phan:
app/Exceptions/Handler.php#L16
Handler.php: PhanUndeclaredMethod: Call to undeclared method \Illuminate\Container\Container::json
|
runs-on (ubuntu-latest) / phan:
app/Helper.php#L94
Helper.php: PhanUndeclaredMethod: Call to undeclared method \Illuminate\Container\Container::json
|
runs-on (ubuntu-latest) / phan:
app/Helper.php#L100
Helper.php: PhanUndeclaredMethod: Call to undeclared method \Illuminate\Container\Container::withHeaders
|
runs-on (ubuntu-latest) / phan:
app/Http/Controllers/PostsQuery.php#L58
PostsQuery.php: PhanParamTooFew: Call with 0 arg(s) to \App\Http\PostsQuery\IndexQuery::__construct(\Barryvdh\Debugbar\LaravelDebugbar $debugbar, \App\Http\PostsQuery\CursorCodec $cursorCodec, int $perPageItems = 50) which requires 2 arg(s) defined at app/Http/PostsQuery/BaseQuery.php:36
|
runs-on (ubuntu-latest) / phan:
app/Http/PostsQuery/BaseQuery.php#L274
BaseQuery.php: PhanNonClassMethodCall: Call to method values on non-class type string
|
runs-on (ubuntu-latest) / phan:
app/Http/PostsQuery/BaseQuery.php#L279
BaseQuery.php: PhanNonClassMethodCall: Call to method filter on non-class type string
|
runs-on (ubuntu-latest) / phan:
app/Http/PostsQuery/BaseQuery.php#L288
BaseQuery.php: PhanNonClassMethodCall: Call to method first on non-class type string
|
runs-on (ubuntu-latest) / phan:
app/Http/PostsQuery/BaseQuery.php#L321
BaseQuery.php: PhanNonClassMethodCall: Call to method map on non-class type string
|
runs-on (ubuntu-latest) / phan:
app/Http/PostsQuery/BaseQuery.php#L327
BaseQuery.php: PhanNonClassMethodCall: Call to method sortBy on non-class type string
|
runs-on (windows-latest) / phpmd:
be/tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L50
BaseQueryTest.php: The method testReOrderNestedPosts 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#L25
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#L31
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#L31
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#L31
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#L42
GenerateBilibiliVote.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L63
GenerateBilibiliVote.php: method.notFound: Call to an undefined method App\Eloquent\Model\BilibiliVote::chunkInsertOnDuplicate().
|
runs-on (windows-latest) / phan:
app\Eloquent\Model\Post\Post.php#L33
Post.php: PhanTypeMismatchReturnReal: Returning self::MODEL_CLASS_TO_TABLE_NAME_SUFFIX[$this::class] of type null but getTableNameSuffix() is declared to return string
|
runs-on (windows-latest) / phan:
app\Exceptions\Handler.php#L16
Handler.php: PhanUndeclaredMethod: Call to undeclared method \Illuminate\Container\Container::json
|
runs-on (windows-latest) / phan:
app\Helper.php#L94
Helper.php: PhanUndeclaredMethod: Call to undeclared method \Illuminate\Container\Container::json
|
runs-on (windows-latest) / phan:
app\Helper.php#L100
Helper.php: PhanUndeclaredMethod: Call to undeclared method \Illuminate\Container\Container::withHeaders
|
runs-on (windows-latest) / phan:
app\Http\Controllers\PostsQuery.php#L58
PostsQuery.php: PhanParamTooFew: Call with 0 arg(s) to \App\Http\PostsQuery\IndexQuery::__construct(\Barryvdh\Debugbar\LaravelDebugbar $debugbar, \App\Http\PostsQuery\CursorCodec $cursorCodec, int $perPageItems = 50) which requires 2 arg(s) defined at app\Http\PostsQuery\BaseQuery.php:36
|
runs-on (windows-latest) / phan:
app\Http\PostsQuery\BaseQuery.php#L274
BaseQuery.php: PhanNonClassMethodCall: Call to method values on non-class type string
|
runs-on (windows-latest) / phan:
app\Http\PostsQuery\BaseQuery.php#L279
BaseQuery.php: PhanNonClassMethodCall: Call to method filter on non-class type string
|
runs-on (windows-latest) / phan:
app\Http\PostsQuery\BaseQuery.php#L288
BaseQuery.php: PhanNonClassMethodCall: Call to method first on non-class type string
|
runs-on (windows-latest) / phan:
app\Http\PostsQuery\BaseQuery.php#L321
BaseQuery.php: PhanNonClassMethodCall: Call to method map on non-class type string
|
runs-on (windows-latest) / phan:
app\Http\PostsQuery\BaseQuery.php#L327
BaseQuery.php: PhanNonClassMethodCall: Call to method sortBy on non-class type string
|
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#L25
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#L31
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#L31
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#L31
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#L42
GenerateBilibiliVote.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L63
GenerateBilibiliVote.php: method.notFound: Call to an undefined method App\Eloquent\Model\BilibiliVote::chunkInsertOnDuplicate().
|
runs-on (macos-latest) / phan
Process completed with exit code 1.
|
runs-on (macos-latest) / phpmd:
tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L50
BaseQueryTest.php: The method testReOrderNestedPosts 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/Controllers/PostsQuery.php#L18
PostsQuery.php: The class PostsQuery has a coupling between objects value of 13. 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#L55
BaseQueryTest.php: The method provideReOrderNestedPostsData() has 168 lines of code. Current threshold is set to 100. Avoid really long methods. (ExcessiveMethodLength, Code Size Rules)
|
runs-on (ubuntu-latest) / phan:
app/Console/Commands/BatchTableSQLGenerator.php#L9
BatchTableSQLGenerator.php: PhanUnreferencedClass: Possibly zero references to class \App\Console\Commands\BatchTableSQLGenerator
|
runs-on (ubuntu-latest) / phan:
app/Console/Commands/BatchTableSQLGenerator.php#L20
BatchTableSQLGenerator.php: PhanUnreferencedPublicMethod: Possibly zero references to public method \App\Console\Commands\BatchTableSQLGenerator::handle()
|
runs-on (ubuntu-latest) / phan:
app/Console/Commands/BatchTableSQLGenerator.php#L46
BatchTableSQLGenerator.php: PhanCoalescingNeverNull: Using non-null (($outputSQL . ' 影响行数:') . $affectedRows) of type string as the left hand side of a null coalescing (??) operation. The right hand side may be unnecessary.
|
runs-on (ubuntu-latest) / phan:
app/Console/Commands/BatchTableSQLGenerator.php#L46
BatchTableSQLGenerator.php: PhanPartialTypeMismatchArgument: Argument 1 ($string) is ((($outputSQL . ' 影响行数:') . $affectedRows) ?? 0) of type 0|string but \App\Console\Commands\BatchTableSQLGenerator::info() takes string (0 is incompatible) defined at vendor/laravel/framework/src/Illuminate/Console/Concerns/InteractsWithIO.php:289
|
runs-on (ubuntu-latest) / phan:
app/Console/Commands/BatchTableSQLGenerator.php#L46
BatchTableSQLGenerator.php: PhanTypeSuspiciousStringExpression: Suspicious type bool of a variable or expression $affectedRows used to build a string. (Expected type to be able to cast to a string)
|
runs-on (ubuntu-latest) / phan:
app/Console/Commands/GenerateBilibiliVote.php#L11
GenerateBilibiliVote.php: PhanUnreferencedClass: Possibly zero references to class \App\Console\Commands\GenerateBilibiliVote
|
runs-on (ubuntu-latest) / phan:
app/Console/Commands/GenerateBilibiliVote.php#L17
GenerateBilibiliVote.php: PhanUnreferencedPublicMethod: Possibly zero references to public method \App\Console\Commands\GenerateBilibiliVote::handle()
|
runs-on (ubuntu-latest) / phan:
app/Console/Commands/GenerateBilibiliVote.php#L28
GenerateBilibiliVote.php: PhanUnreferencedClosure: Possibly zero references to Closure(\Illuminate\Support\Collection $voteReplies)
|
runs-on (ubuntu-latest) / phan:
app/Console/Commands/GenerateBilibiliVote.php#L42
GenerateBilibiliVote.php: PhanCoalescingNeverNullInLoop: Using non-null \Safe\json_encode($voteReply['content']) of type string as the left hand side of a null coalescing (??) operation. The right hand side may be unnecessary. (in a loop body - this is likely a false positive)
|
runs-on (ubuntu-latest) / phan:
app/Console/Kernel.php#L8
Kernel.php: PhanUnreferencedClass: Possibly zero references to class \App\Console\Kernel
|
runs-on (windows-latest) / phpmd:
be/app/Http/Controllers/PostsQuery.php#L18
PostsQuery.php: The class PostsQuery has a coupling between objects value of 13. 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#L55
BaseQueryTest.php: The method provideReOrderNestedPostsData() has 168 lines of code. Current threshold is set to 100. Avoid really long methods. (ExcessiveMethodLength, Code Size Rules)
|
runs-on (windows-latest) / phan:
app\Console\Commands\BatchTableSQLGenerator.php#L9
BatchTableSQLGenerator.php: PhanUnreferencedClass: Possibly zero references to class \App\Console\Commands\BatchTableSQLGenerator
|
runs-on (windows-latest) / phan:
app\Console\Commands\BatchTableSQLGenerator.php#L20
BatchTableSQLGenerator.php: PhanUnreferencedPublicMethod: Possibly zero references to public method \App\Console\Commands\BatchTableSQLGenerator::handle()
|
runs-on (windows-latest) / phan:
app\Console\Commands\BatchTableSQLGenerator.php#L46
BatchTableSQLGenerator.php: PhanCoalescingNeverNull: Using non-null (($outputSQL . ' 影响行数:') . $affectedRows) of type string as the left hand side of a null coalescing (??) operation. The right hand side may be unnecessary.
|
runs-on (windows-latest) / phan:
app\Console\Commands\BatchTableSQLGenerator.php#L46
BatchTableSQLGenerator.php: PhanPartialTypeMismatchArgument: Argument 1 ($string) is ((($outputSQL . ' 影响行数:') . $affectedRows) ?? 0) of type 0|string but \App\Console\Commands\BatchTableSQLGenerator::info() takes string (0 is incompatible) defined at vendor\laravel\framework\src\Illuminate\Console\Concerns\InteractsWithIO.php:289
|
runs-on (windows-latest) / phan:
app\Console\Commands\BatchTableSQLGenerator.php#L46
BatchTableSQLGenerator.php: PhanTypeSuspiciousStringExpression: Suspicious type bool of a variable or expression $affectedRows used to build a string. (Expected type to be able to cast to a string)
|
runs-on (windows-latest) / phan:
app\Console\Commands\GenerateBilibiliVote.php#L11
GenerateBilibiliVote.php: PhanUnreferencedClass: Possibly zero references to class \App\Console\Commands\GenerateBilibiliVote
|
runs-on (windows-latest) / phan:
app\Console\Commands\GenerateBilibiliVote.php#L17
GenerateBilibiliVote.php: PhanUnreferencedPublicMethod: Possibly zero references to public method \App\Console\Commands\GenerateBilibiliVote::handle()
|
runs-on (windows-latest) / phan:
app\Console\Commands\GenerateBilibiliVote.php#L28
GenerateBilibiliVote.php: PhanUnreferencedClosure: Possibly zero references to Closure(\Illuminate\Support\Collection $voteReplies)
|
runs-on (windows-latest) / phan:
app\Console\Commands\GenerateBilibiliVote.php#L42
GenerateBilibiliVote.php: PhanCoalescingNeverNullInLoop: Using non-null \Safe\json_encode($voteReply['content']) of type string as the left hand side of a null coalescing (??) operation. The right hand side may be unnecessary. (in a loop body - this is likely a false positive)
|
runs-on (windows-latest) / phan:
app\Console\Kernel.php#L8
Kernel.php: PhanUnreferencedClass: Possibly zero references to class \App\Console\Kernel
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Exceptions/Handler.php#L19
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*/
protected function convertValidationExceptionToResponse(ValidationException $e, $request) : Response
{
- return $e->response ?? response()->json(['errorCode' => 40000, 'errorInfo' => $e->validator->getMessageBag()->getMessages()], 400);
+ return $e->response ?? response()->json(['errorCode' => 40000, 'errorInfo' => $e->validator->getMessageBag()->getMessages()], 399);
}
}
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Exceptions/Handler.php#L19
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
*/
protected function convertValidationExceptionToResponse(ValidationException $e, $request) : Response
{
- return $e->response ?? response()->json(['errorCode' => 40000, 'errorInfo' => $e->validator->getMessageBag()->getMessages()], 400);
+ return $e->response ?? response()->json(['errorCode' => 40000, 'errorInfo' => $e->validator->getMessageBag()->getMessages()], 401);
}
}
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Helper.php#L83
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
];
public static function abortAPI(int $errorCode) : never
{
- $statusCode = 0;
+ $statusCode = -1;
$errorInfo = null;
foreach (self::ERROR_STATUS_CODE_INFO as $infoStatusCode => $infoErrorInfo) {
if (\array_key_exists($errorCode, $infoErrorInfo)) {
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/Middleware/DumpJsonResponse.php#L15
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
public function handle(Request $request, \Closure $next) : Response
{
$response = $next($request);
- if ($response instanceof JsonResponse) {
+ if (true) {
if ($request->accepts('text/html')) {
$json = $response->content();
$jsonLength = mb_strlen($json);
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/Middleware/DumpJsonResponse.php#L18
Escaped Mutant for Mutator "MBString":
--- Original
+++ New
@@ @@
if ($response instanceof JsonResponse) {
if ($request->accepts('text/html')) {
$json = $response->content();
- $jsonLength = mb_strlen($json);
+ $jsonLength = strlen($json);
$assetsUrl = collect(['react-json-view', 'react', 'react-dom'])->mapWithKeys(fn($asset) => [$asset => url("/assets/{$asset}.js")]);
return response(<<<HTML
<h4>{$jsonLength} bytes</h4>
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L281
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 (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L33
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/CursorCodec.php#L40
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/CursorCodec.php#L75
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/CursorCodec.php#L82
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] : $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->all()));
}
}
|
runs-on (macos-latest) / phpmd:
app/Http/Controllers/PostsQuery.php#L18
PostsQuery.php: The class PostsQuery has a coupling between objects value of 13. 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#L55
BaseQueryTest.php: The method provideReOrderNestedPostsData() 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/Exceptions/Handler.php#L19
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*/
protected function convertValidationExceptionToResponse(ValidationException $e, $request) : Response
{
- return $e->response ?? response()->json(['errorCode' => 40000, 'errorInfo' => $e->validator->getMessageBag()->getMessages()], 400);
+ return $e->response ?? response()->json(['errorCode' => 40000, 'errorInfo' => $e->validator->getMessageBag()->getMessages()], 399);
}
}
|
runs-on (windows-latest) / phpunit-infection:
be/app/Exceptions/Handler.php#L19
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
*/
protected function convertValidationExceptionToResponse(ValidationException $e, $request) : Response
{
- return $e->response ?? response()->json(['errorCode' => 40000, 'errorInfo' => $e->validator->getMessageBag()->getMessages()], 400);
+ return $e->response ?? response()->json(['errorCode' => 40000, 'errorInfo' => $e->validator->getMessageBag()->getMessages()], 401);
}
}
|
runs-on (windows-latest) / phpunit-infection:
be/app/Helper.php#L83
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
];
public static function abortAPI(int $errorCode) : never
{
- $statusCode = 0;
+ $statusCode = -1;
$errorInfo = null;
foreach (self::ERROR_STATUS_CODE_INFO as $infoStatusCode => $infoErrorInfo) {
if (\array_key_exists($errorCode, $infoErrorInfo)) {
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/Middleware/DumpJsonResponse.php#L15
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
public function handle(Request $request, \Closure $next) : Response
{
$response = $next($request);
- if ($response instanceof JsonResponse) {
+ if (true) {
if ($request->accepts('text/html')) {
$json = $response->content();
$jsonLength = mb_strlen($json);
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/Middleware/DumpJsonResponse.php#L18
Escaped Mutant for Mutator "MBString":
--- Original
+++ New
@@ @@
if ($response instanceof JsonResponse) {
if ($request->accepts('text/html')) {
$json = $response->content();
- $jsonLength = mb_strlen($json);
+ $jsonLength = strlen($json);
$assetsUrl = collect(['react-json-view', 'react', 'react-dom'])->mapWithKeys(fn($asset) => [$asset => url("/assets/{$asset}.js")]);
return response(<<<HTML
<h4>{$jsonLength} bytes</h4>
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L281
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) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L33
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/CursorCodec.php#L40
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/CursorCodec.php#L75
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/CursorCodec.php#L82
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] : $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->all()));
}
}
|
runs-on (macos-latest) / phpunit-infection:
be/app/Exceptions/Handler.php#L19
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*/
protected function convertValidationExceptionToResponse(ValidationException $e, $request) : Response
{
- return $e->response ?? response()->json(['errorCode' => 40000, 'errorInfo' => $e->validator->getMessageBag()->getMessages()], 400);
+ return $e->response ?? response()->json(['errorCode' => 40000, 'errorInfo' => $e->validator->getMessageBag()->getMessages()], 399);
}
}
|
runs-on (macos-latest) / phpunit-infection:
be/app/Exceptions/Handler.php#L19
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
*/
protected function convertValidationExceptionToResponse(ValidationException $e, $request) : Response
{
- return $e->response ?? response()->json(['errorCode' => 40000, 'errorInfo' => $e->validator->getMessageBag()->getMessages()], 400);
+ return $e->response ?? response()->json(['errorCode' => 40000, 'errorInfo' => $e->validator->getMessageBag()->getMessages()], 401);
}
}
|
runs-on (macos-latest) / phpunit-infection:
be/app/Helper.php#L83
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
];
public static function abortAPI(int $errorCode) : never
{
- $statusCode = 0;
+ $statusCode = -1;
$errorInfo = null;
foreach (self::ERROR_STATUS_CODE_INFO as $infoStatusCode => $infoErrorInfo) {
if (\array_key_exists($errorCode, $infoErrorInfo)) {
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/Middleware/DumpJsonResponse.php#L15
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
public function handle(Request $request, \Closure $next) : Response
{
$response = $next($request);
- if ($response instanceof JsonResponse) {
+ if (true) {
if ($request->accepts('text/html')) {
$json = $response->content();
$jsonLength = mb_strlen($json);
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/Middleware/DumpJsonResponse.php#L18
Escaped Mutant for Mutator "MBString":
--- Original
+++ New
@@ @@
if ($response instanceof JsonResponse) {
if ($request->accepts('text/html')) {
$json = $response->content();
- $jsonLength = mb_strlen($json);
+ $jsonLength = strlen($json);
$assetsUrl = collect(['react-json-view', 'react', 'react-dom'])->mapWithKeys(fn($asset) => [$asset => url("/assets/{$asset}.js")]);
return response(<<<HTML
<h4>{$jsonLength} bytes</h4>
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L281
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/CursorCodec.php#L33
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/CursorCodec.php#L40
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/CursorCodec.php#L75
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/CursorCodec.php#L82
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] : $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->all()));
}
}
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
coverage-macos-latest
Expired
|
5.58 KB |
|
coverage-ubuntu-latest
Expired
|
5.58 KB |
|
coverage-windows-latest
Expired
|
5.51 KB |
|