Finesse/Wired

View on GitHub

Showing 30 of 34 total issues

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

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

            ModelInterface $parent,
            ModelInterface $child,
            $parentKey,
            $childKey,
            callable $extraFieldsMaker = null,
    Severity: Minor
    Found in src/Relations/BelongsToMany.php - About 45 mins to fix

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

              $parents,
              string $relationName,
              $children,
              bool $keepOther = false,
              callable $getAttachmentData = null,
      Severity: Minor
      Found in src/MapperFeatures/AttachTrait.php - About 45 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/BelongsToMany.php - About 45 mins to fix

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

                  ModelQuery $query,
                  string $parentField,
                  string $childField,
                  string $childClass,
                  array $models
          Severity: Minor
          Found in src/Relations/RelationHelpers.php - About 35 mins to fix

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

                    ModelQuery $query,
                    string $parentField,
                    string $childField,
                    string $childClass,
                    ModelInterface $model
            Severity: Minor
            Found in src/Relations/RelationHelpers.php - About 35 mins to fix

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

                      ModelQuery $query,
                      string $parentField,
                      string $childField,
                      string $childClass,
                      \Closure $clause = null
              Severity: Minor
              Found in src/Relations/RelationHelpers.php - About 35 mins to fix

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

                        ModelQuery $query,
                        string $parentField,
                        string $childField,
                        string $childClass,
                        $constraint
                Severity: Minor
                Found in src/Relations/RelationHelpers.php - About 35 mins to fix

                  Function collectModelsCyclicRelatives has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function collectModelsCyclicRelatives(array $models, string $relation): array
                      {
                          // The goal is to track the list of unique models
                          // We can't index the relatives list by models identifiers because a model can have no identifier
                          // Using SplObjectStorage is the faster than using in_array or spl_object_hash: https://3v4l.org/h6YA6
                  Severity: Minor
                  Found in src/Helpers.php - About 35 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 deleteModelsOfSameClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function deleteModelsOfSameClass(array $models)
                      {
                          $sampleModel = reset($models);
                          $identifierField = $sampleModel::getIdentifierField();
                          $ids = [];
                  Severity: Minor
                  Found in src/Mapper.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