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

View on GitHub

Showing 387 of 387 total issues

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

        GeneratorConfiguration $generatorConfiguration,
        FilterInterface $filter,
        PropertyInterface $property,
        array $filterOptions = [],
        ?TransformingFilterInterface $transformingFilter = null,
Severity: Minor
Found in src/Model/Validator/FilterValidator.php - About 35 mins to fix

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

            string $classPath,
            string $className,
            JsonSchema $jsonSchema,
            SchemaDefinitionDictionary $dictionary,
            bool $initialClass,
    Severity: Minor
    Found in src/SchemaProcessor/SchemaProcessor.php - About 35 mins to fix

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

              PropertyInterface $property,
              string $template,
              array $templateValues,
              string $exceptionClass,
              array $exceptionParams = [],
      Severity: Minor
      Found in src/Model/Validator/PropertyTemplateValidator.php - About 35 mins to fix

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

                PropertyMetaDataCollection $propertyMetaDataCollection,
                SchemaProcessor $schemaProcessor,
                Schema $schema,
                string $propertyName,
                JsonSchema $propertySchema,
        Severity: Minor
        Found in src/PropertyProcessor/PropertyFactory.php - About 35 mins to fix

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

                  JsonSchema $jsonSchema,
                  string $classPath,
                  string $className,
                  SchemaDefinitionDictionary $dictionary,
                  bool $initialClass = false,
          Severity: Minor
          Found in src/SchemaProcessor/SchemaProcessor.php - About 35 mins to fix

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

                    PropertyProcessorFactory $propertyProcessorFactory,
                    array $types,
                    PropertyMetaDataCollection $propertyMetaDataCollection,
                    SchemaProcessor $schemaProcessor,
                    Schema $schema,
            Severity: Minor
            Found in src/PropertyProcessor/Property/MultiTypeProcessor.php - About 35 mins to fix

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

                      GeneratorConfiguration $generatorConfiguration,
                      JsonSchema $jsonSchema,
                      string $name,
                      array $values,
                      ?array $map,
              Severity: Minor
              Found in src/SchemaProcessor/PostProcessor/EnumPostProcessor.php - About 35 mins to fix

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

                    protected function transferValidators(PropertyInterface $source, PropertyInterface $destination)
                    {
                        foreach ($source->getValidators() as $validatorContainer) {
                            $validator = $validatorContainer->getValidator();
                
                
                Severity: Minor
                Found in src/PropertyProcessor/Property/MultiTypeProcessor.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 process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function process(Schema $schema, GeneratorConfiguration $generatorConfiguration): void
                    {
                        $json = $schema->getJsonSchema()->getJson();
                
                        if (!isset($json['patternProperties'])) {

                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

                Space found after opening bracket of FOREACH loop
                Open

                                    foreach (

                Multi-line use declarations must define one parameter per line
                Open

                                    ) use ($schemaProperties, $validator): array {

                Each PHP statement must be on a line by itself
                Open

                            case ['string']: $backedType = 'string'; break;

                The implements keyword must be on the same line as the class name
                Open

                    implements ComposedPropertiesInterface, MergedComposedPropertiesInterface

                The extends keyword must be on the same line as the class name
                Open

                    extends AbstractComposedValueProcessor

                The CASE body must start on the line following the statement
                Open

                                case 'boolean': return 'bool';

                The CASE body must start on the line following the statement
                Open

                                case 'integer': return 'int';

                The CASE body must start on the line following the statement
                Open

                            case ['string']: $backedType = 'string'; break;

                Terminating statement must be on a line by itself
                Open

                            case ['string']: $backedType = 'string'; break;

                The CASE body must start on the line following the statement
                Open

                                case 'number': return 'float';

                The extends keyword must be on the same line as the class name
                Open

                    extends AbstractComposedValueProcessor
                Severity
                Category
                Status
                Source
                Language