Showing 864 of 1,073 total issues
Function object_get
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function object_get($object, $key, $default = null)
{
if (is_null($key) || trim($key) === '') {
return $object;
}
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($connectionName, $queue, $id, $job, $payload, $delay)
Method callClassBasedReplacer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function callClassBasedReplacer($callback, $message, $attribute, $rule, $parameters, $validator)
Function contains
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function contains($haystack, $needles, $ignoreCase = false)
{
if ($ignoreCase) {
$haystack = mb_strtolower($haystack);
}
- 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 getCount
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = [])
Function resolve
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function resolve($name)
{
$config = $this->getInstanceConfig($name);
if (is_null($config)) {
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
public function handle($job, $next)
{
$this->limiter = Container::getInstance()->make(RateLimiter::class);
if ($this->limiter->tooManyAttempts($jobKey = $this->getKey($job), $this->maxAttempts)) {
- 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 assertSentTo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function assertSentTo($notifiable, $notification, $callback = null)
{
if (is_array($notifiable) || $notifiable instanceof Collection) {
if (count($notifiable) === 0) {
throw new Exception('No notifiable given.');
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
public function handle($job, $next)
{
$this->redis = Container::getInstance()->make(Redis::class);
$this->limiter = new DurationLimiter(
- 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 getCount
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = []);
Consider simplifying this complex logical expression. Open
if (
$file['type'] === 'file'
&& (
(! $this->option('existing') && (! $manager->fileExists('to://'.$path) || $this->option('force')))
|| ($this->option('existing') && $manager->fileExists('to://'.$path))
Consider simplifying this complex logical expression. Open
if (! is_object($rule) ||
$rule instanceof RuleContract ||
($rule instanceof Exists && $rule->queryCallbacks()) ||
($rule instanceof Unique && $rule->queryCallbacks())) {
return $rule;
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($items, $total, $perPage, $currentPage = null, array $options = [])
Method getLine
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function getLine($namespace, $group, $locale, $item, array $replace)
Method orderedChunkById
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function orderedChunkById($count, callable $callback, $column = null, $alias = null, $descending = false)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(Factory $factory, Engine $engine, $view, $path, $data = [])
Method paginator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function paginator($items, $total, $perPage, $currentPage, $options)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Filesystem $files,
$cachePath,
$basePath = '',
$shouldCache = true,
$compiledExtension = 'php')
Method whereHasMorph
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function whereHasMorph($relation, $types, ?Closure $callback = null, $operator = '>=', $count = 1)
Method orWhereMorphRelation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function orWhereMorphRelation($relation, $types, $column, $operator = null, $value = null)