laravel/framework

View on GitHub

Showing 864 of 1,073 total issues

GeneratorCommand has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class GeneratorCommand extends Command implements PromptsForMissingInput
{
    /**
     * The filesystem instance.
     *
Severity: Minor
Found in src/Illuminate/Console/GeneratorCommand.php - About 2 hrs to fix

    SessionManager has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SessionManager extends Manager
    {
        /**
         * Call a custom driver creator.
         *
    Severity: Minor
    Found in src/Illuminate/Session/SessionManager.php - About 2 hrs to fix

      EventFake has 23 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class EventFake implements Dispatcher, Fake
      {
          use ForwardsCalls, ReflectsClosures;
      
          /**
      Severity: Minor
      Found in src/Illuminate/Support/Testing/Fakes/EventFake.php - About 2 hrs to fix

        Method displayCli has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function displayCli($class, $database, $table, $policy, $attributes, $relations, $events, $observers)
            {
                $this->newLine();
        
                $this->components->twoColumnDetail('<fg=green;options=bold>'.$class.'</>');
        Severity: Major
        Found in src/Illuminate/Database/Console/ShowModelCommand.php - About 2 hrs to fix

          File Builder.php has 269 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          namespace Illuminate\Database\Schema;
          
          use Closure;
          Severity: Minor
          Found in src/Illuminate/Database/Schema/Builder.php - About 2 hrs to fix

            Method compileSlots has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function compileSlots(string $value)
                {
                    $pattern = "/
                        <
                            \s*
            Severity: Major
            Found in src/Illuminate/View/Compilers/ComponentTagCompiler.php - About 2 hrs to fix

              Function withAggregate has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function withAggregate($relations, $column, $function = null)
                  {
                      if (empty($relations)) {
                          return $this;
                      }
              Severity: Minor
              Found in src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.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 promptUntilValid has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function promptUntilValid($prompt, $required, $validate)
                  {
                      while (true) {
                          $result = $prompt();
              
              
              Severity: Minor
              Found in src/Illuminate/Console/Concerns/ConfiguresPrompts.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 filterRoute has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function filterRoute(array $route)
                  {
                      if (($this->option('name') && ! Str::contains((string) $route['name'], $this->option('name'))) ||
                          ($this->option('path') && ! Str::contains($route['uri'], $this->option('path'))) ||
                          ($this->option('method') && ! Str::contains($route['method'], strtoupper($this->option('method')))) ||
              Severity: Minor
              Found in src/Illuminate/Foundation/Console/RouteListCommand.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 addToMiddlewarePriorityRelative has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function addToMiddlewarePriorityRelative($existing, $middleware, $after = true)
                  {
                      if (! in_array($middleware, $this->middlewarePriority)) {
                          $index = $after ? 0 : count($this->middlewarePriority);
              
              
              Severity: Minor
              Found in src/Illuminate/Foundation/Http/Kernel.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 Relations.php has 267 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              namespace Illuminate\Types\Relations;
              
              use Illuminate\Database\Eloquent\Model;
              Severity: Minor
              Found in types/Database/Eloquent/Relations.php - About 2 hrs to fix

                File ServiceProvider.php has 266 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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

                  Method tearDownTheTestEnvironment has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function tearDownTheTestEnvironment(): void
                      {
                          if ($this->app) {
                              $this->callBeforeApplicationDestroyedCallbacks();
                  
                  

                    File ManagesFrequencies.php has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    namespace Illuminate\Console\Scheduling;
                    
                    use Illuminate\Support\Carbon;
                    Severity: Minor
                    Found in src/Illuminate/Console/Scheduling/ManagesFrequencies.php - About 2 hrs to fix

                      PendingCommand has 22 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class PendingCommand
                      {
                          use Conditionable;
                          use Macroable;
                      
                      
                      Severity: Minor
                      Found in src/Illuminate/Testing/PendingCommand.php - About 2 hrs to fix

                        FileStore has 22 functions (exceeds 20 allowed). Consider refactoring.
                        Open

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

                          Queue has 22 functions (exceeds 20 allowed). Consider refactoring.
                          Open

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

                            Method configurePrompts has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function configurePrompts(InputInterface $input)
                                {
                                    Prompt::setOutput($this->output);
                            
                                    Prompt::interactive(($input->isInteractive() && defined('STDIN') && stream_isatty(STDIN)) || $this->laravel->runningUnitTests());
                            Severity: Major
                            Found in src/Illuminate/Console/Concerns/ConfiguresPrompts.php - About 2 hrs to fix

                              Method flushOutputBuffer has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function flushOutputBuffer()
                                  {
                                      $lines = str($this->outputBuffer)->explode("\n");
                              
                                      $this->outputBuffer = (string) $lines->pop();
                              Severity: Major
                              Found in src/Illuminate/Foundation/Console/ServeCommand.php - About 2 hrs to fix

                                File helpers.php has 261 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                <?php
                                
                                use Illuminate\Contracts\Support\DeferringDisplayableValue;
                                use Illuminate\Contracts\Support\Htmlable;
                                use Illuminate\Support\Arr;
                                Severity: Minor
                                Found in src/Illuminate/Support/helpers.php - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language