Showing 77 of 387 total issues
Method resolveReference
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function resolveReference(
string $propertyName,
array $path,
PropertyMetaDataCollection $propertyMetaDataCollection,
): PropertyInterface {
Method transferComposedPropertiesToSchema
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function transferComposedPropertiesToSchema(PropertyInterface $property): void
{
foreach ($property->getValidators() as $validator) {
$validator = $validator->getValidator();
Method process
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function process(string $propertyName, JsonSchema $propertySchema): PropertyInterface
{
$property = parent::process($propertyName, $propertySchema);
$property->onResolve(function () use ($property, $propertyName, $propertySchema): void {
Method generateValidatorPropertyMap
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function generateValidatorPropertyMap(Schema $schema, GeneratorConfiguration $generatorConfiguration): array
{
$validatorPropertyMap = [];
// get all base validators which are composed value validators and set up a map of affected object properties
Method process
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function process(Schema $schema, GeneratorConfiguration $generatorConfiguration): void
{
$json = $schema->getJsonSchema()->getJson();
if (!isset($json['patternProperties'])) {
Method validateEnum
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function validateEnum(PropertyInterface $property): bool
{
$throw = function (string $message) use ($property): void {
throw new SchemaException(
sprintf(
Method renderEnum
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function renderEnum(
GeneratorConfiguration $generatorConfiguration,
JsonSchema $jsonSchema,
string $name,
array $values,
Method __construct
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct(
GeneratorConfiguration $generatorConfiguration,
FilterInterface $filter,
PropertyInterface $property,
array $filterOptions = [],
Method processSubProperties
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function processSubProperties(
string $propertyName,
JsonSchema $propertySchema,
PropertyInterface $property,
): array {
Method process
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function process(Schema $schema, GeneratorConfiguration $generatorConfiguration): void
{
$this->transferPatternPropertiesFilterToProperty($schema, $generatorConfiguration);
$schema->addSchemaHook(
Method addUpdateAdditionalProperties
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function addUpdateAdditionalProperties(Schema $schema): void
{
$schema->addBaseValidator(
new class ($schema) extends PropertyTemplateValidator {
public function __construct(Schema $schema)
Method getCompositionProperties
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getCompositionProperties(PropertyInterface $property, JsonSchema $propertySchema): array
{
$propertyFactory = new PropertyFactory(new PropertyProcessorFactory());
$compositionProperties = [];
$json = $propertySchema->getJson()['propertySchema']->getJson();
Method __construct
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct(
SchemaProcessor $schemaProcessor,
Schema $schema,
JsonSchema $propertiesStructure,
?string $propertyName = null,
Method getTypeHint
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getTypeHint(bool $outputType = false, array $skipDecorators = []): string
{
if (isset($this->renderedTypeHints[$outputType])) {
return $this->renderedTypeHints[$outputType];
}
Method __construct
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct(
SchemaProcessor $schemaProcessor,
Schema $schema,
JsonSchema $itemStructure,
PropertyInterface $property,
Method process
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function process(Schema $schema, GeneratorConfiguration $generatorConfiguration): void
{
$json = $schema->getJsonSchema()->getJson();
if ((!$this->addForModelsWithoutAdditionalPropertiesDefinition && !isset($json['additionalProperties']))
Function addAdditionalPropertiesSerialization
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
public function addAdditionalPropertiesSerialization(
Schema $schema,
GeneratorConfiguration $generatorConfiguration,
): void {
$validationProperty = null;
- 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 validateEnum
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
private function validateEnum(PropertyInterface $property): bool
{
$throw = function (string $message) use ($property): void {
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
Method addComposedValueValidator
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addComposedValueValidator(PropertyInterface $property, JsonSchema $propertySchema): void
{
$composedValueKeywords = ['allOf', 'anyOf', 'oneOf', 'not', 'if'];
$propertyFactory = new PropertyFactory(new ComposedValueProcessorFactory($property instanceof BaseProperty));
Method addSetAdditionalPropertyMethod
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function addSetAdditionalPropertyMethod(
Schema $schema,
GeneratorConfiguration $generatorConfiguration,
?PropertyInterface $validationProperty,
): void {