mooxphp/moox

View on GitHub
packages/sync/src/Services/SyncService.php

Summary

Maintainability
A
2 hrs
Test Coverage

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 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 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

        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 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

        There are no issues that match your filters.

        Category
        Status