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

View on GitHub
src/Model/Property/PropertyProxy.php

Summary

Maintainability
A
2 hrs
Test Coverage
D
66%

PropertyProxy has 25 functions (exceeds 20 allowed). Consider refactoring.
Open

class PropertyProxy extends AbstractProperty
{
    /** @var string */
    protected $key;
    /** @var ResolvedDefinitionsCollection */
Severity: Minor
Found in src/Model/Property/PropertyProxy.php - About 2 hrs to fix

    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
    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 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
    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 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

    syntax error, unexpected ')', expecting variable (T_VARIABLE)
    Open

        ) {
    Severity: Critical
    Found in src/Model/Property/PropertyProxy.php by phan

    Arguments with default values must be at the end of the argument list
    Open

            bool $reset = false,

    There are no issues that match your filters.

    Category
    Status