mooxphp/moox

View on GitHub

Showing 58 of 61 total issues

Method request has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function request(): void
    {
        try {
            $this->rateLimit(2);
        } catch (TooManyRequestsException $exception) {
Severity: Minor
Found in packages/security/src/Services/RequestPasswordReset.php - About 1 hr to fix

    Method setUp has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function setUp(): void
        {
            parent::setUp();
    
            $this

      Function authenticate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function authenticate(): Redirector|RedirectResponse|LoginResponse|null
          {
              if (! $this->isWhitelisted()) {
                  try {
                      $this->rateLimit(5);
      Severity: Minor
      Found in packages/user/src/Services/Login.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

      Method handleModelEvent has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function handleModelEvent($model, $eventType)
          {
              if (! $this->currentPlatform) {
                  $this->logDebug('Moox Sync: Model event ignored - current platform not set', ['model' => get_class($model), 'event' => $eventType]);
      
      
      Severity: Minor
      Found in packages/sync/src/Listener/SyncListener.php - About 1 hr to fix

        Method sendToWebhook has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function sendToWebhook(Platform $platform, bool $shouldDelete)
            {
                $webhookPath = config('sync.sync_webhook_url', '/sync-webhook');
                $syncToken = config('sync.sync_token');
                $webhookUrl = 'https://'.$platform->domain.$webhookPath;
        Severity: Minor
        Found in packages/sync/src/Jobs/PrepareSyncJob.php - About 1 hr to fix

          Method addUserDevice has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function addUserDevice(Request $request, $user, Agent $agent)
              {
                  $ipAddress = $request->ip();
                  $userAgent = $request->userAgent();
                  $user_id = $user->getAuthIdentifier();
          Severity: Minor
          Found in packages/user-device/src/Services/UserDeviceTracker.php - About 1 hr to fix

            Function get_user_id_from_laravel_session has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            function get_user_id_from_laravel_session($sessionId)
            {
                error_log('Attempting to get user ID for session: '.$sessionId);
            
                // Use WordPress database credentials for Laravel connection
            Severity: Minor
            Found in packages/press/wordpress/plugins/moox-press/moox-press.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

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

                protected static function boot()
                {
                    parent::boot();
            
                    static::created(function ($model) {
            Severity: Minor
            Found in packages/press/src/Models/WpUser.php - About 1 hr to fix

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

                  protected function sendWebhook(Platform $platform, Platform $targetPlatform)
                  {
                      $webhookPath = config('sync.sync_webhook_url', '/sync-webhook');
                      $webhookUrl = 'https://'.$targetPlatform->domain.$webhookPath;
                      $syncToken = config('sync.sync_token');
              Severity: Minor
              Found in packages/sync/src/Jobs/SyncPlatformJob.php - About 1 hr to fix

                Function insert has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function insert(array $dataInsert, ?Redis $hasTransaction = null)
                    {
                        $inserts = [];
                        $build = static::query();
                        $model = $build->getModel();
                Severity: Minor
                Found in packages/redis-model/src/Model.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 fill has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function fill(array $attributes)
                    {
                        $totallyGuarded = $this->totallyGuarded();
                
                        $fillable = $this->fillableFromArray($attributes);
                Severity: Minor
                Found in packages/redis-model/src/Model.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

                Method invokeWebhooks has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function invokeWebhooks(array $data)
                    {
                        $webhookPath = config('sync.sync_webhook_url', '/sync-webhook');
                        $syncToken = config('sync.sync_token');
                
                
                Severity: Minor
                Found in packages/sync/src/Jobs/PrepareSyncJob.php - About 1 hr to fix

                  Method performInsert has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function performInsert(Builder $build)
                      {
                          // First we'll need to create a fresh query instance and touch the creation and
                          // update timestamps on this model, which are maintained by us for developer
                          // convenience. After, we will just continue saving these model instances.
                  Severity: Minor
                  Found in packages/redis-model/src/Model.php - About 1 hr to fix

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

                        public static function boot()
                        {
                            parent::boot();
                    
                            static::created(function ($wpTerm) {
                    Severity: Minor
                    Found in packages/press/src/Models/WpTerm.php - About 1 hr to fix

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

                          public function handle()
                          {
                              $this->setProgress(1);
                      
                              $invitationRequests = Training::where('due_at', '<', now())
                      Severity: Minor
                      Found in packages/trainings/src/Jobs/SendInvitationRequests.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 log has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function log($level, $message, array $context = [])
                          {
                              $verboseLevel = Config::get('core.logging.verbose_level', 0);
                              $logInProduction = Config::get('core.logging.log_in_production', false);
                      
                      
                      Severity: Minor
                      Found in packages/core/src/Traits/LogLevel.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 frontControllerPath has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function frontControllerPath(string $sitePath, string $siteName, string $uri): ?string
                          {
                              $public = '/public';
                              $wpslug = '/wp';
                      
                      
                      Severity: Minor
                      Found in LocalValetDriver.mac.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 performInsert has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function performInsert(Builder $build)
                          {
                              // First we'll need to create a fresh query instance and touch the creation and
                              // update timestamps on this model, which are maintained by us for developer
                              // convenience. After, we will just continue saving these model instances.
                      Severity: Minor
                      Found in packages/redis-model/src/Model.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 frontControllerPath has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function frontControllerPath(string $sitePath, string $siteName, string $uri): ?string
                          {
                              $public = '/public';
                              $wpslug = '/wp';
                      
                      
                      Severity: Minor
                      Found in LocalValetDriver.win.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

                      Method fill has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function fill(array $attributes)
                          {
                              $totallyGuarded = $this->totallyGuarded();
                      
                              $fillable = $this->fillableFromArray($attributes);
                      Severity: Minor
                      Found in packages/redis-model/src/Model.php - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language