Showing 864 of 1,073 total issues
Function flushHandlersState
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function flushHandlersState()
{
while (true) {
$previousHandler = set_exception_handler(static fn () => null);
- 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 getLockForPopping
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function getLockForPopping()
{
$databaseEngine = $this->database->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME);
$databaseVersion = $this->database->getConfig('version') ?? $this->database->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
- 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 blank
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function blank($value)
{
if (is_null($value)) {
return true;
}
- 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 apa
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function apa($value)
{
if (trim($value) === '') {
return $value;
}
- 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 10 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(string $id,
string $name,
int $totalJobs,
int $pendingJobs,
int $failedJobs,
Function failsBasicDimensionChecks
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function failsBasicDimensionChecks($parameters, $width, $height)
{
return (isset($parameters['width']) && $parameters['width'] != $width) ||
(isset($parameters['min_width']) && $parameters['min_width'] > $width) ||
(isset($parameters['max_width']) && $parameters['max_width'] < $width) ||
- 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 isCallable
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function isCallable($var, $syntaxOnly = false)
{
if (! is_array($var)) {
return is_callable($var, $syntaxOnly);
}
- 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 resolveForRoute
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function resolveForRoute($container, $route)
{
$parameters = $route->parameters();
$route = static::resolveBackedEnumsForRoute($route, $parameters);
Method promptForMissingArgumentsUsing
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function promptForMissingArgumentsUsing()
{
return [
'name' => [
'What should the '.strtolower($this->type).' be named?',
Method runEvent
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function runEvent($event)
{
$summary = $event->getSummaryForDisplay();
$command = $event instanceof CallbackEvent
Method writePrompt
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[\Override]
protected function writePrompt(OutputInterface $output, Question $question): void
{
$text = OutputFormatter::escapeTrailingBackslash($question->getQuestion());
Method handle
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$key = $this->option('key') ?: Env::get('LARAVEL_ENV_ENCRYPTION_KEY');
if (! $key) {
Method __serialize
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __serialize()
{
$values = [];
$reflectionClass = new ReflectionClass($this);
Method apa
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function apa($value)
{
if (trim($value) === '') {
return $value;
}
Method whereContains
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function whereContains(string $key, $expected)
{
$actual = Collection::make(
$this->prop($key) ?? $this->prop()
);
Method render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
$template = <<<'EOF'
<?php extract(collect($attributes->getAttributes())->mapWithKeys(function ($value, $key) { return [Illuminate\Support\Str::camel(str_replace([':', '.'], ' ', $key)) => $value]; })->all(), EXTR_SKIP); ?>
{{ props }}
Method getVirtualAttributes
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getVirtualAttributes($model, $columns)
{
$class = new ReflectionClass($model);
return collect($class->getMethods())
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 setAttribute
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setAttribute($key, $value)
{
// First we will check for the presence of a mutator for the set operation
// which simply lets the developers tweak the attribute as it is set on
// this model, such as "json_encoding" a listing of data for storage.
Method addCastAttributesToArray
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCastAttributesToArray(array $attributes, array $mutatedAttributes)
{
foreach ($this->getCasts() as $key => $value) {
if (! array_key_exists($key, $attributes) ||
in_array($key, $mutatedAttributes)) {