laravel/framework

View on GitHub

Showing 864 of 1,073 total issues

Method fake has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function fake($callback = null)
    {
        $this->record();

        $this->recorded = [];
Severity: Minor
Found in src/Illuminate/Http/Client/Factory.php - About 1 hr to fix

    Method resolveAsynchronousFake has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function resolveAsynchronousFake(string $command, ?callable $output, Closure $fake)
        {
            $result = $fake($this);
    
            if (is_string($result) || is_array($result)) {
    Severity: Minor
    Found in src/Illuminate/Process/PendingProcess.php - About 1 hr to fix

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

          public function handle(Schedule $schedule, Dispatcher $dispatcher, Cache $cache, ExceptionHandler $handler)
          {
              $this->schedule = $schedule;
              $this->dispatcher = $dispatcher;
              $this->cache = $cache;
      Severity: Minor
      Found in src/Illuminate/Console/Scheduling/ScheduleRunCommand.php - About 1 hr to fix

        Method addDependencyForCallParameter has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected static function addDependencyForCallParameter(
                $container,
                $parameter,
                array &$parameters,
                &$dependencies
        Severity: Minor
        Found in src/Illuminate/Container/BoundMethod.php - About 1 hr to fix

          Method assertThrows has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function assertThrows(Closure $test, string|Closure $expectedClass = Throwable::class, ?string $expectedMessage = null)
              {
                  [$expectedClass, $expectedClassCallback] = $expectedClass instanceof Closure
                      ? [$this->firstClosureParameterType($expectedClass), $expectedClass]
                      : [$expectedClass, null];

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

                public function handle()
                {
                    if (parent::handle() === false && ! $this->option('force')) {
                        return false;
                    }
            Severity: Minor
            Found in src/Illuminate/Foundation/Console/ModelMakeCommand.php - About 1 hr to fix

              Method setUpTraits has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function setUpTraits()
                  {
                      $uses = array_flip(class_uses_recursive(static::class));
              
                      if (isset($uses[RefreshDatabase::class])) {

                Method registerWorker has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function registerWorker()
                    {
                        $this->app->singleton('queue.worker', function ($app) {
                            $isDownForMaintenance = function () {
                                return $this->app->isDownForMaintenance();
                Severity: Minor
                Found in src/Illuminate/Queue/QueueServiceProvider.php - About 1 hr to fix

                  Function componentClass has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function componentClass(string $component)
                      {
                          $viewFactory = Container::getInstance()->make(Factory::class);
                  
                          if (isset($this->aliases[$component])) {
                  Severity: Minor
                  Found in src/Illuminate/View/Compilers/ComponentTagCompiler.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 assertSessionHasInput has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function assertSessionHasInput($key, $value = null)
                      {
                          if (is_array($key)) {
                              foreach ($key as $k => $v) {
                                  if (is_int($k)) {
                  Severity: Minor
                  Found in src/Illuminate/Testing/TestResponse.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 setAttribute has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function setAttribute($key, $value)
                      {
                          // First we will check for the presence of a mutator for the set operation
                          // which simply lets the developers tweak the attribute as it is set on
                          // this model, such as "json_encoding" a listing of data for storage.
                  Severity: Minor
                  Found in src/Illuminate/Database/Eloquent/Concerns/HasAttributes.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 prepareNestedWithRelationships has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function prepareNestedWithRelationships($relations, $prefix = '')
                      {
                          $preparedRelationships = [];
                  
                          if ($prefix !== '') {
                  Severity: Minor
                  Found in src/Illuminate/Database/Eloquent/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 match has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function match(Request $request)
                      {
                          $matcher = new CompiledUrlMatcher(
                              $this->compiled, (new RequestContext)->fromRequest(
                                  $trimmedRequest = $this->requestWithoutTrailingSlash($request)
                  Severity: Minor
                  Found in src/Illuminate/Routing/CompiledRouteCollection.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 hasIndex has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function hasIndex($table, $index, $type = null)
                      {
                          $type = is_null($type) ? $type : strtolower($type);
                  
                          foreach ($this->getIndexes($table) as $value) {
                  Severity: Minor
                  Found in src/Illuminate/Database/Schema/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 accepts has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function accepts($contentTypes)
                      {
                          $accepts = $this->getAcceptableContentTypes();
                  
                          if (count($accepts) === 0) {
                  Severity: Minor
                  Found in src/Illuminate/Http/Concerns/InteractsWithContentTypes.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 getStub has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function getStub()
                      {
                          $stub = null;
                  
                          if ($type = $this->option('type')) {
                  Severity: Minor
                  Found in src/Illuminate/Routing/Console/ControllerMakeCommand.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 sortMiddleware has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function sortMiddleware($priorityMap, $middlewares)
                      {
                          $lastIndex = 0;
                  
                          foreach ($middlewares as $index => $middleware) {
                  Severity: Minor
                  Found in src/Illuminate/Routing/SortedMiddleware.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 dropAllTypes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function dropAllTypes()
                      {
                          $types = [];
                          $domains = [];
                  
                  
                  Severity: Minor
                  Found in src/Illuminate/Database/Schema/PostgresBuilder.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 handle has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function handle(Schedule $schedule, Dispatcher $dispatcher, Cache $cache, ExceptionHandler $handler)
                      {
                          $this->schedule = $schedule;
                          $this->dispatcher = $dispatcher;
                          $this->cache = $cache;
                  Severity: Minor
                  Found in src/Illuminate/Console/Scheduling/ScheduleRunCommand.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 handle has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function handle()
                      {
                          $this->components->info(
                              'Running scheduled tasks every minute.',
                              $this->getLaravel()->isLocal() ? OutputInterface::VERBOSITY_NORMAL : OutputInterface::VERBOSITY_VERBOSE
                  Severity: Minor
                  Found in src/Illuminate/Console/Scheduling/ScheduleWorkCommand.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

                  Severity
                  Category
                  Status
                  Source
                  Language