Function readBooking
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
private function readBooking(array $request, $order, $booking, $delivering)
{
$param = $this->handlingParam($delivering);
if (isset($request['notes_' . $order->id])) {
- 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
File BookingsService.php
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Services;
use Illuminate\Support\Collection;
Function handlePreProcess
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function handlePreProcess($request, $booking)
{
$manual_total = $this->deliveringManualTotal($request, $booking->order);
if ($manual_total > 0) {
$booking->enforceTotal($manual_total);
- 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 readVariants
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function readVariants($product, $booked, $values, $quantities, $delivering)
{
$param = $this->handlingParam($delivering);
$quantity = 0;
$saved_variants = [];
- 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 readBooking
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readBooking(array $request, $order, $booking, $delivering)
{
$param = $this->handlingParam($delivering);
if (isset($request['notes_' . $order->id])) {
Method readVariants
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readVariants($product, $booked, $values, $quantities, $delivering)
{
$param = $this->handlingParam($delivering);
$quantity = 0;
$saved_variants = [];
Function testAccess
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function testAccess($target, $orders, $delivering)
{
$user = Auth::user();
$valid = 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 readVariants
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function readVariants($product, $booked, $values, $quantities, $delivering)
Method handleBookingUpdate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function handleBookingUpdate($request, $user, $order, $target_user, $delivering)