codeavor/QR-Order-BackEnd

View on GitHub

Showing 4 of 4 total issues

Function returnOrders has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

public function returnOrders()
{
$finorder = collect();
$orders = Order::orderBy('updated_at')->get();
// edo sto order kano order by updated at decented
Severity: Minor
Found in app/Traits/KitchenTrait.php - About 55 mins to fix

Function register has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

public function register(Request $request)
{
$role = '';
$validator = Validator::make($request->all(), [
'umbrella_id' => 'required',
Severity: Minor
Found in app/Http/Controllers/Auth/AuthController.php - About 35 mins to fix

Avoid too many return statements within this method.
Open

return response()->json(['error'=>'Invalid Login Details'], 401);
Severity: Major
Found in app/Http/Controllers/Auth/AuthController.php - About 30 mins to fix

    Function refactorCart has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    public function refactorCart($order)
    {
    $items = $order->items;
    $cart = OrderItem::with('extras')->where('order_id', '=', $order->id)->get();
    // Get each order item {"id":1,"name":"Espresso","price":"1","category_id":1,"description":null,"pivot":{"order_id":8,"item_id":1,"quantity":2,"notes":"geia"}}
    Severity: Minor
    Found in app/Traits/CartTrait.php - About 25 mins to fix
    Severity
    Category
    Status
    Source
    Language