Showing 77 of 387 total issues
Function process
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function process(
PropertyInterface $property,
$filterList,
GeneratorConfiguration $generatorConfiguration,
Schema $schema,
- 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
GeneratorConfiguration
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class GeneratorConfiguration
{
/** @var string */
protected $namespacePrefix = '';
/** @var bool */
Method process
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(
PropertyInterface $property,
$filterList,
GeneratorConfiguration $generatorConfiguration,
Schema $schema,
Function transferPatternPropertiesFilterToProperty
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function transferPatternPropertiesFilterToProperty(
Schema $schema,
GeneratorConfiguration $generatorConfiguration,
): void {
$patternPropertiesValidators = array_filter(
- 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
PropertyProxy
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class PropertyProxy extends AbstractProperty
{
/** @var string */
protected $key;
/** @var ResolvedDefinitionsCollection */
Schema
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Schema
{
use JsonSchemaTrait;
/** @var string */
Property
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Property extends AbstractProperty
{
/** @var PropertyType */
protected $type;
/** @var PropertyType|null */
Method transferPatternPropertiesFilterToProperty
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function transferPatternPropertiesFilterToProperty(
Schema $schema,
GeneratorConfiguration $generatorConfiguration,
): void {
$patternPropertiesValidators = array_filter(
Method process
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(Schema $schema, GeneratorConfiguration $generatorConfiguration): void
{
$generatorConfiguration->addFilter(new EnumFilter());
foreach ($schema->getProperties() as $property) {
Function addSerializeFunctionsForTransformingFilters
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function addSerializeFunctionsForTransformingFilters(
Schema $schema,
GeneratorConfiguration $generatorConfiguration,
): void {
foreach ($schema->getProperties() as $property) {
- 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 addSerializeFunctionsForTransformingFilters
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addSerializeFunctionsForTransformingFilters(
Schema $schema,
GeneratorConfiguration $generatorConfiguration,
): void {
foreach ($schema->getProperties() as $property) {
Method generateValidators
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateValidators(PropertyInterface $property, JsonSchema $propertySchema): void
{
$json = $propertySchema->getJson()['propertySchema']->getJson();
if (!isset($json['then']) && !isset($json['else'])) {
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 getCheck
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCheck(): string
{
/**
* Add a method to the schema to gather values from a nested object which are modified.
* This is required to adopt filter changes to the values which are passed into a merged property
Method createMergedProperty
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createMergedProperty(
Schema $schema,
PropertyInterface $property,
array $compositionProperties,
JsonSchema $propertySchema,
Function process
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function process(Schema $schema, GeneratorConfiguration $generatorConfiguration): void
{
$generatorConfiguration->addFilter(new EnumFilter());
foreach ($schema->getProperties() as $property) {
- 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 generateValidatorPropertyMap
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. 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
- 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 addAdditionalPropertiesSerialization
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addAdditionalPropertiesSerialization(
Schema $schema,
GeneratorConfiguration $generatorConfiguration,
): void {
$validationProperty = null;
Function process
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function process(Schema $schema, GeneratorConfiguration $generatorConfiguration): void
{
$json = $schema->getJsonSchema()->getJson();
if ((!$this->addForModelsWithoutAdditionalPropertiesDefinition && !isset($json['additionalProperties']))
- 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 process
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(string $propertyName, JsonSchema $propertySchema): PropertyInterface
{
$property = parent::process($propertyName, $propertySchema);
$className = $this->schemaProcessor->getGeneratorConfiguration()->getClassNameGenerator()->getClassName(