CORE-POS/Common-Bundle

View on GitHub
src/sql/ConnectionWrapper.php

Summary

Maintainability
A
0 mins
Test Coverage

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

            throw new \Exception("No method $method");
Severity: Minor
Found in src/sql/ConnectionWrapper.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 $params, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function query($query_text,$whichCon='',$params=false)
Severity: Minor
Found in src/sql/ConnectionWrapper.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 parameter $query_text is not named in camelCase.
Open

    public function query($query_text,$whichCon='',$params=false)
    {
        $current = $this->connection->defaultDatabase($whichCon);
        $this->connection->selectDB($this->dbName, $whichCon);
        $ret = $this->connection->query($query_text, $whichCon='', $params);
Severity: Minor
Found in src/sql/ConnectionWrapper.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The variable $query_text is not named in camelCase.
Open

    public function query($query_text,$whichCon='',$params=false)
    {
        $current = $this->connection->defaultDatabase($whichCon);
        $this->connection->selectDB($this->dbName, $whichCon);
        $ret = $this->connection->query($query_text, $whichCon='', $params);
Severity: Minor
Found in src/sql/ConnectionWrapper.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status