Showing 28 of 390 total issues
Method buildStatements
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function buildStatements(Service $service, HumanResource $humanResource, $weekdays, $startAt, $finishAt, $timezone)
- Create a ticketCreate a ticket
Function store
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function store(Business $business, Request $request)
{
logger()->info(__METHOD__);
logger()->info(sprintf('businessId:%s', $business->id));
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid too many return
statements within this method. Open
return redirect()->route('user.agenda', '#'.$appointment->code);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return view('guest.appointment.show', compact('appointment'));
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return redirect()->route('manager.business.agenda.index', compact('business'));
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return $this->value;
- Create a ticketCreate a ticket
Function value
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function value()
{
switch ($this->type) {
case 'string':
return (string) $this->value;
- Read upRead up
- Create a ticketCreate a ticket
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 cast
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function cast($value, $type)
{
switch ($type) {
case 'bool':
$value = boolval($value);
- Read upRead up
- Create a ticketCreate a ticket
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"