Showing 43 of 183 total issues
Function guard
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function guard(): string
{
if (! is_null($this->guard)) {
return $this->guard;
}
- 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 getMessages
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
protected function getMessages($noSort)
{
$messages = [];
foreach (array_merge(array_values(app('translation.loader')->namespaces()), [$this->sourcePath]) as $directory) {
- 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 render
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($request, Throwable $e)
{
if ($e instanceof TokenMismatchException) {
return intend([
'back' => true,
- Create a ticketCreate a ticket
Store
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Store extends BaseStore
{
/**
* Start the session, reading the data from a handler.
*
- Create a ticketCreate a ticket
Function render
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function render($request, Throwable $e)
{
if ($e instanceof TokenMismatchException) {
return intend([
'back' => true,
- 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
Accessarea
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Accessarea extends Model
{
use HasSlug;
use Taggable;
use Auditable;
- Create a ticketCreate a ticket
Function handle
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function handle($request, Closure $next)
{
$containers = $this->session->get($this->key, []);
if (count($containers) > 0) {
- 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 getMessages
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getMessages($noSort)
{
$messages = [];
foreach (array_merge(array_values(app('translation.loader')->namespaces()), [$this->sourcePath]) as $directory) {
- Create a ticketCreate a ticket
Method guard
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function guard(): string
{
if (! is_null($this->guard)) {
return $this->guard;
}
- Create a ticketCreate a ticket
Method run
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$accessAbilities = [
['name' => 'access-adminarea', 'title' => 'Access adminarea'],
];
- Create a ticketCreate a ticket
Method boot
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function boot(): void
{
// Fix the specified key was too long error
Schema::defaultStringLength(191);
- Create a ticketCreate a ticket
Method boot
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function boot()
{
$configPath = $this->app->basePath('vendor/barryvdh/laravel-debugbar/config/debugbar.php');
$this->publishes([$configPath => $this->getConfigPath()], 'config');
- Create a ticketCreate a ticket
Method replaceClasses
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function replaceClasses($stub, $model, $transformer = null): string
{
if ($transformer) {
$transformer = str_replace('/', '\\', $transformer);
- Create a ticketCreate a ticket
Function prepareAccessareaIds
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function prepareAccessareaIds($accessareas): array
{
// Convert collection to plain array
if ($accessareas instanceof BaseCollection && is_string($accessareas->first())) {
$accessareas = $accessareas->toArray();
- 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 getBuilderParameters
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getBuilderParameters(): array
{
$buttons = $this->getButtons();
return [
- Create a ticketCreate a ticket
Method bindBlueprintMacro
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function bindBlueprintMacro(): void
{
Blueprint::macro('auditable', function () {
$this->integer('created_by_id')->unsigned()->after('created_at')->nullable();
$this->string('created_by_type')->after('created_at')->nullable();
- Create a ticketCreate a ticket
Method query
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function query()
{
$model = app($this->model);
$currentUser = $this->request()->user();
$query = $model->query();
- Create a ticketCreate a ticket
Method morphToMany
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$related,
$name,
$table = null,
$foreignPivotKey = null,
$relatedPivotKey = null,
- Create a ticketCreate a ticket
Function commands
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function commands()
{
foreach (['module', 'extension'] as $moduleType) {
$resources = $this->app['files']->{"{$moduleType}Resources"}('src/Console/Commands', 'directories', 2);
$paths = array_filter(array_unique(collect($resources)->map->getPathname()->toArray()), fn ($path) => is_dir($path));
- 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 getCount
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getCount($model, $column, $value, $excludeId = null, $idColumn = null, array $extra = [])
- Create a ticketCreate a ticket