laravel/framework

View on GitHub

Showing 864 of 1,073 total issues

Function data_forget has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    function data_forget(&$target, $key)
    {
        $segments = is_array($key) ? $key : explode('.', $key);

        if (($segment = array_shift($segments)) === '*' && Arr::accessible($target)) {
Severity: Minor
Found in src/Illuminate/Collections/helpers.php - About 3 hrs 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

File ReplacesAttributes.php has 301 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Illuminate\Validation\Concerns;

use Illuminate\Support\Arr;
Severity: Minor
Found in src/Illuminate/Validation/Concerns/ReplacesAttributes.php - About 3 hrs to fix

    File MailManager.php has 300 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace Illuminate\Mail;
    
    use Aws\Ses\SesClient;
    Severity: Minor
    Found in src/Illuminate/Mail/MailManager.php - About 3 hrs to fix

      File Kernel.php has 299 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace Illuminate\Foundation\Console;
      
      use Carbon\CarbonInterval;
      Severity: Minor
      Found in src/Illuminate/Foundation/Console/Kernel.php - About 3 hrs to fix

        Job has 27 functions (exceeds 20 allowed). Consider refactoring.
        Open

        abstract class Job
        {
            use InteractsWithTime;
        
            /**
        Severity: Minor
        Found in src/Illuminate/Queue/Jobs/Job.php - About 3 hrs to fix

          Function daemon has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

              public function daemon($connectionName, $queue, WorkerOptions $options)
              {
                  if ($supportsAsyncSignals = $this->supportsAsyncSignals()) {
                      $this->listenForSignals();
                  }
          Severity: Minor
          Found in src/Illuminate/Queue/Worker.php - About 3 hrs 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

          ComponentTagCompiler has 26 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class ComponentTagCompiler
          {
              /**
               * The Blade compiler instance.
               *
          Severity: Minor
          Found in src/Illuminate/View/Compilers/ComponentTagCompiler.php - About 3 hrs to fix

            PendingBatch has 26 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class PendingBatch
            {
                use Conditionable;
            
                /**
            Severity: Minor
            Found in src/Illuminate/Bus/PendingBatch.php - About 3 hrs to fix

              Factory has 26 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Factory
              {
                  use Macroable {
                      __call as macroCall;
                  }
              Severity: Minor
              Found in src/Illuminate/Http/Client/Factory.php - About 3 hrs to fix

                CacheManager has 26 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class CacheManager implements FactoryContract
                {
                    /**
                     * The application instance.
                     *
                Severity: Minor
                Found in src/Illuminate/Cache/CacheManager.php - About 3 hrs to fix

                  File ResourceRegistrar.php has 290 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  namespace Illuminate\Routing;
                  
                  use Illuminate\Support\Str;
                  Severity: Minor
                  Found in src/Illuminate/Routing/ResourceRegistrar.php - About 2 hrs to fix

                    Function assertInvalid has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function assertInvalid($errors = null,
                                                      $errorBag = 'default',
                                                      $responseKey = 'errors')
                        {
                            if ($this->baseResponse->headers->get('Content-Type') === 'application/json') {
                    Severity: Minor
                    Found in src/Illuminate/Testing/TestResponse.php - About 2 hrs 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 queueNotification has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function queueNotification($notifiables, $notification)
                        {
                            $notifiables = $this->formatNotifiables($notifiables);
                    
                            $original = clone $notification;
                    Severity: Minor
                    Found in src/Illuminate/Notifications/NotificationSender.php - About 2 hrs 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

                    File AbstractCursorPaginator.php has 286 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    namespace Illuminate\Pagination;
                    
                    use ArrayAccess;
                    Severity: Minor
                    Found in src/Illuminate/Pagination/AbstractCursorPaginator.php - About 2 hrs to fix

                      File PendingCommand.php has 286 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      namespace Illuminate\Testing;
                      
                      use Illuminate\Console\OutputStyle;
                      Severity: Minor
                      Found in src/Illuminate/Testing/PendingCommand.php - About 2 hrs to fix

                        Batch has 25 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Batch implements Arrayable, JsonSerializable
                        {
                            /**
                             * The queue factory implementation.
                             *
                        Severity: Minor
                        Found in src/Illuminate/Bus/Batch.php - About 2 hrs to fix

                          DatabaseStore has 25 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class DatabaseStore implements LockProvider, Store
                          {
                              use InteractsWithTime;
                          
                              /**
                          Severity: Minor
                          Found in src/Illuminate/Cache/DatabaseStore.php - About 2 hrs to fix

                            RedisStore has 25 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class RedisStore extends TaggableStore implements LockProvider
                            {
                                /**
                                 * The Redis factory implementation.
                                 *
                            Severity: Minor
                            Found in src/Illuminate/Cache/RedisStore.php - About 2 hrs to fix

                              File RouteListCommand.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              
                              namespace Illuminate\Foundation\Console;
                              
                              use Closure;
                              Severity: Minor
                              Found in src/Illuminate/Foundation/Console/RouteListCommand.php - About 2 hrs to fix

                                Method update has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function update(Fluent $command)
                                    {
                                        switch ($command->name) {
                                            case 'alter':
                                                // Already handled...
                                Severity: Major
                                Found in src/Illuminate/Database/Schema/BlueprintState.php - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language