laravel/framework

View on GitHub

Showing 864 of 1,073 total issues

Method make has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

        public function __construct($name = 'default', $backoff = 0, $memory = 128, $timeout = 60, $sleep = 3, $maxTries = 1,
                                    $force = false, $stopWhenEmpty = false, $maxJobs = 0, $maxTime = 0, $rest = 0)
    Severity: Major
    Found in src/Illuminate/Queue/WorkerOptions.php - About 1 hr to fix

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

          public function handle()
          {
              if ($this->isProhibited() ||
                  ! $this->confirmToProceed()) {
                  return Command::FAILURE;
      Severity: Minor
      Found in src/Illuminate/Database/Console/Migrations/FreshCommand.php - About 1 hr to fix

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

            public function handle(ConnectionResolverInterface $connections)
            {
                $connection = $connections->connection($this->input->getOption('database'));
                $schema = $connection->getSchemaBuilder();
                $tables = collect($schema->getTables())
        Severity: Minor
        Found in src/Illuminate/Database/Console/TableCommand.php - About 1 hr to fix

          Method createAwsDynamoTable has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function createAwsDynamoTable(): void
              {
                  $definition = [
                      'TableName' => $this->table,
                      'AttributeDefinitions' => [
          Severity: Minor
          Found in src/Illuminate/Bus/DynamoBatchRepository.php - About 1 hr to fix

            Method operatorForWhere has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function operatorForWhere($key, $operator = null, $value = null)
                {
                    if ($this->useAsCallable($key)) {
                        return $key;
                    }
            Severity: Minor
            Found in src/Illuminate/Collections/Traits/EnumeratesValues.php - About 1 hr to fix

              Method many has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function many(array $keys)
                  {
                      if (count($keys) === 0) {
                          return [];
                      }
              Severity: Minor
              Found in src/Illuminate/Cache/DynamoDbStore.php - About 1 hr to fix

                Method assertDispatchedWithChainOfObjects has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function assertDispatchedWithChainOfObjects($command, $expectedChain, $callback)
                    {
                        $chain = $expectedChain;
                
                        PHPUnit::assertTrue(
                Severity: Minor
                Found in src/Illuminate/Support/Testing/Fakes/BusFake.php - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if ($response instanceof PsrResponseInterface) {
                              $response = (new HttpFoundationFactory)->createResponse($response);
                          } elseif ($response instanceof Model && $response->wasRecentlyCreated) {
                              $response = new JsonResponse($response, 201);
                          } elseif ($response instanceof Stringable) {
                  Severity: Critical
                  Found in src/Illuminate/Routing/Router.php - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                            if (($databaseEngine === 'mysql' && version_compare($databaseVersion, '8.0.1', '>=')) ||
                                ($databaseEngine === 'mariadb' && version_compare($databaseVersion, '10.6.0', '>=')) ||
                                ($databaseEngine === 'pgsql' && version_compare($databaseVersion, '9.5', '>=')) ||
                                ($databaseEngine === 'vitess' && version_compare($databaseVersion, '19.0', '>='))) {
                                return 'FOR UPDATE SKIP LOCKED';
                    Severity: Critical
                    Found in src/Illuminate/Queue/DatabaseQueue.php - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                              if (is_null($using) && (is_string($web) || is_array($web) || is_string($api) || is_array($api) || is_string($pages) || is_string($health)) || is_callable($then)) {
                                  $using = $this->buildRoutingCallback($web, $api, $pages, $health, $apiPrefix, $then);
                              }
                      Severity: Critical
                      Found in src/Illuminate/Foundation/Configuration/ApplicationBuilder.php - About 1 hr to fix

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

                          Method compileStatements has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function compileStatements($template)
                              {
                                  preg_match_all('/\B@(@?\w+(?:::\w+)?)([ \t]*)(\( ( [\S\s]*? ) \))?/x', $template, $matches);
                          
                                  $offset = 0;
                          Severity: Minor
                          Found in src/Illuminate/View/Compilers/BladeCompiler.php - About 1 hr to fix

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

                                public function handle()
                                {
                                    $cipher = $this->option('cipher') ?: 'AES-256-CBC';
                            
                                    $key = $this->option('key');
                            Severity: Minor
                            Found in src/Illuminate/Foundation/Console/EnvironmentEncryptCommand.php - About 1 hr to fix

                              Method createRedisClusterInstance has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function createRedisClusterInstance(array $servers, array $options)
                                  {
                                      $parameters = [
                                          null,
                                          array_values($servers),
                              Severity: Minor
                              Found in src/Illuminate/Redis/Connectors/PhpRedisConnector.php - About 1 hr to fix

                                Method assertDownload has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function assertDownload($filename = null)
                                    {
                                        $contentDisposition = explode(';', $this->headers->get('content-disposition', ''));
                                
                                        if (trim($contentDisposition[0]) !== 'attachment') {
                                Severity: Minor
                                Found in src/Illuminate/Testing/TestResponse.php - About 1 hr to fix

                                  Method transaction has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function transaction(Closure $callback, $attempts = 1)
                                      {
                                          for ($currentAttempt = 1; $currentAttempt <= $attempts; $currentAttempt++) {
                                              $this->beginTransaction();
                                  
                                  
                                  Severity: Minor
                                  Found in src/Illuminate/Database/Concerns/ManagesTransactions.php - About 1 hr to fix

                                    Method decrement has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function decrement($key, $value = 1)
                                        {
                                            try {
                                                $response = $this->dynamo->updateItem([
                                                    'TableName' => $this->table,
                                    Severity: Minor
                                    Found in src/Illuminate/Cache/DynamoDbStore.php - About 1 hr to fix

                                      Method add has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function add($key, $value, $seconds)
                                          {
                                              try {
                                                  $this->dynamo->putItem([
                                                      'TableName' => $this->table,
                                      Severity: Minor
                                      Found in src/Illuminate/Cache/DynamoDbStore.php - About 1 hr to fix

                                        Method setUpRedis has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function setUpRedis()
                                            {
                                                if (! extension_loaded('redis')) {
                                                    $this->markTestSkipped('The redis extension is not installed. Please install the extension to enable '.__CLASS__);
                                                }
                                        Severity: Minor
                                        Found in src/Illuminate/Foundation/Testing/Concerns/InteractsWithRedis.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language