laravel/framework

View on GitHub

Showing 864 of 1,073 total issues

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

    public function __construct(?string $view = null, ?string $html = null, ?string $text = null, $markdown = null, array $with = [], ?string $htmlString = null)
Severity: Minor
Found in src/Illuminate/Mail/Mailables/Content.php - About 45 mins to fix

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

        public function singleton($name, $controller, array $options = [])
        {
            if (isset($options['parameters']) && ! isset($this->parameters)) {
                $this->parameters = $options['parameters'];
            }
    Severity: Minor
    Found in src/Illuminate/Routing/ResourceRegistrar.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

    Method duplicate has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function duplicate(?array $query = null, ?array $request = null, ?array $attributes = null, ?array $cookies = null, ?array $files = null, ?array $server = null): static
    Severity: Minor
    Found in src/Illuminate/Http/Request.php - About 45 mins to fix

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

          public function pluck($value, $key = null)
          {
              return new static(function () use ($value, $key) {
                  [$value, $key] = $this->explodePluckParameters($value, $key);
      
      
      Severity: Minor
      Found in src/Illuminate/Collections/LazyCollection.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

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

          public function __construct(ConnectionInterface $connection,
                                                          $table,
                                                          $prefix = '',
                                                          $lockTable = 'cache_locks',
                                                          $lockLottery = [2, 100],
      Severity: Minor
      Found in src/Illuminate/Cache/DatabaseStore.php - About 45 mins to fix

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

            public function contains($key, $operator = null, $value = null)
            {
                if (func_num_args() === 1 && $this->useAsCallable($key)) {
                    $placeholder = new stdClass;
        
        
        Severity: Minor
        Found in src/Illuminate/Collections/LazyCollection.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 handle has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function handle($request, Closure $next)
            {
                if (! $request->hasSession() || ! $request->user() || ! $request->user()->getAuthPassword()) {
                    return $next($request);
                }
        Severity: Minor
        Found in src/Illuminate/Session/Middleware/AuthenticateSession.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 first has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function first($array, ?callable $callback = null, $default = null)
            {
                if (is_null($callback)) {
                    if (empty($array)) {
                        return value($default);
        Severity: Minor
        Found in src/Illuminate/Collections/Arr.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 set has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function set(&$array, $key, $value)
            {
                if (is_null($key)) {
                    return $array = $value;
                }
        Severity: Minor
        Found in src/Illuminate/Collections/Arr.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 invokeListeners has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function invokeListeners($event, $payload, $halt = false)
            {
                if ($this->shouldBroadcast($payload)) {
                    $this->broadcastEvent($payload[0]);
                }
        Severity: Minor
        Found in src/Illuminate/Events/Dispatcher.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 pluck has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function pluck($array, $value, $key = null)
            {
                $results = [];
        
                [$value, $key] = static::explodePluckParameters($value, $key);
        Severity: Minor
        Found in src/Illuminate/Collections/Arr.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 specifyParameters has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function specifyParameters()
            {
                // We will loop through all of the arguments and options for the command and
                // set them all on the base command instance. This specifies what can get
                // passed into these commands as "parameters" to control the execution.
        Severity: Minor
        Found in src/Illuminate/Console/Concerns/HasParameters.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 getParameterClassName has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getParameterClassName($parameter)
            {
                $type = $parameter->getType();
        
                if (! $type instanceof ReflectionNamedType || $type->isBuiltin()) {
        Severity: Minor
        Found in src/Illuminate/Container/Util.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

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

            public function __construct(DynamoDbClient $dynamo,
                                        $table,
                                        $keyAttribute = 'key',
                                        $valueAttribute = 'value',
                                        $expirationAttribute = 'expires_at',
        Severity: Minor
        Found in src/Illuminate/Cache/DynamoDbStore.php - About 45 mins to fix

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

              public function handle()
              {
                  $this->call('config:publish', ['name' => 'broadcasting']);
          
                  // Install channel routes file...
          Severity: Minor
          Found in src/Illuminate/Foundation/Console/BroadcastingInstallCommand.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 handle has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function handle()
              {
                  $environmentFile = $this->option('env')
                      ? base_path('.env').'.'.$this->option('env')
                      : base_path('.env');
          Severity: Minor
          Found in src/Illuminate/Foundation/Console/ServeCommand.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

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

              public function __construct(Container $container, RedisQueue $redis, $job, $reserved, $connectionName, $queue)
          Severity: Minor
          Found in src/Illuminate/Queue/Jobs/RedisJob.php - About 45 mins to fix

            Method buildRoutingCallback has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                protected function buildRoutingCallback(array|string|null $web,
                    array|string|null $api,
                    ?string $pages,
                    ?string $health,
                    string $apiPrefix,
            Severity: Minor
            Found in src/Illuminate/Foundation/Configuration/ApplicationBuilder.php - About 45 mins to fix

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

                  protected function publishFile($from, $to)
                  {
                      if ((! $this->option('existing') && (! $this->files->exists($to) || $this->option('force')))
                          || ($this->option('existing') && $this->files->exists($to))) {
                          $to = $this->ensureMigrationNameIsUpToDate($from, $to);
              Severity: Minor
              Found in src/Illuminate/Foundation/Console/VendorPublishCommand.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 copyDirectory has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function copyDirectory($directory, $destination, $options = null)
                  {
                      if (! $this->isDirectory($directory)) {
                          return false;
                      }
              Severity: Minor
              Found in src/Illuminate/Filesystem/Filesystem.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