mooxphp/moox

View on GitHub

Showing 67 of 70 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 399 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

            Function moox_check_laravel_db_session has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

            function moox_check_laravel_db_session()
            {
                static $already_checked = false;
                if ($already_checked || did_action('moox_session_checked')) {
                    return;
            Severity: Minor
            Found in packages/press/wordpress/plugins/moox-press/moox-press.php - About 4 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 authenticate has a Cognitive Complexity of 23 (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/press/src/Services/Login.php - About 3 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

            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

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

                  public function authenticate(): Redirector|RedirectResponse|LoginResponse|null
                  {
                      if (! $this->isWhitelisted()) {
                          try {
                              $this->rateLimit(5);
              Severity: Major
              Found in packages/press/src/Services/Login.php - About 2 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 handle has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function handle()
                      {
                          $this->setProgress(1);
                  
                          // Beispiel-Daten (du kannst beliebige Demo-Daten hinzufügen)
                  Severity: Major
                  Found in packages/expiry/src/Jobs/CollectExpiries.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

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

                          protected function setUp(): void
                          {
                              parent::setUp();
                      
                              $this->label(config('expiry.expiry_action_name', 'Set Expiry Date'))
                      Severity: Major
                      Found in packages/expiry/src/Actions/CustomExpiryAction.php - About 2 hrs to fix

                        Function setPolicies has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function setPolicies()
                            {
                                $packages = $this->getPackageNames();
                        
                                foreach ($packages as $package) {
                        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 authenticate has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function authenticate(): Redirector|RedirectResponse|LoginResponse|null
                                {
                                    if (! $this->isWhitelisted()) {
                                        try {
                                            $this->rateLimit(5);
                            Severity: Major
                            Found in packages/user/src/Services/Login.php - 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 handleModelEvent has 50 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 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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language