laravel/framework

View on GitHub

Showing 864 of 1,073 total issues

Method daemon has 41 lines of code (exceeds 25 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 1 hr to fix

    Method handle has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function handle($request, Closure $next)
        {
            if ($this->inExceptArray($request)) {
                return $next($request);
            }

      Method quotes has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function quotes()
          {
              return Collection::make([
                  'Act only according to that maxim whereby you can, at the same time, will that it should become a universal law. - Immanuel Kant',
                  'An unexamined life is not worth living. - Socrates',
      Severity: Minor
      Found in src/Illuminate/Foundation/Inspiring.php - About 1 hr to fix

        Method createClient has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function createClient(array $config)
            {
                return tap(new Redis, function ($client) use ($config) {
                    if ($client instanceof RedisFacade) {
                        throw new LogicException(
        Severity: Minor
        Found in src/Illuminate/Redis/Connectors/PhpRedisConnector.php - About 1 hr to fix

          Method queueNotification has 40 lines of code (exceeds 25 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 1 hr to fix

            Method getMiddlewareGroups has 40 lines of code (exceeds 25 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 1 hr to fix

              Function where has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function where($column, $operator = null, $value = null, $boolean = 'and')
                  {
                      if ($column instanceof ConditionExpression) {
                          $type = 'Expression';
              
              
              Severity: Minor
              Found in src/Illuminate/Database/Query/Builder.php - About 1 hr 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 toSql has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function toSql()
                  {
                      $this->addImpliedCommands();
              
                      $statements = [];
              Severity: Minor
              Found in src/Illuminate/Database/Schema/Blueprint.php - About 1 hr 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 forget has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function forget(&$array, $keys)
                  {
                      $original = &$array;
              
                      $keys = (array) $keys;
              Severity: Minor
              Found in src/Illuminate/Collections/Arr.php - About 1 hr 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 has has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function has($array, $keys)
                  {
                      $keys = (array) $keys;
              
                      if (! $array || $keys === []) {
              Severity: Minor
              Found in src/Illuminate/Collections/Arr.php - About 1 hr 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 getListenersOnDispatcher has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function getListenersOnDispatcher()
                  {
                      $events = [];
              
                      foreach ($this->getRawListeners() as $event => $rawListeners) {
              Severity: Minor
              Found in src/Illuminate/Foundation/Console/EventListCommand.php - About 1 hr 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 retry has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  function retry($times, callable $callback, $sleepMilliseconds = 0, $when = null)
                  {
                      $attempts = 0;
              
                      $backoff = [];
              Severity: Minor
              Found in src/Illuminate/Support/helpers.php - About 1 hr 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 goodnight has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function goodnight()
                  {
                      if ($this->alreadySlept || ! $this->shouldSleep) {
                          return;
                      }
              Severity: Minor
              Found in src/Illuminate/Support/Sleep.php - About 1 hr 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 bootTestDatabase has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function bootTestDatabase()
                  {
                      ParallelTesting::setUpProcess(function () {
                          $this->whenNotUsingInMemoryDatabase(function ($database) {
                              if (ParallelTesting::option('recreate_databases')) {
              Severity: Minor
              Found in src/Illuminate/Testing/Concerns/TestDatabases.php - About 1 hr to fix

                Method passes has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function passes($attribute, $value)
                    {
                        $this->messages = [];
                
                        $validator = Validator::make(
                Severity: Minor
                Found in src/Illuminate/Validation/Rules/Password.php - About 1 hr to fix

                  Method orderedChunkById has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function orderedChunkById($count, callable $callback, $column = null, $alias = null, $descending = false)
                      {
                          $column ??= $this->defaultKeyName();
                          $alias ??= $column;
                          $lastId = null;
                  Severity: Minor
                  Found in src/Illuminate/Database/Concerns/BuildsQueries.php - About 1 hr to fix

                    Method doSend has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function doSend(SentMessage $message): void
                        {
                            $options = $this->options;
                    
                            if ($message->getOriginalMessage() instanceof Message) {
                    Severity: Minor
                    Found in src/Illuminate/Mail/Transport/SesTransport.php - About 1 hr to fix

                      Method data_get has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function data_get($target, $key, $default = null)
                          {
                              if (is_null($key)) {
                                  return $target;
                              }
                      Severity: Minor
                      Found in src/Illuminate/Collections/helpers.php - About 1 hr to fix

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

                            public function __construct(QueueFactory $queue,
                                                        BatchRepository $repository,
                                                        string $id,
                                                        string $name,
                                                        int $totalJobs,
                        Severity: Major
                        Found in src/Illuminate/Bus/Batch.php - About 1 hr to fix

                          Method originalIsEquivalent has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function originalIsEquivalent($key)
                              {
                                  if (! array_key_exists($key, $this->original)) {
                                      return false;
                                  }
                          Severity: Minor
                          Found in src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language