Finesse/Wired

View on GitHub

Showing 30 of 34 total issues

File BelongsToMany.php has 338 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
 
namespace Finesse\Wired\Relations;
 
use Finesse\MiniDB\Database;
Severity: Minor
Found in src/Relations/BelongsToMany.php - About 4 hrs to fix

    Method attach has 97 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    public function attach(
    Mapper $mapper,
    array $parents,
    array $children,
    string $onMatch,
    Severity: Major
    Found in src/Relations/BelongsToMany.php - About 3 hrs to fix

      Function updateAttachmentsGroup has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

      protected function updateAttachmentsGroup(
      $parentId,
      $childId,
      array $parents,
      array $children,
      Severity: Minor
      Found in src/Relations/BelongsToMany.php - About 3 hrs to fix

      Function attach has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

      public function attach(
      Mapper $mapper,
      array $parents,
      array $children,
      string $onMatch,
      Severity: Minor
      Found in src/Relations/BelongsToMany.php - About 3 hrs to fix

      Method updateAttachmentsGroup has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      protected function updateAttachmentsGroup(
      $parentId,
      $childId,
      array $parents,
      array $children,
      Severity: Major
      Found in src/Relations/BelongsToMany.php - About 2 hrs to fix

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

        protected function loadCyclicRelativesForModelsOfSameClass(
        array $models,
        string $relationName,
        \Closure $clause = null,
        bool $onlyMissing = false
        Severity: Minor
        Found in src/MapperFeatures/LoadTrait.php - About 2 hrs to fix

          Function filterModelRelatives has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

          public static function filterModelRelatives(ModelInterface $model, string $relation, callable $filter)
          {
          if (!$model->doesHaveLoadedRelatives($relation)) {
          return;
          }
          Severity: Minor
          Found in src/Helpers.php - About 1 hr to fix

          Method loadRelatives has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          public function loadRelatives(Mapper $mapper, string $name, array $parents, \Closure $constraint = null)
          {
          if (!$parents) {
          return;
          }
          Severity: Minor
          Found in src/Relations/BelongsToMany.php - About 1 hr to fix

            Method saveModel has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            protected function saveModel(ModelInterface $model, string $mode)
            {
            $identifierField = $model::getIdentifierField();
            $row = $model->convertToRow();
            $doUpdate = false;
            Severity: Minor
            Found in src/Mapper.php - About 1 hr to fix

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

              public function loadRelatives(Mapper $mapper, string $name, array $parents, \Closure $constraint = null)
              {
              if (!$parents) {
              return;
              }
              Severity: Minor
              Found in src/Relations/BelongsToMany.php - About 1 hr to fix

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

              public static function filterModelRelatives(ModelInterface $model, string $relation, callable $filter)
              {
              if (!$model->doesHaveLoadedRelatives($relation)) {
              return;
              }
              Severity: Minor
              Found in src/Helpers.php - About 1 hr to fix

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

                public static function collectModelsRelatives(array $models, string $relation): array
                {
                $modelsSet = new \SplObjectStorage;
                foreach ($models as $model) {
                $modelsSet->attach($model);
                Severity: Minor
                Found in src/Helpers.php - About 1 hr to fix

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

                public function loadRelatives(Mapper $mapper, string $name, array $parents, \Closure $constraint = null)
                {
                if (!$parents) {
                return;
                }
                Severity: Minor
                Found in src/Relations/EqualFields.php - About 1 hr to fix

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

                protected function loadCyclicRelativesForModelsOfSameClass(
                array $models,
                string $relationName,
                \Closure $clause = null,
                bool $onlyMissing = false
                Severity: Minor
                Found in src/MapperFeatures/LoadTrait.php - About 1 hr to fix

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

                public static function wrapException(\Throwable $exception): \Throwable
                {
                if ($exception instanceof ExceptionInterface) {
                return $exception;
                }
                Severity: Minor
                Found in src/Helpers.php - About 1 hr to fix

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

                public function loadRelatives(Mapper $mapper, string $name, array $parents, \Closure $constraint = null)
                {
                if (!$parents) {
                return;
                }
                Severity: Minor
                Found in src/Relations/EqualFields.php - About 1 hr to fix

                  Function loadRelativesForModelsOfSameClass has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  protected function loadRelativesForModelsOfSameClass(
                  array $models,
                  string $relationName,
                  \Closure $clause = null,
                  bool $onlyMissing = false
                  Severity: Minor
                  Found in src/MapperFeatures/LoadTrait.php - About 55 mins to fix

                  Function saveModel has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  protected function saveModel(ModelInterface $model, string $mode)
                  {
                  $identifierField = $model::getIdentifierField();
                  $row = $model->convertToRow();
                  $doUpdate = false;
                  Severity: Minor
                  Found in src/Mapper.php - About 55 mins to fix

                  Method attachWithDetails has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  $parents,
                  string $relationName,
                  $children,
                  string $onMatch,
                  bool $detachOther,
                  Severity: Major
                  Found in src/MapperFeatures/AttachTrait.php - About 50 mins to fix

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

                    Mapper $mapper,
                    array $parents,
                    array $children,
                    string $onMatch,
                    bool $detachOther,
                    Severity: Minor
                    Found in src/Relations/AttachableRelationInterface.php - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language