YetiForceCompany/YetiForceCRM

View on GitHub
app/Conditions/QueryFields/CurrencyListField.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

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

    public function getOrderBy($order = false): array

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

Call to method addJoin from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

        $this->queryGenerator->addJoin(['LEFT JOIN', 'vtiger_currency_info', $this->getColumnName() . ' = vtiger_currency_info.id']);

Default value for string $order can't be false
Open

    public function getOrderBy($order = false): array

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

        return ['vtiger_currency_info.currency_name' => SORT_ASC];

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     * Get order by.

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($order && 'desc' === strtolower($order)) {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $order

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getOrderBy($order = false): array

Line exceeds 120 characters; contains 133 characters
Open

        $this->queryGenerator->addJoin(['LEFT JOIN', 'vtiger_currency_info', $this->getColumnName() . ' = vtiger_currency_info.id']);

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return array

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->queryGenerator->addJoin(['LEFT JOIN', 'vtiger_currency_info', $this->getColumnName() . ' = vtiger_currency_info.id']);

Spaces must be used to indent lines; tabs are not allowed
Open

            return ['vtiger_currency_info.currency_name' => SORT_DESC];

Spaces must be used to indent lines; tabs are not allowed
Open

    }

There are no issues that match your filters.

Category
Status