wol-soft/php-json-schema-model-generator

View on GitHub
src/PropertyProcessor/ComposedValue/AbstractComposedValueProcessor.php

Summary

Maintainability
A
3 hrs
Test Coverage
A
100%

Method generateValidators has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function generateValidators(PropertyInterface $property, JsonSchema $propertySchema): void
    {
        $json = $propertySchema->getJson()['propertySchema']->getJson();

        if (empty($json[$propertySchema->getJson()['type']]) &&

    Method getCompositionProperties has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function getCompositionProperties(PropertyInterface $property, JsonSchema $propertySchema): array
        {
            $propertyFactory = new PropertyFactory(new PropertyProcessorFactory());
            $compositionProperties = [];
            $json = $propertySchema->getJson()['propertySchema']->getJson();

      The class AbstractComposedValueProcessor has a coupling between objects value of 19. Consider to reduce the number of dependencies under 13.
      Open

      abstract class AbstractComposedValueProcessor extends AbstractValueProcessor
      {
          /** @var bool */
          private $rootLevelComposition;
          /** @var PropertyInterface|null */

      CouplingBetweenObjects

      Since: 1.1.0

      A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

      Example

      class Foo {
          /**
           * @var \foo\bar\X
           */
          private $x = null;
      
          /**
           * @var \foo\bar\Y
           */
          private $y = null;
      
          /**
           * @var \foo\bar\Z
           */
          private $z = null;
      
          public function setFoo(\Foo $foo) {}
          public function setBar(\Bar $bar) {}
          public function setBaz(\Baz $baz) {}
      
          /**
           * @return \SplObjectStorage
           * @throws \OutOfRangeException
           * @throws \InvalidArgumentException
           * @throws \ErrorException
           */
          public function process(\Iterator $it) {}
      
          // ...
      }

      Source https://phpmd.org/rules/design.html#couplingbetweenobjects

      syntax error, unexpected ')', expecting variable (T_VARIABLE)
      Open

          ) {

      Multi-line function call not indented correctly; expected 32 spaces but found 34
      Open

                                        )

      Line indented incorrectly; expected 8 spaces, found 20
      Open

                          static function (CompositionPropertyDecorator $property): string {

      Line indented incorrectly; expected 8 spaces, found 20
      Open

                          },

      There are no issues that match your filters.

      Category
      Status