mooxphp/moox

View on GitHub

Showing 48 of 51 total issues

Model has 70 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class Model implements Arrayable, ArrayAccess, CanBeEscapedWhenCastToString, Jsonable, JsonSerializable
{
    use ForwardsCalls,
        GuardsAttributes,
        HasAttributes,
Severity: Major
Found in packages/redis-model/src/Model.php - About 1 day to fix

    File Model.php has 561 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace Moox\RedisModel;
    
    use ArrayAccess;
    Severity: Major
    Found in packages/redis-model/src/Model.php - About 1 day to fix

      File press.php has 398 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /*
      |--------------------------------------------------------------------------
      | Moox Configuration
      Severity: Minor
      Found in packages/press/config/press.php - About 5 hrs to fix

        Method useGoogleIcons has 134 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function useGoogleIcons()
            {
                FilamentIcon::register([
                    'panels::global-search.field' => 'gmdi-search-o',
                    'panels::pages.dashboard.actions.filter' => 'gmdi-filter-alt-o',
        Severity: Major
        Found in packages/core/src/Traits/GoogleIcons.php - About 5 hrs to fix

          File core.php has 359 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /*
          |--------------------------------------------------------------------------
          | Moox Configuration
          Severity: Minor
          Found in packages/core/config/core.php - About 4 hrs to fix

            Method panel has 75 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function panel(Panel $panel): Panel
                {
                    return $panel
                        ->id('press')
                        ->path('press')
            Severity: Major
            Found in app/Providers/Filament/PressPanelProvider.php - About 3 hrs to fix

              WpBasePost has 25 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class WpBasePost extends Model
              {
                  use HasFactory, Mutable;
              
                  protected $fillable = [
              Severity: Minor
              Found in packages/press/src/Models/WpBasePost.php - About 2 hrs to fix

                Method authenticate has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function authenticate(): Redirector|RedirectResponse|LoginResponse|null
                    {
                        try {
                            $this->rateLimit(5);
                        } catch (TooManyRequestsException $exception) {
                Severity: Major
                Found in packages/press/src/Services/Login.php - About 2 hrs to fix

                  Builder has 23 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Builder extends \Illuminate\Database\Eloquent\Builder
                  {
                      /**
                       * @var PhpRedisConnection
                       */
                  Severity: Minor
                  Found in packages/redis-model/src/Builder.php - About 2 hrs to fix

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

                        public function authenticate(): Redirector|RedirectResponse|LoginResponse|null
                        {
                            try {
                                $this->rateLimit(5);
                            } catch (TooManyRequestsException $exception) {
                    Severity: Minor
                    Found in packages/press/src/Services/Login.php - About 2 hrs 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 setPolicies has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function setPolicies()
                        {
                    
                            $packages = $this->getPackageNames();
                    
                    
                    Severity: Minor
                    Found in packages/core/src/CoreServiceProvider.php - About 2 hrs 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

                    WpUser has 21 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class WpUser extends Authenticatable implements FilamentUser
                    {
                        use HasFactory, Mutable, Notifiable;
                    
                        protected $fillable = [
                    Severity: Minor
                    Found in packages/press/src/Models/WpUser.php - About 2 hrs to fix

                      Function updateBackLinkAndLogo has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      (function updateBackLinkAndLogo() {
                          const backLink = document.querySelector(".edit-post-fullscreen-mode-close");
                          const postType = getQueryParam("post_type");
                      
                          if (backLink) {
                      Severity: Major
                      Found in packages/press/wordpress/plugins/moox-press/js/moox-admin.js - About 2 hrs to fix

                        Method table has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function table(Table $table): Table
                            {
                                $tabsConfig = Config::get('expiry.expiry.tabs', []);
                                $query = Expiry::query()->where('notified_to', auth()->id())->where('done_at', null);
                        
                        
                        Severity: Minor
                        Found in packages/expiry/src/Widgets/MyExpiry.php - About 2 hrs to fix

                          Method handle has 50 lines of code (exceeds 25 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 2 hrs to fix

                            Method authenticate has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function authenticate(): Redirector|RedirectResponse|LoginResponse|null
                                {
                                    try {
                                        $this->rateLimit(5);
                                    } catch (TooManyRequestsException $exception) {
                            Severity: Minor
                            Found in packages/user/src/Services/Login.php - About 1 hr to fix

                              Method resetPassword has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function resetPassword(): ?PasswordResetResponse
                                  {
                                      try {
                                          $this->rateLimit(2);
                                      } catch (TooManyRequestsException $exception) {
                              Severity: Minor
                              Found in packages/security/src/Services/ResetPassword.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

                                  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 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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language