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

View on GitHub
src/ModelGenerator.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

The class ModelGenerator has a coupling between objects value of 16. Consider to reduce the number of dependencies under 13.
Open

class ModelGenerator
{
    protected GeneratorConfiguration $generatorConfiguration;
    /** @var PostProcessor[] */
    protected $postProcessors = [];
Severity: Minor
Found in src/ModelGenerator.php by phpmd

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

syntax error, unexpected 'GeneratorConfiguration' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open

    protected GeneratorConfiguration $generatorConfiguration;
Severity: Critical
Found in src/ModelGenerator.php by phan

Avoid variables with short names like $ri. Configured minimum length is 3.
Open

        $ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);
Severity: Minor
Found in src/ModelGenerator.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $di. Configured minimum length is 3.
Open

        $di = new RecursiveDirectoryIterator($modelPath, FilesystemIterator::SKIP_DOTS);
Severity: Minor
Found in src/ModelGenerator.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

There must be one USE keyword per declaration
Open

use PHPModelGenerator\SchemaProcessor\PostProcessor\Internal\ {
Severity: Minor
Found in src/ModelGenerator.php by phpcodesniffer

There are no issues that match your filters.

Category
Status