laravel/framework

View on GitHub

Showing 864 of 1,073 total issues

Method callReplacer has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected function callReplacer($message, $attribute, $rule, $parameters, $validator)
Severity: Minor
Found in src/Illuminate/Validation/Concerns/FormatsMessages.php - About 35 mins to fix

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

        public function __construct($connectionName, $queue, $job, $payload, $delay)
    Severity: Minor
    Found in src/Illuminate/Queue/Events/JobQueueing.php - About 35 mins to fix

      Method password has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function password($length = 32, $letters = true, $numbers = true, $symbols = true, $spaces = false)
      Severity: Minor
      Found in src/Illuminate/Support/Str.php - About 35 mins to fix

        Method test has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            Builder $query,
            Post $post,
            ChildPost $childPost,
            Comment $comment,
            QueryBuilder $queryBuilder
        Severity: Minor
        Found in types/Database/Eloquent/Builder.php - About 35 mins to fix

          Method mask has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static function mask($string, $character, $index, $length = null, $encoding = 'UTF-8')
          Severity: Minor
          Found in src/Illuminate/Support/Str.php - About 35 mins to fix

            Function get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function get($path, array $data = [])
                {
                    $this->lastCompiled[] = $path;
            
                    // If this given view has expired, which means it has simply been edited since
            Severity: Minor
            Found in src/Illuminate/View/Engines/CompilerEngine.php - About 35 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 assertValid has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

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

                protected function createMissingMysqlDatabase($connection)
                {
                    if ($this->laravel['config']->get("database.connections.{$connection->getName()}.database") !== $connection->getDatabaseName()) {
                        return false;
                    }
            Severity: Minor
            Found in src/Illuminate/Database/Console/Migrations/MigrateCommand.php - About 35 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 matches has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function matches($values): bool
                {
                    $decodedContent = html_entity_decode($this->content, ENT_QUOTES, 'UTF-8');
            
                    $position = 0;
            Severity: Minor
            Found in src/Illuminate/Testing/Constraints/SeeInOrder.php - About 35 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 __toString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __toString()
                {
                    $string = '';
            
                    foreach ($this->attributes as $key => $value) {
            Severity: Minor
            Found in src/Illuminate/View/ComponentAttributeBag.php - About 35 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 call has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function call($class, $silent = false, array $parameters = [])
                {
                    $classes = Arr::wrap($class);
            
                    foreach ($classes as $class) {
            Severity: Minor
            Found in src/Illuminate/Database/Seeder.php - About 35 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 findInPaths has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function findInPaths($name, $paths)
                {
                    foreach ((array) $paths as $path) {
                        foreach ($this->getPossibleViewFiles($name) as $file) {
                            $viewPath = $path.'/'.$file;
            Severity: Minor
            Found in src/Illuminate/View/FileViewFinder.php - About 35 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 verifyUserCanAccessChannel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function verifyUserCanAccessChannel($request, $channel)
                {
                    foreach ($this->channels as $pattern => $callback) {
                        if (! $this->channelNameMatchesPattern($channel, $pattern)) {
                            continue;
            Severity: Minor
            Found in src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php - About 35 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 createABufferedOutputMock has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                private function createABufferedOutputMock()
                {
                    $mock = Mockery::mock(BufferedOutput::class.'[doWrite]')
                            ->shouldAllowMockingProtectedMethods()
                            ->shouldIgnoreMissing();
            Severity: Minor
            Found in src/Illuminate/Testing/PendingCommand.php - About 35 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 extractFromString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                private function extractFromString($part, $number)
                {
                    preg_match('/^[\{\[]([^\[\]\{\}]*)[\}\]](.*)/s', $part, $matches);
            
                    if (count($matches) !== 3) {
            Severity: Minor
            Found in src/Illuminate/Translation/MessageSelector.php - About 35 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 addGlobalScope has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function addGlobalScope($scope, $implementation = null)
                {
                    if (is_string($scope) && ($implementation instanceof Closure || $implementation instanceof Scope)) {
                        return static::$globalScopes[static::class][$scope] = $implementation;
                    } elseif ($scope instanceof Closure) {
            Severity: Minor
            Found in src/Illuminate/Database/Eloquent/Concerns/HasGlobalScopes.php - About 35 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 addUniqueIdsToUpsertValues has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function addUniqueIdsToUpsertValues(array $values)
                {
                    if (! $this->model->usesUniqueIds()) {
                        return $values;
                    }
            Severity: Minor
            Found in src/Illuminate/Database/Eloquent/Builder.php - About 35 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 __call has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __call($method, $parameters)
                {
                    if ($method === 'macro') {
                        $this->localMacros[$parameters[0]] = $parameters[1];
            
            
            Severity: Minor
            Found in src/Illuminate/Database/Eloquent/Builder.php - About 35 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 firstOrCreate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function firstOrCreate(array $attributes = [], array $values = [], array $joining = [], $touch = true)
                {
                    if (is_null($instance = (clone $this)->where($attributes)->first())) {
                        if (is_null($instance = $this->related->where($attributes)->first())) {
                            $instance = $this->createOrFirst($attributes, $values, $joining, $touch);
            Severity: Minor
            Found in src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php - About 35 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 save has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function save(array $options = [])
                {
                    $this->mergeAttributesFromCachedCasts();
            
                    $query = $this->newModelQuery();
            Severity: Minor
            Found in src/Illuminate/Database/Eloquent/Model.php - About 35 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