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

View on GitHub

Showing 397 of 397 total issues

The method resolveSetterBeforeValidationHook has a boolean flag argument $batchUpdate, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function resolveSetterBeforeValidationHook(PropertyInterface $property, bool $batchUpdate = false): string

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method __construct has a boolean flag argument $initialClass, which is a certain sign of a Single Responsibility Principle violation.
Open

        bool $initialClass = false,
Severity: Minor
Found in src/Model/Schema.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method getCode has a boolean flag argument $batchUpdate, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getCode(PropertyInterface $property, bool $batchUpdate = false): string;

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method processSchema has a boolean flag argument $initialClass, which is a certain sign of a Single Responsibility Principle violation.
Open

        bool $initialClass = false,

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method getType has a boolean flag argument $outputType, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getType(bool $outputType = false): ?PropertyType;

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method getCode has a boolean flag argument $batchUpdate, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getCode(PropertyInterface $property, bool $batchUpdate = false): string;

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method __construct has a boolean flag argument $skipNonMappedEnums, which is a certain sign of a Single Responsibility Principle violation.
Open

        bool $skipNonMappedEnums = false,

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method setType has a boolean flag argument $reset, which is a certain sign of a Single Responsibility Principle violation.
Open

        bool $reset = false,
Severity: Minor
Found in src/Model/Property/PropertyProxy.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method setDefaultValue has a boolean flag argument $raw, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function setDefaultValue($defaultValue, bool $raw = false): PropertyInterface
Severity: Minor
Found in src/Model/Property/PropertyProxy.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Avoid too many return statements within this method.
Open

        return $this->properties;
Severity: Major
Found in src/Model/Schema.php - About 30 mins to fix

    The method setDefaultValue has a boolean flag argument $raw, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function setDefaultValue($defaultValue, bool $raw = false): PropertyInterface;

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method __construct has a boolean flag argument $addForModelsWithoutAdditionalPropertiesDefinition, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function __construct(bool $addForModelsWithoutAdditionalPropertiesDefinition = false)

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method addValidationCallsToSetterMethods has a boolean flag argument $batchUpdate, which is a certain sign of a Single Responsibility Principle violation.
    Open

                public function getCode(PropertyInterface $property, bool $batchUpdate = false): string

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method setDefaultValue has a boolean flag argument $raw, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function setDefaultValue($defaultValue, bool $raw = false): PropertyInterface
    Severity: Minor
    Found in src/Model/Property/Property.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Remove error control operator '@' on line 63.
    Open

        protected function addPatternValidator(PropertyInterface $property, JsonSchema $propertySchema): void
        {
            $json = $propertySchema->getJson();
    
            if (!isset($json[static::JSON_FIELD_PATTERN])) {

    ErrorControlOperator

    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

    Example

    function foo($filePath) {
        $file = @fopen($filPath); // hides exceptions
        $key = @$array[$notExistingKey]; // assigns null to $key
    }

    Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

    The method resolveSetterAfterValidationHook has a boolean flag argument $batchUpdate, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function resolveSetterAfterValidationHook(PropertyInterface $property, bool $batchUpdate = false): string

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method process has a boolean flag argument $batchUpdate, which is a certain sign of a Single Responsibility Principle violation.
    Open

                    public function getCode(PropertyInterface $property, bool $batchUpdate = false): string

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method setType has a boolean flag argument $reset, which is a certain sign of a Single Responsibility Principle violation.
    Open

            bool $reset = false,

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method getTypeHint has a boolean flag argument $outputType, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getTypeHint(bool $outputType = false, array $skipDecorators = []): string;

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method getAttribute has a boolean flag argument $variableName, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getAttribute(bool $variableName = false): string

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Severity
    Category
    Status
    Source
    Language