app/Http/Controllers/Platform/UrlController.php
Method store
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Wontfix
Wontfix
public function store(Request $request)
{
$user = $request->user();
$attributes = $this->getValidationFactory()->make(
$request->all(),
- Create a ticketCreate a ticket
File UrlController.php
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace App\Http\Controllers\Platform;
use App\Entities\Domain;
- Create a ticketCreate a ticket
Function store
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
public function store(Request $request)
{
$user = $request->user();
$attributes = $this->getValidationFactory()->make(
$request->all(),
- 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
Method update
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function update(Request $request, Url $url)
{
$this->authorize('update', $url);
$attributes = $this->validate(
- Create a ticketCreate a ticket
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
SimpleDbClient $simpleDbClient,
EntityManagerInterface $entityManager,
UrlRepository $urlRepository,
DomainRepository $domainRepository,
OrganizationRepository $organizationRepository,
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return redirect()->route('platform.urls.index')
->with('success', 'URL created.');
- Create a ticketCreate a ticket