Model
has 146 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Model implements Arrayable, ArrayAccess, CanBeEscapedWhenCastToString, HasBroadcastChannel, Jsonable, JsonSerializable, QueueableEntity, Stringable, UrlRoutable
{
use Concerns\HasAttributes,
Concerns\HasEvents,
Concerns\HasGlobalScopes,
File Model.php
has 1000 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Illuminate\Database\Eloquent;
use ArrayAccess;
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 getQueueableRelations
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getQueueableRelations()
{
$relations = [];
foreach ($this->getRelations() as $key => $relation) {
- 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 fill
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fill(array $attributes)
{
$totallyGuarded = $this->totallyGuarded();
$fillable = $this->fillableFromArray($attributes);
Method newPivot
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function newPivot(self $parent, array $attributes, $table, $exists, $using = null)
Function save
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function save(array $options = [])
{
$this->mergeAttributesFromCachedCasts();
$query = $this->newModelQuery();
- 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 push
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function push()
{
if (! $this->save()) {
return false;
}
- 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 performInsert
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function performInsert(Builder $query)
{
if ($this->usesUniqueIds()) {
$this->setUniqueIds();
}
- 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 destroy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function destroy($ids)
{
if ($ids instanceof EloquentCollection) {
$ids = $ids->modelKeys();
}
- 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 bootTraits
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected static function bootTraits()
{
$class = static::class;
$booted = [];
- 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"