Formula9/Framework

View on GitHub
Nine/Database/NineBase.php

Summary

Maintainability
A
0 mins
Test Coverage

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

class NineBase
{
    /** @var PDO */
    protected $connection;

Severity: Minor
Found in Nine/Database/NineBase.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

Missing class import via use statement (line '126', column '43').
Open

                $this->queryBuilder = new \Opulence\QueryBuilders\MySql\QueryBuilder();
Severity: Minor
Found in Nine/Database/NineBase.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

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

    public function query($sql, array $values = [], bool $all = FALSE)
Severity: Minor
Found in Nine/Database/NineBase.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

Missing class import via use statement (line '59', column '19').
Open

        throw new \InvalidArgumentException("`$property` is not a recognizable property of " . get_called_class());
Severity: Minor
Found in Nine/Database/NineBase.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '131', column '43').
Open

                $this->queryBuilder = new \Opulence\QueryBuilders\PostgreSql\QueryBuilder();
Severity: Minor
Found in Nine/Database/NineBase.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

There are no issues that match your filters.

Category
Status