Showing 864 of 1,073 total issues
Function addFluentIndexes
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function addFluentIndexes()
{
foreach ($this->columns as $column) {
foreach (['primary', 'unique', 'index', 'fulltext', 'fullText', 'spatialIndex'] as $index) {
// If the column is supposed to be changed to an auto increment column and
- 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 tearDownTheTestEnvironment
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function tearDownTheTestEnvironment(): void
{
if ($this->app) {
$this->callBeforeApplicationDestroyedCallbacks();
- 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 pack
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function pack(array $values): array
{
if (empty($values)) {
return $values;
}
- 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 assertListening
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function assertListening($expectedEvent, $expectedListener)
{
foreach ($this->dispatcher->getListeners($expectedEvent) as $listenerClosure) {
$actualListener = (new ReflectionFunction($listenerClosure))
->getStaticVariables()['listener'];
- 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 escapeArgument
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function escapeArgument($argument)
{
// Fix for PHP bug #43784 escapeshellarg removes % from given string
// Fix for PHP bug #49446 escapeshellarg doesn't work on Windows
// @see https://bugs.php.net/bug.php?id=43784
- 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
File BroadcastManager.php
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Illuminate\Broadcasting;
use Ably\AblyRest;
File HasOneOrMany.php
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Illuminate\Database\Eloquent\Relations;
use Illuminate\Database\Eloquent\Builder;
Method createABufferedOutputMock
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createABufferedOutputMock()
{
$mock = Mockery::mock(BufferedOutput::class.'[doWrite]')
->shouldAllowMockingProtectedMethods()
->shouldIgnoreMissing();
Method castAttribute
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function castAttribute($key, $value)
{
$castType = $this->getCastType($key);
if (is_null($value) && in_array($castType, static::$primitiveCastTypes)) {
Method compileSelfClosingTags
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function compileSelfClosingTags(string $value)
{
$pattern = "/
<
\s*
Method compileOpeningTags
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function compileOpeningTags(string $value)
{
$pattern = "/
<
\s*
Method getSqlSrvDsn
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getSqlSrvDsn(array $config)
{
$arguments = [
'Server' => $this->buildHostString($config, ','),
];
Method where
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function where($column, $operator = null, $value = null, $boolean = 'and')
{
if ($column instanceof ConditionExpression) {
$type = 'Expression';
Method castUsing
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function castUsing(array $arguments)
{
return new class($arguments) implements CastsAttributes
{
protected $arguments;
Method send
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function send(string $method, string $url, array $options = [])
{
if (! Str::startsWith($url, ['http://', 'https://'])) {
$url = ltrim(rtrim($this->baseUrl, '/').'/'.ltrim($url, '/'), '/');
}
Method forCli
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function forCli($routes)
{
$routes = $routes->map(
fn ($route) => array_merge($route, [
'action' => $this->formatActionForCli($route),
Function ofMany
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function ofMany($column = 'id', $aggregate = 'MAX', $relation = null)
{
$this->isOneOfMany = true;
$this->relationName = $relation ?: $this->getDefaultOneOfManyJoinAlias(
- 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 select
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function select($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 __invoke
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function __invoke($path, $manifestDirectory = '')
{
static $manifests = [];
if (! str_starts_with($path, '/')) {
- 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 getListenerEvents
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected static function getListenerEvents($listeners, $basePath)
{
$listenerEvents = [];
foreach ($listeners as $listener) {
- 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"