Showing 864 of 1,073 total issues
Method test
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function test(User $user, Post $post, Comment $comment, ChildUser $child): void
{
assertType('Illuminate\Database\Eloquent\Relations\HasOne<Illuminate\Types\Relations\Address, Illuminate\Types\Relations\User>', $user->address());
assertType('Illuminate\Types\Relations\Address|null', $user->address()->getResults());
assertType('Illuminate\Database\Eloquent\Collection<int, Illuminate\Types\Relations\Address>', $user->address()->get());
MailManager
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class MailManager implements FactoryContract
{
/**
* The application instance.
*
ResourceRegistrar
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class ResourceRegistrar
{
/**
* The router instance.
*
Kernel
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Kernel implements KernelContract
{
use InteractsWithTime;
/**
Sleep
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Sleep
{
use Macroable;
/**
File DynamoBatchRepository.php
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Illuminate\Bus;
use Aws\DynamoDb\DynamoDbClient;
File Kernel.php
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Illuminate\Foundation\Http;
use Carbon\CarbonInterval;
Repository
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Repository
{
use Conditionable, Macroable, SerializesModels;
/**
MessageBag
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class MessageBag implements Jsonable, JsonSerializable, MessageBagContract, MessageProvider, Stringable
{
/**
* All of the registered messages.
*
File DynamoDbStore.php
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Illuminate\Cache;
use Aws\DynamoDb\DynamoDbClient;
File BuildsQueries.php
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Illuminate\Database\Concerns;
use Illuminate\Container\Container;
MySqlGrammar
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class MySqlGrammar extends Grammar
{
/**
* The grammar specific operators.
*
SQLiteGrammar
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class SQLiteGrammar extends Grammar
{
/**
* All of the available clause operators.
*
File MakesHttpRequests.php
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Illuminate\Foundation\Testing\Concerns;
use Illuminate\Contracts\Http\Kernel as HttpKernel;
Function repeatEvents
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function repeatEvents($events)
{
$hasEnteredMaintenanceMode = false;
while (Date::now()->lte($this->startedAt->endOfMinute())) {
- 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 getFromLocalArray
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function getFromLocalArray($attribute, $lowerRule, $source = null)
{
$source = $source ?: $this->customMessages;
$keys = ["{$attribute}.{$lowerRule}", $lowerRule, $attribute];
- 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 GeneratorCommand.php
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Illuminate\Console;
use Illuminate\Console\Concerns\CreatesMatchingTest;
File AbstractPaginator.php
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Illuminate\Pagination;
use Closure;
Translator
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Translator extends NamespacedItemResolver implements TranslatorContract
{
use Macroable, ReflectsClosures;
/**
DocsCommand
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Open
#[AsCommand(name: 'docs')]
class DocsCommand extends Command
{
/**
* The name and signature of the console command.