Showing 77 of 387 total issues
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
PropertyInterface $property,
string $template,
array $templateValues,
string $exceptionClass,
array $exceptionParams = [],
Method create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
PropertyMetaDataCollection $propertyMetaDataCollection,
SchemaProcessor $schemaProcessor,
Schema $schema,
string $propertyName,
JsonSchema $propertySchema,
Method processSchema
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
JsonSchema $jsonSchema,
string $classPath,
string $className,
SchemaDefinitionDictionary $dictionary,
bool $initialClass = false,
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
PropertyProcessorFactory $propertyProcessorFactory,
array $types,
PropertyMetaDataCollection $propertyMetaDataCollection,
SchemaProcessor $schemaProcessor,
Schema $schema,
Method renderEnum
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
GeneratorConfiguration $generatorConfiguration,
JsonSchema $jsonSchema,
string $name,
array $values,
?array $map,
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();
- 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 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'])) {
- 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
Avoid too many return
statements within this method. Open
return $this->properties;
Function process
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function process(string $propertyName, JsonSchema $propertySchema): PropertyInterface
{
$path = [];
$reference = $propertySchema->getJson()['$ref'];
$dictionary = $this->schema->getSchemaDictionary();
- 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 hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function hash(array $array, array $relevantFields = []): string
{
if ($relevantFields) {
foreach ($array as $key => $_) {
if (!in_array($key, $relevantFields)) {
- 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 addAdditionalPropertiesCollectionProperty
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function addAdditionalPropertiesCollectionProperty(Schema $schema): void
{
$validationProperty = null;
foreach ($schema->getBaseValidators() as $validator) {
if (is_a($validator, AdditionalPropertiesValidator::class)) {
- 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 redirectMergedProperty
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function redirectMergedProperty(array $compositionProperties)
{
$redirectToProperty = null;
foreach ($compositionProperties as $property) {
if ($property->getNestedSchema()) {
- 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 generateValidators
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function generateValidators(PropertyInterface $property, JsonSchema $propertySchema): void
{
parent::generateValidators($property, $propertySchema);
$this->addLengthValidation($property, $propertySchema);
- 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 addEnumValidator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addEnumValidator(PropertyInterface $property, array $allowedValues): void
{
if (empty($allowedValues)) {
throw new SchemaException(
sprintf(
- 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 validateFilterCompatibilityWithBaseType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function validateFilterCompatibilityWithBaseType(FilterInterface $filter, PropertyInterface $property)
{
if (empty($filter->getAcceptedTypes()) || !$property->getType()) {
return;
}
- 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 inheritIfPropertyType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function inheritIfPropertyType(JsonSchema $propertySchema): JsonSchema
{
$json = $propertySchema->getJson();
foreach (['if', 'then', 'else'] as $composedValueKeyword) {
- 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 generateValidators
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function generateValidators(PropertyInterface $property, JsonSchema $propertySchema): void
{
$json = $propertySchema->getJson()['propertySchema']->getJson();
if (!isset($json['then']) && !isset($json['else'])) {
- 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"