laravel/framework

View on GitHub

Showing 864 of 1,073 total issues

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

    function object_get($object, $key, $default = null)
    {
        if (is_null($key) || trim($key) === '') {
            return $object;
        }
Severity: Minor
Found in src/Illuminate/Support/helpers.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($connectionName, $queue, $id, $job, $payload, $delay)
Severity: Minor
Found in src/Illuminate/Queue/Events/JobQueued.php - About 45 mins to fix

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

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

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

          public static function contains($haystack, $needles, $ignoreCase = false)
          {
              if ($ignoreCase) {
                  $haystack = mb_strtolower($haystack);
              }
      Severity: Minor
      Found in src/Illuminate/Support/Str.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 getCount has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = [])
      Severity: Minor
      Found in src/Illuminate/Validation/DatabasePresenceVerifier.php - About 45 mins to fix

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

            protected function resolve($name)
            {
                $config = $this->getInstanceConfig($name);
        
                if (is_null($config)) {
        Severity: Minor
        Found in src/Illuminate/Support/MultipleInstanceManager.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($job, $next)
            {
                $this->limiter = Container::getInstance()->make(RateLimiter::class);
        
                if ($this->limiter->tooManyAttempts($jobKey = $this->getKey($job), $this->maxAttempts)) {
        Severity: Minor
        Found in src/Illuminate/Queue/Middleware/ThrottlesExceptions.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 assertSentTo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function assertSentTo($notifiable, $notification, $callback = null)
            {
                if (is_array($notifiable) || $notifiable instanceof Collection) {
                    if (count($notifiable) === 0) {
                        throw new Exception('No notifiable given.');
        Severity: Minor
        Found in src/Illuminate/Support/Testing/Fakes/NotificationFake.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($job, $next)
            {
                $this->redis = Container::getInstance()->make(Redis::class);
        
                $this->limiter = new DurationLimiter(
        Severity: Minor
        Found in src/Illuminate/Queue/Middleware/ThrottlesExceptionsWithRedis.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 getCount has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = []);
        Severity: Minor
        Found in src/Illuminate/Validation/PresenceVerifierInterface.php - About 45 mins to fix

          Consider simplifying this complex logical expression.
          Open

                      if (
                          $file['type'] === 'file'
                          && (
                              (! $this->option('existing') && (! $manager->fileExists('to://'.$path) || $this->option('force')))
                              || ($this->option('existing') && $manager->fileExists('to://'.$path))
          Severity: Major
          Found in src/Illuminate/Foundation/Console/VendorPublishCommand.php - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                    if (! is_object($rule) ||
                        $rule instanceof RuleContract ||
                        ($rule instanceof Exists && $rule->queryCallbacks()) ||
                        ($rule instanceof Unique && $rule->queryCallbacks())) {
                        return $rule;
            Severity: Major
            Found in src/Illuminate/Validation/ValidationRuleParser.php - About 40 mins to fix

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

                  public function __construct($items, $total, $perPage, $currentPage = null, array $options = [])
              Severity: Minor
              Found in src/Illuminate/Pagination/LengthAwarePaginator.php - About 35 mins to fix

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

                    protected function getLine($namespace, $group, $locale, $item, array $replace)
                Severity: Minor
                Found in src/Illuminate/Translation/Translator.php - About 35 mins to fix

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

                      public function orderedChunkById($count, callable $callback, $column = null, $alias = null, $descending = false)
                  Severity: Minor
                  Found in src/Illuminate/Database/Concerns/BuildsQueries.php - About 35 mins to fix

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

                        public function __construct(Factory $factory, Engine $engine, $view, $path, $data = [])
                    Severity: Minor
                    Found in src/Illuminate/View/View.php - About 35 mins to fix

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

                          protected function paginator($items, $total, $perPage, $currentPage, $options)
                      Severity: Minor
                      Found in src/Illuminate/Database/Concerns/BuildsQueries.php - About 35 mins to fix

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

                                Filesystem $files,
                                $cachePath,
                                $basePath = '',
                                $shouldCache = true,
                                $compiledExtension = 'php')
                        Severity: Minor
                        Found in src/Illuminate/View/Compilers/Compiler.php - About 35 mins to fix

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

                              public function whereHasMorph($relation, $types, ?Closure $callback = null, $operator = '>=', $count = 1)
                          Severity: Minor
                          Found in src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php - About 35 mins to fix

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

                                public function orWhereMorphRelation($relation, $types, $column, $operator = null, $value = null)
                            Severity: Minor
                            Found in src/Illuminate/Database/Eloquent/Concerns/QueriesRelationships.php - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language