app/Http/Controllers/ShopController.php
Method success
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function success(Request $request, string $paymentCategory, int $countryCode, int $shopItem, int $paymentMethod)
Avoid unused parameters such as '$request'. Open
Open
public function success(Request $request, string $paymentCategory, int $countryCode, int $shopItem, int $paymentMethod)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$request'. Open
Open
public function getPurse(Request $request): JsonResponse
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
TODO found Open
Open
* @TODO: Need to Test if really works
- Exclude checks
TODO found Open
Open
* @TODO: User Purchase History will be coded on the Future
- Exclude checks
TODO found Open
Open
* @TODO: Code Business Logic
- Exclude checks
TODO found Open
Open
* @TODO: All Purchases of the CMS are Manually, so will be difficult track.
- Exclude checks
TODO found Open
Open
* @TODO: Probably Administrators will Manually Insert History Through HK
- Exclude checks
Avoid assigning values to variables in if clauses and the like (line '146', column '14'). Open
Open
public function redeem(Request $request): JsonResponse
{
if (($voucher = Voucher::where('code', $request->json()->get('voucherCode'))->first()) == null) {
return response()->json(null, 404);
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}