Showing 864 of 1,073 total issues
Method displayForCli
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function displayForCli(array $data)
{
[$table, $columns, $indexes, $foreignKeys] = [
$data['table'], $data['columns'], $data['indexes'], $data['foreign_keys'],
];
Method castUsing
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function castUsing(array $arguments)
{
return new class($arguments) implements CastsAttributes
{
protected $arguments;
Method withoutExceptionHandling
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function withoutExceptionHandling(array $except = [])
{
if ($this->originalExceptionHandler == null) {
$currentExceptionHandler = app(ExceptionHandler::class);
Method gatherApplicationInformation
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function gatherApplicationInformation()
{
self::$data = [];
$formatEnabledStatus = fn ($value) => $value ? '<fg=yellow;options=bold>ENABLED</>' : 'OFF';
Method defaultAliases
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function defaultAliases()
{
return collect([
'App' => App::class,
'Arr' => Arr::class,
Method test
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function test(Builder $query, EloquentBuilder $userQuery): void
{
assertType('object|null', $query->first());
assertType('object|null', $query->find(1));
assertType('int|object', $query->findOr(1, fn () => 42));
Method doSend
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function doSend(SentMessage $message): void
{
$email = MessageConverter::toEmail($message->getOriginalMessage());
$envelope = $message->getEnvelope();
Method registerCoreContainerAliases
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function registerCoreContainerAliases()
{
foreach ([
'app' => [self::class, \Illuminate\Contracts\Container\Container::class, \Illuminate\Contracts\Foundation\Application::class, \Psr\Container\ContainerInterface::class],
'auth' => [\Illuminate\Auth\AuthManager::class, \Illuminate\Contracts\Auth\Factory::class],
Function assertStructure
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function assertStructure(?array $structure = null, $responseData = null, bool $exact = false)
{
if (is_null($structure)) {
return $this->assertSimilar($this->decoded);
}
- 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 fill
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function fill(array $attributes)
{
$totallyGuarded = $this->totallyGuarded();
$fillable = $this->fillableFromArray($attributes);
- 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 chunk
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function chunk($size)
{
if ($size <= 0) {
return static::empty();
}
- 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 only
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function only($keys)
{
if ($keys instanceof Enumerable) {
$keys = $keys->all();
} elseif (! is_null($keys)) {
- 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 handle
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
if ($this->option('passport')) {
$this->installPassport();
} else {
- 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 __serialize
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function __serialize()
{
$values = [];
$reflectionClass = new ReflectionClass($this);
- 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 getAttributesFromAttributeString
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getAttributesFromAttributeString(string $attributeString)
{
$attributeString = $this->parseShortAttributeSyntax($attributeString);
$attributeString = $this->parseAttributeBag($attributeString);
$attributeString = $this->parseComponentTagClassStatements($attributeString);
Method doSend
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function doSend(SentMessage $message): void
{
$options = $this->options;
if ($message->getOriginalMessage() instanceof Message) {
Method listEvent
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function listEvent($event, $terminalWidth, $expressionSpacing, $repeatExpressionSpacing, $timezone)
{
$expression = $this->formatCronExpression($event->expression, $expressionSpacing);
$repeatExpression = str_pad($this->getRepeatExpression($event), $repeatExpressionSpacing);
Method resolveDumpSource
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resolveDumpSource()
{
if (static::$dumpSourceResolver === false) {
return null;
}
Method data_set
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function data_set(&$target, $key, $value, $overwrite = true)
{
$segments = is_array($key) ? $key : explode('.', $key);
if (($segment = array_shift($segments)) === '*') {
Method buildRoutingCallback
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function buildRoutingCallback(array|string|null $web,
array|string|null $api,
?string $pages,
?string $health,
string $apiPrefix,