laravel/framework

View on GitHub

Showing 864 of 1,073 total issues

Function ensureEnvelopeIsHydrated has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function ensureEnvelopeIsHydrated()
    {
        if (! method_exists($this, 'envelope')) {
            return;
        }
Severity: Minor
Found in src/Illuminate/Mail/Mailable.php - About 55 mins to fix

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 compileChange has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function compileChange(Blueprint $blueprint, Fluent $command, Connection $connection)
    {
        $column = $command->column;

        $changes = ['type '.$this->getType($column).$this->modifyCollate($blueprint, $column)];
Severity: Minor
Found in src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php - About 55 mins to fix

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 writePrompt has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    #[\Override]
    protected function writePrompt(OutputInterface $output, Question $question): void
    {
        $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion());

Severity: Minor
Found in src/Illuminate/Console/QuestionHelper.php - About 55 mins to fix

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 get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function get($array, $key, $default = null)
    {
        if (! static::accessible($array)) {
            return value($default);
        }
Severity: Minor
Found in src/Illuminate/Collections/Arr.php - About 55 mins to fix

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 remember has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function remember()
    {
        $iterator = $this->getIterator();

        $iteratorIndex = 0;
Severity: Minor
Found in src/Illuminate/Collections/LazyCollection.php - About 55 mins to fix

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 entries has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function entries()
    {
        return LazyCollection::make(function () {
            foreach ($this->tagIds() as $tagKey) {
                $cursor = $defaultCursorValue = '0';
Severity: Minor
Found in src/Illuminate/Cache/RedisTagSet.php - About 55 mins to fix

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 getMiddlewareGroups has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMiddlewareGroups()
    {
        $middleware = [
            'web' => array_values(array_filter([
                \Illuminate\Cookie\Middleware\EncryptCookies::class,
Severity: Minor
Found in src/Illuminate/Foundation/Configuration/Middleware.php - About 55 mins to fix

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 installNodeDependencies has a Cognitive Complexity of 9 (exceeds 5 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;
        }
Severity: Minor
Found in src/Illuminate/Foundation/Console/BroadcastingInstallCommand.php - About 55 mins to fix

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 prepareRule has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function prepareRule($rule, $attribute)
    {
        if ($rule instanceof Closure) {
            $rule = new ClosureValidationRule($rule);
        }
Severity: Minor
Found in src/Illuminate/Validation/ValidationRuleParser.php - About 55 mins to fix

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 newHasManyThrough has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected function newHasManyThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey)
Severity: Major
Found in src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php - About 50 mins to fix

    Method newHasOneThrough has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        protected function newHasOneThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey)
    Severity: Major
    Found in src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php - About 50 mins to fix

      Method belongsToMany has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function belongsToMany($related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null,
                                        $parentKey = null, $relatedKey = null, $relation = null)
      Severity: Major
      Found in src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php - About 50 mins to fix

        Method joinSub has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function joinSub($query, $as, $first, $operator = null, $second = null, $type = 'inner', $where = false)
        Severity: Major
        Found in src/Illuminate/Database/Query/Builder.php - About 50 mins to fix

          Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function __construct(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey)
          Severity: Major
          Found in src/Illuminate/Database/Eloquent/Relations/HasOneOrManyThrough.php - About 50 mins to fix

            Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function __construct(Container $container,
                    callable $userResolver,
                    array $abilities = [],
                    array $policies = [],
                    array $beforeCallbacks = [],
            Severity: Major
            Found in src/Illuminate/Auth/Access/Gate.php - About 50 mins to fix

              Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function __construct(Connection $connection, $table, $name, $seconds, $owner = null, $lottery = [2, 100], $defaultTimeoutInSeconds = 86400)
              Severity: Major
              Found in src/Illuminate/Cache/DatabaseLock.php - About 50 mins to fix

                Method call has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
                Severity: Major
                Found in src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php - About 50 mins to fix

                  Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function __construct(Redis $redis,
                                                  $default = 'default',
                                                  $connection = null,
                                                  $retryAfter = 60,
                                                  $blockFor = null,
                  Severity: Major
                  Found in src/Illuminate/Queue/RedisQueue.php - About 50 mins to fix

                    Function makeReplacements has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function makeReplacements($line, array $replace)
                        {
                            if (empty($replace)) {
                                return $line;
                            }
                    Severity: Minor
                    Found in src/Illuminate/Translation/Translator.php - About 45 mins to fix

                    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 getConnection has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getConnection()
                        {
                            $connection = $this->laravel['config']['database.connections.'.
                                (($db = $this->argument('connection')) ?? $this->laravel['config']['database.default'])
                            ];
                    Severity: Minor
                    Found in src/Illuminate/Database/Console/DbCommand.php - About 45 mins to fix

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language