mooxphp/moox

View on GitHub

Showing 58 of 61 total issues

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

    public function formatSeconds(int $seconds): string
    {

        $days = 0;
        $hours = 0;
Severity: Minor
Found in packages/jobs/src/Traits/FormatSeconds.php - About 1 hr to fix

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

        public function __construct($identifierField, $identifierValue, $modelClass, $eventType, $platformId, $syncConfigurations)
    Severity: Minor
    Found in packages/sync/src/Jobs/PrepareSyncJob.php - About 45 mins to fix

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

          public function __construct($modelClass, $modelData, $eventType, Platform $sourcePlatform, Platform $targetPlatform, bool $shouldDelete)
      Severity: Minor
      Found in packages/sync/src/Jobs/SyncJob.php - About 45 mins to fix

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

            protected function processSyncEvent($modelClass, array $modelData, string $eventType, Platform $targetPlatform, $sync)
        Severity: Minor
        Found in packages/sync/src/Services/SyncService.php - About 35 mins to fix

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

              protected function syncToSinglePlatform($modelClass, array $modelData, string $eventType, Platform $sourcePlatform, Platform $targetPlatform)
          Severity: Minor
          Found in packages/sync/src/Services/SyncService.php - About 35 mins to fix

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

                public function performSync($modelClass, array $modelData, string $eventType, Platform $sourcePlatform, ?Platform $targetPlatform = null)
            Severity: Minor
            Found in packages/sync/src/Services/SyncService.php - About 35 mins to fix

              Avoid too many return statements within this method.
              Open

                      return $this->convertForWindows($sitePath.$public.'/index.php');
              Severity: Major
              Found in LocalValetDriver.win.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return $sitePath.$public.'/index.php';
                Severity: Major
                Found in LocalValetDriver.mac.php - About 30 mins to fix

                  Function encode64 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function encode64($input, $count)
                      {
                          $output = '';
                          $i = 0;
                          do {
                  Severity: Minor
                  Found in packages/security/src/Helper/PasswordHash.php - About 25 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 HashPassword has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function HashPassword($password)
                      {
                          $random = '';
                  
                          if (CRYPT_BLOWFISH === 1 && ! $this->portable_hashes) {
                  Severity: Minor
                  Found in packages/security/src/Helper/PasswordHash.php - About 25 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 crypt_private has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function crypt_private($password, $setting)
                      {
                          $output = '*0';
                          if (substr($setting, 0, 2) === $output) {
                              $output = '*1';
                  Severity: Minor
                  Found in packages/security/src/Helper/PasswordHash.php - About 25 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 createOrUpdateModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function createOrUpdateModel($modelClass, array $modelData, Platform $targetPlatform)
                      {
                          $uniqueFields = config('sync.unique_identifier_fields', ['ulid', 'uuid', 'slug', 'name', 'title']);
                          $uniqueIdentifier = null;
                  
                  
                  Severity: Minor
                  Found in packages/sync/src/Services/SyncService.php - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function handle()
                      {
                          try {
                              if ($this->shouldDelete) {
                                  $this->deleteModel();
                  Severity: Minor
                  Found in packages/sync/src/Jobs/SyncJob.php - About 25 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 processSyncEvent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function processSyncEvent($modelClass, array $modelData, string $eventType, Platform $targetPlatform, $sync)
                      {
                          $this->logDebug('Processing sync event', [
                              'modelClass' => $modelClass,
                              'eventType' => $eventType,
                  Severity: Minor
                  Found in packages/sync/src/Services/SyncService.php - About 25 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 transformCustomFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function transformCustomFields(array $data): array
                      {
                          $this->logDebug('Moox Press: Transform custom fields', [
                              'data' => $data,
                          ]);
                  Severity: Minor
                  Found in packages/press/src/Transformer/WpUserTransformer.php - About 25 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 isWhitelisted has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function isWhitelisted(): bool
                      {
                          $ipAddress = request()->ip();
                  
                          $ipWhiteList = config('press.ip_whitelist');
                  Severity: Minor
                  Found in packages/press/src/Services/Login.php - About 25 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 index has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function index()
                      {
                          $packages = config('core.packages');
                          $available_models = [];
                  
                  
                  Severity: Minor
                  Found in packages/core/src/Http/Controllers/Api/ModelController.php - About 25 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 isWhitelisted has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function isWhitelisted(): bool
                      {
                          $ipAddress = request()->ip();
                  
                          $ipWhiteList = config('user.ip_whitelist');
                  Severity: Minor
                  Found in packages/user/src/Services/Login.php - About 25 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

                  Severity
                  Category
                  Status
                  Source
                  Language