Showing 864 of 1,073 total issues
Function throttle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function throttle(Throwable $e)
{
foreach ($this->throttleCallbacks as $throttleCallback) {
foreach ($this->firstClosureParameterTypes($throttleCallback) as $type) {
if (is_a($e, $type)) {
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
$relative = $this->option('relative');
foreach ($this->links() as $link => $target) {
- 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 __unserialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function __unserialize(array $values)
{
$properties = (new ReflectionClass($this))->getProperties();
$class = get_class($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
Function renderViaCallbacks
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function renderViaCallbacks($request, Throwable $e)
{
foreach ($this->renderCallbacks as $renderCallback) {
foreach ($this->firstClosureParameterTypes($renderCallback) as $type) {
if (is_a($e, $type)) {
- 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 register
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function register($provider, $force = false)
{
if (($registered = $this->getProvider($provider)) && ! $force) {
return $registered;
}
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
if (parent::handle() === false && ! $this->option('force')) {
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 sendNow
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function sendNow($notifiables, $notification, ?array $channels = null)
{
if (! $notifiables instanceof Collection && ! is_array($notifiables)) {
$notifiables = [$notifiables];
}
- 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 handle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
if ($this->isProhibited() ||
! $this->confirmToProceed()) {
return 1;
Method assertStructure
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function assertStructure(?array $structure = null, $responseData = null, bool $exact = false)
{
if (is_null($structure)) {
return $this->assertSimilar($this->decoded);
}
Method compileString
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compileString($value)
{
[$this->footer, $result] = [[], ''];
foreach ($this->prepareStringsForCompilationUsing as $callback) {
Method upsert
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upsert(array $values, $uniqueBy, $update = null)
{
if (empty($values)) {
return 0;
} elseif ($update === []) {
Method hasMorph
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function hasMorph($relation, $types, $operator = '>=', $count = 1, $boolean = 'and', ?Closure $callback = null)
{
if (is_string($relation)) {
$relation = $this->getRelationWithoutConstraints($relation);
}
Method has
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function has($callback)
{
if (is_string($callback)) {
$callback = fn () => $this->localRelationship->getRelated()->{$callback}();
}
Method prepareNestedWithRelationships
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function prepareNestedWithRelationships($relations, $prefix = '')
{
$preparedRelationships = [];
if ($prefix !== '') {
Method find
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function find(string $batchId)
{
if ($batchId === '') {
return null;
}
Method take
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function take($limit)
{
if ($limit < 0) {
return new static(function () use ($limit) {
$limit = abs($limit);
Method decrypt
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function decrypt($payload, $unserialize = true)
{
$payload = $this->getJsonPayload($payload);
$iv = base64_decode($payload['iv']);
Method render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($description, $task = null, $verbosity = OutputInterface::VERBOSITY_NORMAL)
{
$description = $this->mutate($description, [
Mutators\EnsureDynamicContentIsHighlighted::class,
Mutators\EnsureNoPunctuation::class,
Method writeOutputForCli
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeOutputForCli(Job $job, $status)
{
$this->output->write(sprintf(
' <fg=gray>%s</> %s%s',
$this->now()->format('Y-m-d H:i:s'),
Method handle
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(Dispatcher $events)
{
$models = $this->models();
if ($models->isEmpty()) {