Showing 864 of 1,073 total issues
Method processTypes
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function processTypes($results)
{
return array_map(function ($result) {
$result = (object) $result;
Method __construct
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(Blueprint $blueprint, Connection $connection, Grammar $grammar)
{
$this->blueprint = $blueprint;
$this->connection = $connection;
$this->grammar = $grammar;
Method sortByMany
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function sortByMany(array $comparisons = [], int $options = SORT_REGULAR)
{
$items = $this->items;
uasort($items, function ($a, $b) use ($comparisons, $options) {
Method handle
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(Schedule $schedule)
{
$phpBinary = Application::phpBinary();
$commands = $schedule->events();
Method pack
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function pack(array $values): array
{
if (empty($values)) {
return $values;
}
Method getRelations
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getRelations($model)
{
return collect(get_class_methods($model))
->map(fn ($method) => new ReflectionMethod($model, $method))
->reject(
Method handlePromiseResponse
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handlePromiseResponse(Response|ConnectionException|TransferException $response, $method, $url, $options, $attempt)
{
if ($response instanceof Response && $response->successful()) {
return $response;
}
Method compileAlter
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compileAlter(Blueprint $blueprint, Fluent $command, Connection $connection)
{
$columnNames = [];
$autoIncrementColumn = null;
Method handle
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
if ($this->option('passport')) {
$this->installPassport();
} else {
Method __invoke
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __invoke($path, $manifestDirectory = '')
{
static $manifests = [];
if (! str_starts_with($path, '/')) {
Function addSelect
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function addSelect($column)
{
$columns = is_array($column) ? $column : func_get_args();
foreach ($columns as $as => $column) {
- 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 prefers
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function prefers($contentTypes)
{
$accepts = $this->getAcceptableContentTypes();
$contentTypes = (array) $contentTypes;
- 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 handlePromiseResponse
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function handlePromiseResponse(Response|ConnectionException|TransferException $response, $method, $url, $options, $attempt)
{
if ($response instanceof Response && $response->successful()) {
return $response;
}
- 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 subscribe
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function subscribe($subscriber)
{
$subscriber = $this->resolveSubscriber($subscriber);
$events = $subscriber->subscribe($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 decrypt
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function decrypt($payload, $unserialize = true)
{
$payload = $this->getJsonPayload($payload);
$iv = base64_decode($payload['iv']);
- 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 explodeWildcardRules
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function explodeWildcardRules($results, $attribute, $rules)
{
$pattern = str_replace('\*', '[^\.]*', preg_quote($attribute, '/'));
$data = ValidationData::initializeAndGatherData($attribute, $this->data);
- 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 processColumns
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function processColumns($results, $sql = '')
{
$hasPrimaryKey = array_sum(array_column($results, 'primary')) === 1;
return array_map(function ($result) use ($hasPrimaryKey, $sql) {
Method registerBatchServices
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function registerBatchServices()
{
$this->app->singleton(BatchRepository::class, function ($app) {
$driver = $app->config->get('queue.batching.driver', 'database');
Method installNodeDependencies
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function installNodeDependencies()
{
if ($this->option('without-node') || ! confirm('Would you like to install and build the Node dependencies required for broadcasting?', default: true)) {
return;
}
Method replaceModel
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function replaceModel($stub, $model)
{
$model = str_replace('/', '\\', $model);
if (str_starts_with($model, '\\')) {