Showing 77 of 387 total issues
Method __construct
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(
SchemaProcessor $schemaProcessor,
Schema $schema,
string $pattern,
JsonSchema $propertyStructure,
Method process
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(string $propertyName, JsonSchema $propertySchema): PropertyInterface
{
$path = [];
$reference = $propertySchema->getJson()['$ref'];
$dictionary = $this->schema->getSchemaDictionary();
Method addEnumValidator
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addEnumValidator(PropertyInterface $property, array $allowedValues): void
{
if (empty($allowedValues)) {
throw new SchemaException(
sprintf(
Method __construct
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(
SchemaProcessor $schemaProcessor,
Schema $schema,
JsonSchema $propertiesStructure,
string $propertyName,
Method addTransformedValuePassThrough
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addTransformedValuePassThrough(
PropertyInterface $property,
TransformingFilterInterface $filter,
ReflectionType $filteredType,
): void {
Function addFilter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function addFilter(FilterInterface ...$additionalFilter): self
{
foreach ($additionalFilter as $filter) {
$this->validateFilterCallback(
$filter->getFilter(),
- Read upRead up
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 addComposedValueValidator
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function addComposedValueValidator(PropertyInterface $property, JsonSchema $propertySchema): void
{
$composedValueKeywords = ['allOf', 'anyOf', 'oneOf', 'not', 'if'];
$propertyFactory = new PropertyFactory(new ComposedValueProcessorFactory($property instanceof BaseProperty));
- Read upRead up
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 transferComposedPropertiesToSchema
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function transferComposedPropertiesToSchema(PropertyInterface $property): void
{
foreach ($property->getValidators() as $validator) {
$validator = $validator->getValidator();
- Read upRead up
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 resolveReference
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function resolveReference(
string $propertyName,
array $path,
PropertyMetaDataCollection $propertyMetaDataCollection,
): PropertyInterface {
- Read upRead up
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 processSubProperties
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function processSubProperties(
string $propertyName,
JsonSchema $propertySchema,
PropertyInterface $property,
): array {
- Read upRead up
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
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
GeneratorConfiguration $generatorConfiguration,
PropertyInterface $property,
string $template,
array $templateValues,
string $exceptionClass,
Function inheritPropertyType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function inheritPropertyType(JsonSchema $propertySchema, string $composedValueKeyword): JsonSchema
{
$json = $propertySchema->getJson();
if (!isset($json['type'])) {
- Read upRead up
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 getDefinition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getDefinition(string $key, SchemaProcessor $schemaProcessor, array &$path = []): ?SchemaDefinition
{
if (strpos($key, '#') === 0 && strpos($key, '/')) {
$path = explode('/', $key);
array_shift($path);
- Read upRead up
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 renderEnum
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function renderEnum(
GeneratorConfiguration $generatorConfiguration,
JsonSchema $jsonSchema,
string $name,
array $values,
- Read upRead up
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
Consider simplifying this complex logical expression. Open
if ((!$this->addForModelsWithoutAdditionalPropertiesDefinition && !isset($json['additionalProperties']))
|| (isset($json['additionalProperties']) && $json['additionalProperties'] === false)
|| (!isset($json['additionalProperties']) && $generatorConfiguration->denyAdditionalProperties())
) {
return;
Method addRangeValidator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
PropertyInterface $property,
JsonSchema $propertySchema,
string $field,
string $check,
string $exceptionClass,
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $classPath,
string $className,
JsonSchema $schema,
?SchemaDefinitionDictionary $dictionary = null,
bool $initialClass = false,
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
GeneratorConfiguration $generatorConfiguration,
PropertyInterface $property,
array $composedProperties,
string $compositionProcessor,
array $validatorVariables,
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
GeneratorConfiguration $generatorConfiguration,
FilterInterface $filter,
PropertyInterface $property,
array $filterOptions = [],
?TransformingFilterInterface $transformingFilter = null,
Method generateModel
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $classPath,
string $className,
JsonSchema $jsonSchema,
SchemaDefinitionDictionary $dictionary,
bool $initialClass,